From 8dc08333eeaa5938227512cb14fa288f4d6823b6 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 13 Jun 2023 13:45:08 +0100 Subject: Fix bol/bos anchors in tree-sitter :match regexps Further regexp fixes to follow separately (bug#64019#29). * lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings): * lisp/progmodes/cmake-ts-mode.el (cmake-ts-mode--font-lock-settings): * lisp/progmodes/java-ts-mode.el (java-ts-mode--font-lock-settings): * lisp/progmodes/js.el (js--treesit-font-lock-settings): * lisp/progmodes/python.el (python--treesit-settings): * lisp/progmodes/rust-ts-mode.el (rust-ts-mode--font-lock-settings): * lisp/progmodes/sh-script.el (sh-mode--treesit-settings): * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): * test/src/treesit-tests.el (treesit-query-api): Anchor :match regexps at beginning/end of string, not line. --- lisp/progmodes/js.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/js.el') diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 52ed19cc682..414b6eb2baf 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3493,7 +3493,7 @@ This function is intended for use in `after-change-functions'." :language 'javascript :feature 'constant '(((identifier) @font-lock-constant-face - (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) + (:match "\\`[A-Z_][A-Z_\\d]*\\'" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) @@ -3612,7 +3612,7 @@ This function is intended for use in `after-change-functions'." :feature 'number '((number) @font-lock-number-face ((identifier) @font-lock-number-face - (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face))) + (:match "\\`\\(:?NaN\\|Infinity\\)\\'" @font-lock-number-face))) :language 'javascript :feature 'operator -- cgit v1.2.3