]> git.eshelyaron.com Git - emacs.git/commitdiff
; Move c-ts-mode keyword variables forward
authorYuan Fu <casouri@gmail.com>
Mon, 13 Jan 2025 07:38:24 +0000 (23:38 -0800)
committerEshel Yaron <me@eshelyaron.com>
Mon, 13 Jan 2025 12:12:05 +0000 (13:12 +0100)
* 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.

(cherry picked from commit 4687fff4f0a473fd887bf0800976c356eecd7eb2)

lisp/progmodes/c-ts-mode.el

index d0ed110abbba13599d999375390230ecf7055501..213c748ad2d4980d43f4ea207efd708b6adec5d2 100644 (file)
@@ -635,6 +635,25 @@ NODE, PARENT, BOL, ARGS are as usual."
     "__fastcall" "__thiscall" "__vectorcall" "_unaligned" "__unaligned")
   "MSVC keywords.")
 
+(defvar c-ts-mode--type-keywords
+  '("long" "short" "signed" "unsigned")
+  "Keywords that should be considered as part of a type.")
+
+(defvar c-ts-mode--operators
+  '("=" "-" "*" "/" "+" "%" "~" "|" "&" "^" "<<" ">>" "->"
+    "." "<" "<=" ">=" ">" "==" "!=" "!" "&&" "||" "-="
+    "+=" "*=" "/=" "%=" "|=" "&=" "^=" ">>=" "<<=" "--" "++")
+  "C/C++ operators for tree-sitter font-locking.")
+
+(defvar c-ts-mode--c++-operators
+  '(".*" "->*" "<=>")
+  "C++ operators that aren't supported by C.")
+
+(defvar c-ts-mode--c++-operator-keywords
+  '("and" "and_eq" "bitand" "bitor" "compl" "not" "not_eq" "or" "or_eq"
+    "xor" "xor_eq")
+  "C++ operators that we fontify as keywords.")
+
 (defun c-ts-mode--compute-optional-keywords (mode)
   "Return a list of keywords that are supported by the grammar.
 MODE should be either `c' or `cpp'."
@@ -678,25 +697,6 @@ MODE is either `c' or `cpp'."
                   "thread_local"))
       (append '("auto") c-keywords))))
 
-(defvar c-ts-mode--type-keywords
-  '("long" "short" "signed" "unsigned")
-  "Keywords that should be considered as part of a type.")
-
-(defvar c-ts-mode--operators
-  '("=" "-" "*" "/" "+" "%" "~" "|" "&" "^" "<<" ">>" "->"
-    "." "<" "<=" ">=" ">" "==" "!=" "!" "&&" "||" "-="
-    "+=" "*=" "/=" "%=" "|=" "&=" "^=" ">>=" "<<=" "--" "++")
-  "C/C++ operators for tree-sitter font-locking.")
-
-(defvar c-ts-mode--c++-operators
-  '(".*" "->*" "<=>")
-  "C++ operators that aren't supported by C.")
-
-(defvar c-ts-mode--c++-operator-keywords
-  '("and" "and_eq" "bitand" "bitor" "compl" "not" "not_eq" "or" "or_eq"
-    "xor" "xor_eq")
-  "C++ operators that we fontify as keywords.")
-
 (defvar c-ts-mode--for-each-tail-regexp
   (rx "FOR_EACH_" (or "TAIL" "TAIL_SAFE" "ALIST_VALUE"
                       "LIVE_BUFFER" "FRAME"))