mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
chore: query formatting
This commit is contained in:
parent
79975d6557
commit
57a8acf0c4
674 changed files with 18466 additions and 12648 deletions
|
|
@ -1 +1,2 @@
|
|||
(program (list) @fold)
|
||||
(program
|
||||
(list) @fold)
|
||||
|
|
|
|||
|
|
@ -1,108 +1,103 @@
|
|||
;; A highlight query can override the highlights queries before it.
|
||||
;; So the order is important.
|
||||
;; We should highlight general rules, then highlight special forms.
|
||||
|
||||
; A highlight query can override the highlights queries before it.
|
||||
; So the order is important.
|
||||
; We should highlight general rules, then highlight special forms.
|
||||
(number) @number
|
||||
(character) @character
|
||||
(boolean) @boolean
|
||||
(string) @string
|
||||
[(comment)
|
||||
(block_comment)] @comment @spell
|
||||
|
||||
;; highlight for datum comment
|
||||
;; copied from ../clojure/highlights.scm
|
||||
([(comment) (directive)] @comment
|
||||
(#set! "priority" 105))
|
||||
(character) @character
|
||||
|
||||
(boolean) @boolean
|
||||
|
||||
(string) @string
|
||||
|
||||
[
|
||||
(comment)
|
||||
(block_comment)
|
||||
] @comment @spell
|
||||
|
||||
; highlight for datum comment
|
||||
; copied from ../clojure/highlights.scm
|
||||
([
|
||||
(comment)
|
||||
(directive)
|
||||
] @comment
|
||||
(#set! "priority" 105))
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
["(" ")" "[" "]" "{" "}"] @punctuation.bracket
|
||||
|
||||
;; variables
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
; variables
|
||||
(symbol) @variable
|
||||
|
||||
((symbol) @variable.builtin
|
||||
(#any-of? @variable.builtin "..." "."))
|
||||
(#any-of? @variable.builtin "..." "."))
|
||||
|
||||
;; procedure
|
||||
; procedure
|
||||
(list
|
||||
.
|
||||
(symbol) @function)
|
||||
|
||||
; special forms
|
||||
(list
|
||||
"["
|
||||
(symbol)+ @variable
|
||||
"]")
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @function)
|
||||
|
||||
;; special forms
|
||||
.
|
||||
(symbol) @_f
|
||||
.
|
||||
(list
|
||||
(symbol) @variable)
|
||||
(#any-of? @_f "lambda" "λ"))
|
||||
|
||||
(list
|
||||
"["
|
||||
(symbol)+ @variable
|
||||
"]")
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @_f
|
||||
.
|
||||
(list
|
||||
(symbol) @variable)
|
||||
(#any-of? @_f "lambda" "λ"))
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @_f
|
||||
.
|
||||
(list
|
||||
(list
|
||||
(symbol) @variable))
|
||||
(#any-of? @_f
|
||||
"let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax"))
|
||||
|
||||
;; operators
|
||||
.
|
||||
(symbol) @_f
|
||||
.
|
||||
(list
|
||||
(list
|
||||
(symbol) @variable))
|
||||
(#any-of? @_f "let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax"))
|
||||
|
||||
; operators
|
||||
((symbol) @operator
|
||||
(#any-of? @operator
|
||||
"+" "-" "*" "/" "=" "<=" ">=" "<" ">"))
|
||||
|
||||
;; keyword
|
||||
(#any-of? @operator "+" "-" "*" "/" "=" "<=" ">=" "<" ">"))
|
||||
|
||||
; keyword
|
||||
((symbol) @keyword
|
||||
(#any-of? @keyword
|
||||
"define" "lambda" "λ" "begin" "do" "define-syntax"
|
||||
"and" "or"
|
||||
"if" "cond" "case" "when" "unless" "else" "=>"
|
||||
"let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax"
|
||||
"set!"
|
||||
"syntax-rules" "identifier-syntax"
|
||||
"quote" "unquote" "quote-splicing" "quasiquote" "unquote-splicing"
|
||||
"delay"
|
||||
"assert"
|
||||
"library" "export" "import" "rename" "only" "except" "prefix"))
|
||||
(#any-of? @keyword "define" "lambda" "λ" "begin" "do" "define-syntax" "and" "or" "if" "cond" "case" "when" "unless" "else" "=>" "let" "let*" "let-syntax" "let-values" "let*-values" "letrec" "letrec*" "letrec-syntax" "set!" "syntax-rules" "identifier-syntax" "quote" "unquote" "quote-splicing" "quasiquote" "unquote-splicing" "delay" "assert" "library" "export" "import" "rename" "only" "except" "prefix"))
|
||||
|
||||
((symbol) @keyword.conditional
|
||||
(#any-of? @keyword.conditional "if" "cond" "case" "when" "unless"))
|
||||
|
||||
;; quote
|
||||
(#any-of? @keyword.conditional "if" "cond" "case" "when" "unless"))
|
||||
|
||||
; quote
|
||||
(quote
|
||||
"'"
|
||||
(symbol)) @string.special.symbol
|
||||
"'"
|
||||
(symbol)) @string.special.symbol
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @_f
|
||||
(#eq? @_f "quote")) @string.special.symbol
|
||||
|
||||
;; library
|
||||
.
|
||||
(symbol) @_f
|
||||
(#eq? @_f "quote")) @string.special.symbol
|
||||
|
||||
; library
|
||||
(list
|
||||
.
|
||||
(symbol) @_lib
|
||||
.
|
||||
(symbol) @module
|
||||
|
||||
(#eq? @_lib "library"))
|
||||
|
||||
;; builtin procedures
|
||||
;; procedures in R5RS and R6RS but not in R6RS-lib
|
||||
.
|
||||
(symbol) @_lib
|
||||
.
|
||||
(symbol) @module
|
||||
(#eq? @_lib "library"))
|
||||
|
||||
; builtin procedures
|
||||
; procedures in R5RS and R6RS but not in R6RS-lib
|
||||
((symbol) @function.builtin
|
||||
; format-ignore
|
||||
(#any-of? @function.builtin
|
||||
|
|
@ -180,4 +175,3 @@
|
|||
"write" "display" "newline" "write-char"
|
||||
; system
|
||||
"load" "transcript-on" "transcript-off"))
|
||||
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
(#set! injection.language "comment"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue