From: Yuan Fu Date: Mon, 13 Jan 2025 07:38:24 +0000 (-0800) Subject: ; Move c-ts-mode keyword variables forward X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9dc61e3408e685dbeb90b40a13bb500c86a00372;p=emacs.git ; 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. (cherry picked from commit 4687fff4f0a473fd887bf0800976c356eecd7eb2) --- 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." "__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"))