mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -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"
|
"revision": "9d5fd0c329280a156bf7614a49dc5e8c58cc037c"
|
||||||
},
|
},
|
||||||
"fennel": {
|
"fennel": {
|
||||||
"revision": "42823442a18dd2aa7b0b22dc719abb54abb3fe2e"
|
"revision": "fce4331731a960077ff5f98939bc675179f1908a"
|
||||||
},
|
},
|
||||||
"fish": {
|
"fish": {
|
||||||
"revision": "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f"
|
"revision": "04e54ab6585dfd4fee6ddfe5849af56f101b6d4f"
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,14 @@
|
||||||
"]"
|
"]"
|
||||||
] @punctuation.bracket
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
":"
|
||||||
|
":until"
|
||||||
|
"&"
|
||||||
|
"&as"
|
||||||
|
"?"
|
||||||
|
] @punctuation.special
|
||||||
|
|
||||||
(nil) @constant.builtin
|
(nil) @constant.builtin
|
||||||
(vararg) @punctuation.special
|
(vararg) @punctuation.special
|
||||||
|
|
||||||
|
|
@ -34,8 +42,7 @@
|
||||||
((symbol) @variable.builtin
|
((symbol) @variable.builtin
|
||||||
(#match? @variable.builtin "^[$]"))
|
(#match? @variable.builtin "^[$]"))
|
||||||
|
|
||||||
(sequential_table_binding (symbol) @symbol)
|
(binding) @symbol
|
||||||
(table_binding ([(_) ":" @punctuation.special] (symbol) @symbol)*)
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"fn"
|
"fn"
|
||||||
|
|
@ -54,8 +61,6 @@
|
||||||
(multi_symbol (symbol) @function .)
|
(multi_symbol (symbol) @function .)
|
||||||
])
|
])
|
||||||
|
|
||||||
(parameters (symbol) @parameter)
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"for"
|
"for"
|
||||||
"each"
|
"each"
|
||||||
|
|
@ -71,21 +76,23 @@
|
||||||
(#any-of? @conditional
|
(#any-of? @conditional
|
||||||
"if" "when"))
|
"if" "when"))
|
||||||
|
|
||||||
((symbol) @include
|
|
||||||
(#any-of? @include
|
|
||||||
"require" "require-macros" "import-macros" "include"))
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"global"
|
"global"
|
||||||
"local"
|
"local"
|
||||||
"let"
|
"let"
|
||||||
"set"
|
"set"
|
||||||
"var"
|
"var"
|
||||||
|
"where"
|
||||||
|
"or"
|
||||||
] @keyword
|
] @keyword
|
||||||
((symbol) @keyword
|
((symbol) @keyword
|
||||||
(#any-of? @keyword
|
(#any-of? @keyword
|
||||||
"comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
|
"comment" "do" "doc" "eval-compiler" "lua" "macros" "quote" "tset" "values"))
|
||||||
|
|
||||||
|
((symbol) @include
|
||||||
|
(#any-of? @include
|
||||||
|
"require" "require-macros" "import-macros" "include"))
|
||||||
|
|
||||||
((symbol) @function.macro
|
((symbol) @function.macro
|
||||||
(#any-of? @function.macro
|
(#any-of? @function.macro
|
||||||
"->" "->>" "-?>" "-?>>" "?." "accumulate" "collect" "doto" "icollect"
|
"->" "->>" "-?>" "-?>>" "?." "accumulate" "collect" "doto" "icollect"
|
||||||
|
|
|
||||||
|
|
@ -8,29 +8,17 @@
|
||||||
(match)
|
(match)
|
||||||
] @scope
|
] @scope
|
||||||
|
|
||||||
((symbol) @scope
|
(
|
||||||
(#any-of? @scope
|
(list . (symbol) @_special) @scope
|
||||||
"while" "if" "when" "do"))
|
(#any-of? @_special
|
||||||
|
"while" "if" "when" "do" "collect" "icollect" "accumulate")
|
||||||
|
)
|
||||||
|
|
||||||
(fn name: (symbol) @definition.function)
|
(fn name: (symbol) @definition.function)
|
||||||
(lambda name: (symbol) @definition.function)
|
(lambda name: (symbol) @definition.function)
|
||||||
|
|
||||||
(parameters
|
; TODO: use @definition.parameter for parameters
|
||||||
(symbol) @definition.var)
|
(binding (symbol) @definition.var)
|
||||||
|
|
||||||
(for_clause . (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
|
(symbol) @reference
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue