unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant
@ 2024-06-16 14:53 Vincenzo Pupillo
  2024-06-22  8:49 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Vincenzo Pupillo @ 2024-06-16 14:53 UTC (permalink / raw)
  To: 71593

[-- Attachment #1: Type: text/plain, Size: 142 bytes --]

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

Thanks
Vincenzo

[-- Attachment #2: 0001-Fix-font-lock-regex-for-user-defined-constant.patch --]
[-- Type: text/x-patch, Size: 1163 bytes --]

From ef2bdb4b65e650b3859fea658b4198e37260aff9 Mon Sep 17 00:00:00 2001
From: Vincenzo Pupillo <v.pupillo@gmail.com>
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-22  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-16 14:53 bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant Vincenzo Pupillo
2024-06-22  8:49 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).