unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vincenzo Pupillo <v.pupillo@gmail.com>
To: 71593@debbugs.gnu.org
Subject: bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant
Date: Sun, 16 Jun 2024 16:53:24 +0200	[thread overview]
Message-ID: <4882196.OV4Wx5bFTl@fedora> (raw)

[-- 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


             reply	other threads:[~2024-06-16 14:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16 14:53 Vincenzo Pupillo [this message]
2024-06-22  8:49 ` bug#71593: 30.050; [PATCH] php-ts-mode: Fix font lock regex for user defined constant Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4882196.OV4Wx5bFTl@fedora \
    --to=v.pupillo@gmail.com \
    --cc=71593@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).