mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 03:40:04 -04:00
feat(fennel)!: update parser and queries (#6460)
This commit is contained in:
parent
075b7594ca
commit
46f8778fbf
6 changed files with 213 additions and 180 deletions
|
|
@ -1,28 +1,56 @@
|
|||
; 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
|
||||
|
||||
[
|
||||
(let_form)
|
||||
(fn_form)
|
||||
(lambda_form)
|
||||
(each_form)
|
||||
(for_form)
|
||||
(collect_form)
|
||||
(icollect_form)
|
||||
(accumulate_form)
|
||||
(for_form)
|
||||
(fcollect_form)
|
||||
(faccumulate_form)
|
||||
(case_form)
|
||||
(match_form)
|
||||
(case_try_form)
|
||||
(match_try_form)
|
||||
(if_form)
|
||||
] @local.scope
|
||||
|
||||
(list
|
||||
.
|
||||
(symbol) @_fn
|
||||
(#any-of? @_fn "fn" "lambda" "λ")
|
||||
.
|
||||
[
|
||||
call: (symbol) @_call
|
||||
(#any-of? @_call "while" "when" "do")) @local.scope
|
||||
|
||||
(fn_form
|
||||
name: [
|
||||
(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 "&")))
|
||||
args: (sequence_arguments
|
||||
(symbol_binding) @local.definition.parameter)
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
(lambda_form
|
||||
name: [
|
||||
(symbol) @local.definition.function
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @local.definition.function .)
|
||||
]
|
||||
args: (sequence_arguments
|
||||
(symbol_binding) @local.definition.parameter)
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
||||
(macro_form
|
||||
name: [
|
||||
(symbol) @local.definition.function
|
||||
(multi_symbol
|
||||
member: (symbol_fragment) @local.definition.function .)
|
||||
]
|
||||
args: (sequence_arguments
|
||||
(symbol_binding) @local.definition.parameter)
|
||||
(#set! definition.function.scope "parent"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue