Subject: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant

From: Vincenzo Pupillo <[email-masked]>
Date: Sun, 16 Jun 2024 16:53:24 +0200

Hi,
the regex for user-defined constants also matches functions with two or more 
uppercase characters. 
This patch fix this.

Thanks
Vincenzo

>From ef2bdb4b65e650b3859fea658b4198e37260aff9 Mon Sep 17 00:00:00 2001
From: Vincenzo Pupillo <[email-masked]>
Date: Sun, 16 Jun 2024 16:32:53 +0200
Subject: [PATCH] Fix font lock regex for user defined constant

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.
---
 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 64138db9dc8..29fb2728280 100644
--- a/lisp/progmodes/php-ts-mode.el
+++ b/lisp/progmodes/php-ts-mode.el
@@ -774,7 +774,7 @@ php-ts-mode--font-lock-settings
               @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.45.2