feat(fennel)!: update parser and queries (#6460)

This commit is contained in:
Alexei Mozaidze 2024-04-22 13:57:55 +04:00 committed by GitHub
parent 075b7594ca
commit 46f8778fbf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 213 additions and 180 deletions

View file

@ -1,34 +1,51 @@
; compounds
[
(list)
(table)
(sequence)
] @fold
(list
.
(symbol) @_let
(#eq? @_let "let")
.
(sequence) @fold) @fold
; sub-forms / special compounds
[
(list_binding)
(table_binding)
(sequence_binding)
(table_metadata)
(sequence_arguments)
(let_vars)
(case_guard_or_special)
(case_guard)
(case_catch)
] @fold
(list
.
(symbol) @_local
(#eq? @_local "local")) @fold
; forms
[
(quote_form)
(unquote_form)
(local_form)
(var_form)
(set_form)
(global_form)
(let_form)
(fn_form)
(lambda_form)
(hashfn_form)
(each_form)
(collect_form)
(icollect_form)
(accumulate_form)
(for_form)
(fcollect_form)
(faccumulate_form)
(case_form)
(match_form)
(case_try_form)
(match_try_form)
] @fold
(list
.
(symbol) @_global
(#eq? @_global "global")) @fold
(list
.
(symbol) @_fn
(#any-of? @_fn "fn" "lambda" "λ" "hashfn")) @fold
(reader_macro
macro: [
"'"
"`"
]
; reader macros
(quote_reader_macro
expression: (_) @fold)
(quasi_quote_reader_macro
expression: (_) @fold)