From 117d3f197fe1e50d6cf679add8660e521bfeff29 Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Sun, 16 Jun 2024 16:32:53 +0200 Subject: [PATCH] Fix font lock regex for user defined constant in PHP 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/php-ts-mode.el b/lisp/progmodes/php-ts-mode.el index 8bb18dab3d5..71f51b23ebf 100644 --- a/lisp/progmodes/php-ts-mode.el +++ b/lisp/progmodes/php-ts-mode.el @@ -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 -- 2.39.2