]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix font lock regex for user defined constant in PHP
authorVincenzo Pupillo <v.pupillo@gmail.com>
Sun, 16 Jun 2024 14:32:53 +0000 (16:32 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 22 Jun 2024 15:38:41 +0000 (17:38 +0200)
The old regex also captured functions with two or more
uppercase characters.  This new regex fixes that issue.
* lisp/progmodes/php-ts-mode.el (php-ts-mode--font-lock-settings):
New regex that match only user-defined constants.  (Bug#71593)

(cherry picked from commit a4fe4ca93cfdc835ecd8c5dcc98c201a1eefb546)

lisp/progmodes/php-ts-mode.el

index 8bb18dab3d5d31443cb40d001d026746ac1b73d8..71f51b23ebfb4d3ea4b5d8a0a3e952ef080beeed 100644 (file)
@@ -774,7 +774,7 @@ characters of the current line."
               @font-lock-builtin-face))
      ;; user defined constant
      ((name) @font-lock-constant-face
-      (:match "_?[A-Z][0-9A-Z_]+" @font-lock-constant-face))
+      (:match "\\`_?[A-Z][0-9A-Z_]+\\'" @font-lock-constant-face))
      (const_declaration
       (const_element (name) @font-lock-constant-face))
      (relative_scope "self") @font-lock-builtin-face