2024-02-21 17:44:01 +04:00
|
|
|
; TODO: Add tests
|
|
|
|
|
; TODO: Improve queries
|
|
|
|
|
(program) @local.scope
|
2020-08-16 20:11:56 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((list
|
|
|
|
|
.
|
2024-02-21 17:44:01 +04:00
|
|
|
(symbol) @_call) @local.scope
|
2024-02-23 17:42:01 +09:00
|
|
|
(#any-of? @_call
|
|
|
|
|
"let" "fn" "lambda" "λ" "while" "each" "for" "if" "when" "do" "collect" "icollect" "accumulate"
|
|
|
|
|
"case" "match"))
|
2021-09-10 03:49:35 +03:00
|
|
|
|
2024-02-21 17:44:01 +04:00
|
|
|
(symbol) @local.reference
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-02-21 17:44:01 +04:00
|
|
|
(list
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
2024-02-21 17:44:01 +04:00
|
|
|
(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 "&")))
|