]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix for grammar change of keyword "virtual" in tree-sitter-cpp
authorVincenzo Pupillo <v.pupillo@gmail.com>
Sat, 22 Jun 2024 14:22:16 +0000 (16:22 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 22 Jun 2024 20:41:53 +0000 (22:41 +0200)
The new rule works with both the new (>= 0.22.1) and the
old (<= 0.22.0) grammar libraries.

* lisp/progmodes/c-ts-mode.el (c-ts-mode--keywords): Removed
the keyword "virtual".
* lisp/progmodes/c-ts-mode.el (c-ts-mode--font-lock-settings):
New font lock rule. (Bug#71518)

(cherry picked from commit 014aab9847a0d3d898cb8cbc7224143f2d741abb)

lisp/progmodes/c-ts-mode.el

index bef74dd46640a727429294399022cdd62ce27744..db34339a0fd9e173140cd1bcec91b4ed20c374f6 100644 (file)
@@ -572,7 +572,7 @@ MODE is either `c' or `cpp'."
                   "not" "not_eq" "operator" "or"
                   "or_eq" "override" "private" "protected"
                   "public" "requires" "template" "throw"
-                  "try" "typename" "using" "virtual"
+                  "try" "typename" "using"
                   "xor" "xor_eq"))
       (append '("auto") c-keywords))))
 
@@ -635,7 +635,8 @@ MODE is either `c' or `cpp'."
    `([,@(c-ts-mode--keywords mode)] @font-lock-keyword-face
      ,@(when (eq mode 'cpp)
          '((auto) @font-lock-keyword-face
-           (this) @font-lock-keyword-face)))
+           (this) @font-lock-keyword-face
+           (virtual) @font-lock-keyword-face)))
 
    :language mode
    :feature 'operator