mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 12:20:02 -04:00
feat(fennel)!: switch to maintained parser (#6132)
Change the Fennel parser to a simpler and more consistent one, along with updating all the queries.
This commit is contained in:
parent
71ae32c187
commit
7d1bab6546
6 changed files with 398 additions and 107 deletions
|
|
@ -1,32 +1,26 @@
|
|||
[
|
||||
(program)
|
||||
(fn)
|
||||
(lambda)
|
||||
(let)
|
||||
(each)
|
||||
(for)
|
||||
(match)
|
||||
] @local.scope
|
||||
; TODO: Add tests
|
||||
; TODO: Improve queries
|
||||
(program) @local.scope
|
||||
|
||||
((list
|
||||
.
|
||||
(symbol) @_special) @local.scope
|
||||
(#any-of? @_special "while" "if" "when" "do" "collect" "icollect" "accumulate"))
|
||||
|
||||
(fn
|
||||
name: (symbol) @local.definition.function
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
(lambda
|
||||
name: (symbol) @local.definition.function
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
; TODO: use @local.definition.parameter for parameters
|
||||
(binding
|
||||
(symbol) @local.definition.var)
|
||||
|
||||
(for_clause
|
||||
.
|
||||
(symbol) @local.definition.var)
|
||||
(symbol) @_call) @local.scope
|
||||
(#any-of? @_call "let" "fn" "lambda" "λ" "while" "each" "for" "if" "when" "do" "collect" "icollect" "accumulate" "case" "match"))
|
||||
|
||||
(symbol) @local.reference
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @_fn
|
||||
(#any-of? @_fn "fn" "lambda" "λ")
|
||||
.
|
||||
[
|
||||
(symbol) @local.definition.function
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @local.definition.function .)
|
||||
]
|
||||
(#set! definition.function.scope "parent")
|
||||
.
|
||||
(sequence
|
||||
(symbol)* @local.definition.parameter
|
||||
(#not-contains? @local.definition.parameter "&")))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue