aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuan Fu2025-01-12 23:38:24 -0800
committerYuan Fu2025-01-12 23:38:24 -0800
commit4687fff4f0a473fd887bf0800976c356eecd7eb2 (patch)
treec5175d2270931034e4ea00dafce4634949e3ccd8
parent8cfa3447b71a3586378e90e5690da6c1faaa77b6 (diff)
downloademacs-4687fff4f0a473fd887bf0800976c356eecd7eb2.tar.gz
emacs-4687fff4f0a473fd887bf0800976c356eecd7eb2.zip
; Move c-ts-mode keyword variables forward
* lisp/progmodes/c-ts-mode.el (c-ts-mode--type-keywords): (c-ts-mode--operators): (c-ts-mode--c++-operators): (c-ts-mode--c++-operator-keywords): Move before c-ts-mode--keywords to avoid undefined variable error.
-rw-r--r--lisp/progmodes/c-ts-mode.el38
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index d0ed110abbb..213c748ad2d 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -635,6 +635,25 @@ NODE, PARENT, BOL, ARGS are as usual."
635 "__fastcall" "__thiscall" "__vectorcall" "_unaligned" "__unaligned") 635 "__fastcall" "__thiscall" "__vectorcall" "_unaligned" "__unaligned")
636 "MSVC keywords.") 636 "MSVC keywords.")
637 637
638(defvar c-ts-mode--type-keywords
639 '("long" "short" "signed" "unsigned")
640 "Keywords that should be considered as part of a type.")
641
642(defvar c-ts-mode--operators
643 '("=" "-" "*" "/" "+" "%" "~" "|" "&" "^" "<<" ">>" "->"
644 "." "<" "<=" ">=" ">" "==" "!=" "!" "&&" "||" "-="
645 "+=" "*=" "/=" "%=" "|=" "&=" "^=" ">>=" "<<=" "--" "++")
646 "C/C++ operators for tree-sitter font-locking.")
647
648(defvar c-ts-mode--c++-operators
649 '(".*" "->*" "<=>")
650 "C++ operators that aren't supported by C.")
651
652(defvar c-ts-mode--c++-operator-keywords
653 '("and" "and_eq" "bitand" "bitor" "compl" "not" "not_eq" "or" "or_eq"
654 "xor" "xor_eq")
655 "C++ operators that we fontify as keywords.")
656
638(defun c-ts-mode--compute-optional-keywords (mode) 657(defun c-ts-mode--compute-optional-keywords (mode)
639 "Return a list of keywords that are supported by the grammar. 658 "Return a list of keywords that are supported by the grammar.
640MODE should be either `c' or `cpp'." 659MODE should be either `c' or `cpp'."
@@ -678,25 +697,6 @@ MODE is either `c' or `cpp'."
678 "thread_local")) 697 "thread_local"))
679 (append '("auto") c-keywords)))) 698 (append '("auto") c-keywords))))
680 699
681(defvar c-ts-mode--type-keywords
682 '("long" "short" "signed" "unsigned")
683 "Keywords that should be considered as part of a type.")
684
685(defvar c-ts-mode--operators
686 '("=" "-" "*" "/" "+" "%" "~" "|" "&" "^" "<<" ">>" "->"
687 "." "<" "<=" ">=" ">" "==" "!=" "!" "&&" "||" "-="
688 "+=" "*=" "/=" "%=" "|=" "&=" "^=" ">>=" "<<=" "--" "++")
689 "C/C++ operators for tree-sitter font-locking.")
690
691(defvar c-ts-mode--c++-operators
692 '(".*" "->*" "<=>")
693 "C++ operators that aren't supported by C.")
694
695(defvar c-ts-mode--c++-operator-keywords
696 '("and" "and_eq" "bitand" "bitor" "compl" "not" "not_eq" "or" "or_eq"
697 "xor" "xor_eq")
698 "C++ operators that we fontify as keywords.")
699
700(defvar c-ts-mode--for-each-tail-regexp 700(defvar c-ts-mode--for-each-tail-regexp
701 (rx "FOR_EACH_" (or "TAIL" "TAIL_SAFE" "ALIST_VALUE" 701 (rx "FOR_EACH_" (or "TAIL" "TAIL_SAFE" "ALIST_VALUE"
702 "LIVE_BUFFER" "FRAME")) 702 "LIVE_BUFFER" "FRAME"))