mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(fennel): update parser and queries
This commit is contained in:
parent
6714daf5ac
commit
99d4f72a5c
3 changed files with 23 additions and 28 deletions
|
|
@ -57,7 +57,7 @@
|
|||
"revision": "9d5fd0c329280a156bf7614a49dc5e8c58cc037c"
|
||||
},
|
||||
"fennel": {
|
||||
"revision": "42823442a18dd2aa7b0b22dc719abb54abb3fe2e"
|
||||
"revision": "fce4331731a960077ff5f98939bc675179f1908a"
|
||||
},
|
||||
"fish": {
|
||||
"revision": "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f"
|
||||
|
|
|
|||
|
|
@ -9,6 +9,14 @@
|
|||
"]"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
":"
|
||||
":until"
|
||||
"&"
|
||||
"&as"
|
||||
"?"
|
||||
] @punctuation.special
|
||||
|
||||
(nil) @constant.builtin
|
||||
(vararg) @punctuation.special
|
||||
|
||||
|
|
@ -34,8 +42,7 @@
|
|||
((symbol) @variable.builtin
|
||||
(#match? @variable.builtin "^[$]"))
|
||||
|
||||
(sequential_table_binding (symbol) @symbol)
|
||||
(table_binding ([(_) ":" @punctuation.special] (symbol) @symbol)*)
|
||||
(binding) @symbol
|
||||
|
||||
[
|
||||
"fn"
|
||||
|
|
@ -54,8 +61,6 @@
|
|||
(multi_symbol (symbol) @function .)
|
||||
])
|
||||
|
||||
(parameters (symbol) @parameter)
|
||||
|
||||
[
|
||||
"for"
|
||||
"each"
|
||||
|
|
@ -71,21 +76,23 @@
|
|||
(#any-of? @conditional
|
||||
"if" "when"))
|
||||
|
||||
((symbol) @include
|
||||
(#any-of? @include
|
||||
"require" "require-macros" "import-macros" "include"))
|
||||
|
||||
[
|
||||
"global"
|
||||
"local"
|
||||
"let"
|
||||
"set"
|
||||
"var"
|
||||
"where"
|
||||
"or"
|
||||
] @keyword
|
||||
((symbol) @keyword
|
||||
(#any-of? @keyword
|
||||
"comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
|
||||
|
||||
((symbol) @include
|
||||
(#any-of? @include
|
||||
"require" "require-macros" "import-macros" "include"))
|
||||
|
||||
((symbol) @function.macro
|
||||
(#any-of? @function.macro
|
||||
"->" "->>" "-?>" "-?>>" "?." "accumulate" "collect" "doto" "icollect"
|
||||
|
|
|
|||
|
|
@ -8,29 +8,17 @@
|
|||
(match)
|
||||
] @scope
|
||||
|
||||
((symbol) @scope
|
||||
(#any-of? @scope
|
||||
"while" "if" "when" "do"))
|
||||
(
|
||||
(list . (symbol) @_special) @scope
|
||||
(#any-of? @_special
|
||||
"while" "if" "when" "do" "collect" "icollect" "accumulate")
|
||||
)
|
||||
|
||||
(fn name: (symbol) @definition.function)
|
||||
(lambda name: (symbol) @definition.function)
|
||||
|
||||
(parameters
|
||||
(symbol) @definition.var)
|
||||
|
||||
; TODO: use @definition.parameter for parameters
|
||||
(binding (symbol) @definition.var)
|
||||
(for_clause . (symbol) @definition.var)
|
||||
|
||||
; FIXME: how to distinguish between symbols-as-bindings and
|
||||
; symbols-as-expressions
|
||||
; (each_clause (symbol) @definition.var)
|
||||
; (let_clause ((symbol) @definition.var (_))*)
|
||||
|
||||
(global . (symbol) @definition.var)
|
||||
(local . (symbol) @definition.var)
|
||||
(var . (symbol) @definition.var)
|
||||
|
||||
(multi_value_binding (symbol) @definition.var)
|
||||
(sequential_table_binding (symbol) @definition.var)
|
||||
(table_binding ([(_) ":"] (symbol) @definition.var)*)
|
||||
|
||||
(symbol) @reference
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue