chore: query formatting

This commit is contained in:
Pham Huy Hoang 2024-01-06 15:05:50 +09:00 committed by Christian Clason
parent 79975d6557
commit 57a8acf0c4
674 changed files with 18466 additions and 12648 deletions

View file

@ -1,54 +1,56 @@
;; Variables
; Variables
(list
(symbol) @variable)
(list (symbol) @variable)
(cons
(symbol) @variable)
(cons (symbol) @variable)
(scope
(symbol) @variable)
(scope (symbol) @variable)
(symbind (symbol) @variable)
;; Constants
(symbind
(symbol) @variable)
; Constants
((symbol) @constant
(#lua-match? @constant "^_*[A-Z][A-Z0-9_]*$"))
;; Functions
(list
. (symbol) @function)
;; Namespaces
; Functions
(list
.
(symbol) @function)
; Namespaces
(symbind
(symbol) @module
. (keyword))
;; Includes
.
(keyword))
; Includes
((symbol) @keyword.import
(#any-of? @keyword.import "use" "import" "load"))
;; Keywords
; Keywords
((symbol) @keyword
(#any-of? @keyword "do" "doc"))
;; Special Functions
; Special Functions
; Keywords construct a symbol
(keyword) @constructor
((list
. (symbol) @keyword.function
. (symbol) @function
.
(symbol) @keyword.function
.
(symbol) @function
(symbol)? @variable.parameter)
(#any-of? @keyword.function "def" "defop" "defn" "fn"))
((cons
. (symbol) @keyword.function
. (symbol) @function
.
(symbol) @keyword.function
.
(symbol) @function
(symbol)? @variable.parameter)
(#any-of? @keyword.function "def" "defop" "defn" "fn"))
@ -58,33 +60,38 @@
((symbol) @function.macro
(#any-of? @function.macro "op" "current-scope" "quote" "let" "provide" "module" "or" "and" "curryfn" "for" "$" "linux"))
;; Conditionals
; Conditionals
((symbol) @keyword.conditional
(#any-of? @keyword.conditional "if" "case" "cond" "when"))
;; Repeats
; Repeats
((symbol) @keyword.repeat
(#any-of? @keyword.repeat "each"))
;; Operators
; Operators
((symbol) @operator
(#any-of? @operator "&" "*" "+" "-" "<" "<=" "=" ">" ">="))
((symbol) @operator (#any-of? @operator "&" "*" "+" "-" "<" "<=" "=" ">" ">="))
; Punctuation
[
"("
")"
] @punctuation.bracket
;; Punctuation
[
"{"
"}"
] @punctuation.bracket
[ "(" ")" ] @punctuation.bracket
[ "{" "}" ] @punctuation.bracket
[ "[" "]" ] @punctuation.bracket
[
"["
"]"
] @punctuation.bracket
((symbol) @punctuation.delimiter
(#eq? @punctuation.delimiter "->"))
;; Literals
; Literals
(string) @string
(escape_sequence) @string.escape
@ -100,10 +107,7 @@
(null)
] @constant.builtin
[
"^"
] @character.special
;; Comments
"^" @character.special
; Comments
(comment) @comment @spell

View file

@ -10,11 +10,20 @@
"]"
] @indent.end
[ "(" ")" ] @indent.branch
[
"("
")"
] @indent.branch
[ "{" "}" ] @indent.branch
[
"{"
"}"
] @indent.branch
[ "[" "]" ] @indent.branch
[
"["
"]"
] @indent.branch
[
(ERROR)

View file

@ -1,2 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))
((comment) @injection.content
(#set! injection.language "comment"))

View file

@ -1,5 +1,4 @@
; Scopes
[
(list)
(scope)
@ -7,19 +6,21 @@
] @local.scope
; References
(symbol) @local.reference
; Definitions
((list
. (symbol) @_fnkw
. (symbol) @local.definition.function
.
(symbol) @_fnkw
.
(symbol) @local.definition.function
(symbol)? @local.definition.parameter)
(#any-of? @_fnkw "def" "defop" "defn" "fn"))
((cons
. (symbol) @_fnkw
. (symbol) @local.definition.function
.
(symbol) @_fnkw
.
(symbol) @local.definition.function
(symbol)? @local.definition.parameter)
(#any-of? @_fnkw "def" "defop" "defn" "fn"))