1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 12:50:03 +08:00
SpaceVim/bundle/nvim-treesitter-0.9.1/queries/commonlisp/highlights.scm

146 lines
14 KiB
Scheme
Raw Normal View History

(sym_lit) @variable
;; A highlighting for functions/macros in th cl namespace is available in theHamsta/nvim-treesitter-commonlisp
;(list_lit . (sym_lit) @function.builtin (#cl-standard-function? @function.builtin))
;(list_lit . (sym_lit) @function.builtin (#cl-standard-macro? @function.macro))
(dis_expr) @comment
(defun_keyword) @function.macro
(defun_header
function_name: (_) @function)
(defun_header
lambda_list: (list_lit (sym_lit) @parameter))
(defun_header
keyword: (defun_keyword "defmethod")
lambda_list: (list_lit (list_lit . (sym_lit) . (sym_lit) @symbol)))
(defun_header
lambda_list: (list_lit (list_lit . (sym_lit) @parameter . (_))))
(defun_header
specifier: (sym_lit) @symbol)
[":" "::" "."] @punctuation.special
[
(accumulation_verb)
(for_clause_word)
"for"
"and"
"finally"
"thereis"
"always"
"when"
"if"
"unless"
"else"
"do"
"loop"
"below"
"in"
"from"
"across"
"repeat"
"being"
"into"
"with"
"as"
"while"
"until"
"return"
"initially"
] @function.macro
"=" @operator
(include_reader_macro) @symbol
["#C" "#c"] @number
[(kwd_lit) (self_referential_reader_macro)] @symbol
(package_lit
package: (_) @namespace)
"cl" @namespace
(str_lit) @string
(num_lit) @number
((sym_lit) @boolean (#any-of? @boolean "t" "T"))
(nil_lit) @constant.builtin
(comment) @comment @spell
;; dynamic variables
((sym_lit) @variable.builtin
(#lua-match? @variable.builtin "^[*].+[*]$"))
;; quote
"'" @string.escape
(format_specifier) @string.escape
(quoting_lit) @string.escape
;; syntax quote
"`" @string.escape
"," @string.escape
",@" @string.escape
(syn_quoting_lit) @string.escape
(unquoting_lit) @none
(unquote_splicing_lit) @none
["(" ")"] @punctuation.bracket
(block_comment) @comment @spell
(with_clause
type: (_) @type)
(for_clause
type: (_) @type)
;; defun-like things
(list_lit
.
(sym_lit) @function.macro
.
(sym_lit) @function
(#eq? @function.macro "deftest"))
;;; Macros and Special Operators
(list_lit
.
(sym_lit) @function.macro
;; Generated via https://github.com/theHamsta/nvim-treesitter-commonlisp/blob/22fdc9fd6ed594176cc7299cc6f68dd21c94c63b/scripts/generate-symbols.lisp#L1-L21
(#any-of? @function.macro
"do*" "step" "handler-bind" "decf" "prog1" "destructuring-bind" "defconstant" "do" "lambda" "with-standard-io-syntax" "case" "restart-bind" "ignore-errors" "with-slots" "prog2" "defclass" "define-condition" "print-unreadable-object" "defvar" "when" "with-open-file" "prog" "incf" "declaim" "and" "loop-finish" "multiple-value-bind" "pop" "psetf" "defmacro" "with-open-stream" "define-modify-macro" "defsetf" "formatter" "call-method" "handler-case" "pushnew" "or" "with-hash-table-iterator" "ecase" "cond" "defun" "remf" "ccase" "define-compiler-macro" "dotimes" "multiple-value-list" "assert" "deftype" "with-accessors" "trace" "with-simple-restart" "do-symbols" "nth-value" "define-symbol-macro" "psetq" "rotatef" "dolist" "check-type" "multiple-value-setq" "push" "pprint-pop" "loop" "define-setf-expander" "pprint-exit-if-list-exhausted" "with-condition-restarts" "defstruct" "with-input-from-string" "with-compilation-unit" "defgeneric" "with-output-to-string" "untrace" "defparameter" "ctypecase" "do-external-symbols" "etypecase" "do-all-symbols" "with-package-iterator" "unless" "defmethod" "in-package" "defpackage" "return" "typecase" "shiftf" "setf" "pprint-logical-block" "time" "restart-case" "prog*" "define-method-combination" "optimize"))
;; constant
((sym_lit) @constant
(#lua-match? @constant "^[+].+[+]$"))
(var_quoting_lit
marker: "#'" @symbol
value: (_) @symbol)
["#" "#p" "#P"] @symbol
(list_lit
.
(sym_lit) @function.builtin
;; Generated via https://github.com/theHamsta/nvim-treesitter-commonlisp/blob/22fdc9fd6ed594176cc7299cc6f68dd21c94c63b/scripts/generate-symbols.lisp#L1-L21
(#any-of? @function.builtin
"apropos-list" "subst" "substitute" "pprint-linear" "file-namestring" "write-char" "do*" "slot-exists-p" "file-author" "macro-function" "rassoc" "make-echo-stream" "arithmetic-error-operation" "position-if-not" "list" "cdadr" "lisp-implementation-type" "vector-push" "let" "length" "string-upcase" "adjoin" "digit-char" "step" "member-if" "handler-bind" "lognot" "apply" "gcd" "slot-unbound" "stringp" "values-list" "stable-sort" "decode-float" "make-list" "rplaca" "isqrt" "export" "synonym-stream-symbol" "function-keywords" "replace" "tanh" "maphash" "code-char" "decf" "array-displacement" "string-not-lessp" "slot-value" "remove-if" "cell-error-name" "vectorp" "cdddar" "two-way-stream-output-stream" "parse-integer" "get-internal-real-time" "fourth" "make-string" "slot-missing" "byte-size" "string-trim" "nstring-downcase" "cdaddr" "<" "labels" "interactive-stream-p" "fifth" "max" "logxor" "pathname-name" "function" "realp" "eql" "logand" "short-site-name" "prog1" "user-homedir-pathname" "list-all-packages" "exp" "cadar" "read-char-no-hang" "package-error-package" "stream-external-format" "bit-andc2" "nsubstitute-if" "mapcar" "complement" "load-logical-pathname-translations" "pprint-newline" "oddp" "caaar" "destructuring-bind" "copy-alist" "acos" "go" "bit-nor" "defconstant" "fceiling" "tenth" "nreverse" "=" "nunion" "slot-boundp" "string>" "count-if" "atom" "char=" "random-state-p" "row-major-aref" "bit-andc1" "translate-pathname" "simple-vector-p" "coerce" "substitute-if-not" "zerop" "invalid-method-error" "compile" "realpart" "remove-if-not" "pprint-tab" "hash-table-rehash-threshold" "invoke-restart" "if" "count" "/=" "do" "initialize-instance" "abs" "schar" "simple-condition-format-control" "delete-package" "subst-if" "lambda" "hash-table-count" "array-has-fill-pointer-p" "bit" "with-standard-io-syntax" "parse-namestring" "proclaim" "array-in-bounds-p" "multiple-value-call" "rplacd" "some" "graphic-char-p" "read-from-string" "consp" "cadaar" "acons" "every" "make-pathname" "mask-field" "case" "set-macro-character" "bit-and" "restart-bind" "echo-stream-input-stream" "compile-file" "fill-pointer" "numberp" "acosh" "array-dimensions" "documentation" "minusp" "inspect" "copy-structure" "integer-length" "ensure-generic-function" "char>=" "quote" "lognor" "make-two-way-stream" "ignore-errors" "tailp" "with-slots" "fboundp" "logical-pathname-translations" "equal" "float-sign" "shadow" "sleep" "numerator" "prog2" "getf" "ldb-test" "round" "locally" "echo-stream-output-stream" "log" "get-macro-character" "alphanumericp" "find-method" "nintersection" "defclass" "define-condition" "print-unreadable-object" "defvar" "broadcast-stream-streams" "floatp" "subst-if-not" "integerp" "translate-logical-pathname" "subsetp" "when" "write-string" "with-open-file" "clrhash" "apropos" "intern" "min" "string-greaterp" "import" "nset-difference" "prog" "incf" "both-case-p" "multiple-value-prog1" "characterp" "streamp" "digit-char-p" "random" "string-lessp" "make-string-input-stream" "copy-symbol" "read-sequence" "logcount" "bit-not" "boundp" "encode-universal-time" "third" "declaim" "map" "cons" "set-syntax-from-char" "and" "cis" "symbol-plist" "loop-finish" "standard-char-p" "multiple-value-bind" "asin" "string" "pop" "complex" "fdefinition" "psetf" "type-error-datum" "output-stream-p" "floor" "write-line" "<=" "defmacro" "rational" "hash-table-test" "with-open-stream" "read-char" "string-capitalize" "get-properties" "y-or-n-p" "use-package" "remove" "compiler-macro-function" "read" "package-nicknames" "remove-duplicates" "make-load-form-saving-slots" "dribble" "define-modify-macro" "make-dispatch-macro-character" "close" "cosh" "open" "finish-output" "string-downcase" "car" "nstring-capitalize" "software-type" "read-preserving-whitespace" "cadr" "fround" "nsublis" "defsetf" "find-all-symbols" "char>" "no-applicable-method" "compute-restarts" "pathname" "bit-orc2" "write-sequence" "pprint-tabular" "symbol-value" "char-name" "get-decoded-time" "formatter" "bit-vector-p" "intersection" "pathname-type" "clear-input" "call-method" "princ-to-strin
(list_lit
.
(sym_lit) @operator
(#match? @operator "^([+*-+=<>]|<=|>=|/=)$"))
((sym_lit) @symbol
(#lua-match? @symbol "^[&]"))
[(array_dimension) "#0A" "#0a"] @number
(char_lit) @character