nvim-treesitter/queries/fennel/locals.scm
Alexei Mozaidze 7d1bab6546
feat(fennel)!: switch to maintained parser (#6132)
Change the Fennel parser to a simpler and more consistent one, along with updating all the queries.
2024-02-21 13:44:01 +00:00

26 lines
623 B
Scheme

; TODO: Add tests
; TODO: Improve queries
(program) @local.scope
((list
.
(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 "&")))