summaryrefslogtreecommitdiff
path: root/queries/fennel/locals.scm
blob: 3018732f97af7984b958edb976d56e729b61f0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[
 (program)
 (fn)
 (lambda)
 (let)
 (each)
 (for)
 (match)
] @scope

(
  (list . (symbol) @_special) @scope
  (#any-of? @_special
   "while" "if" "when" "do" "collect" "icollect" "accumulate")
)

(fn name: (symbol) @definition.function
  (#set! definition.function.scope "parent"))
(lambda name: (symbol) @definition.function
  (#set! definition.function.scope "parent"))

; TODO: use @definition.parameter for parameters
(binding (symbol) @definition.var)
(for_clause . (symbol) @definition.var)

(symbol) @reference