; 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.
This commit is contained in:
Yuan Fu 2025-01-12 23:38:24 -08:00
parent 8cfa3447b7
commit 4687fff4f0
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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"))