Subject: bug#71593: closed (Re: bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 22 Jun 2024 08:51:01 +0000

Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
71593: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71593
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant
From: Eli Zaretskii <[email-masked]>
To: Vincenzo Pupillo <[email-masked]>
Cc: [email-masked]
Date: Sat, 22 Jun 2024 11:49:51 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Vincenzo Pupillo <[email-masked]>
> Date: Sun, 16 Jun 2024 16:53:24 +0200
> 
> the regex for user-defined constants also matches functions with two or more 
> uppercase characters. 
> This patch fix this.

Thanks, installed, and closing the bug.

Subject: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant
From: Vincenzo Pupillo <[email-masked]>
To: [email-masked]
Date: Sun, 16 Jun 2024 16:53:24 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

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