From f6f5ef8273820b3098c8e03e09c225387879536a Mon Sep 17 00:00:00 2001 From: Vincenzo Pupillo Date: Sat, 22 Jun 2024 16:22:16 +0200 Subject: [PATCH] Fix for grammar change of keyword "virtual" in tree-sitter-cpp 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index bef74dd4664..db34339a0fd 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -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 -- 2.39.2