aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/hare/locals.scm
blob: 12a214bf7fd8c9cdba21228bc2061c89d2397a19 (plain) (blame)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
; Scopes
[
  (module)
  (function_declaration)
  (if_statement)
  (for_statement)
  (match_expression)
  (switch_expression)
] @local.scope

; References
[
  (identifier)
  (scoped_type_identifier)
] @local.reference

; Definitions
(global_binding
  (identifier) @local.definition.constant
  .
  ":"
  (_))

(const_declaration
  "const"
  (identifier) @local.definition.constant
  .
  "=")

(field
  .
  (identifier) @local.definition.field)

(field_assignment
  .
  (identifier) @local.definition.field)

(function_declaration
  "fn"
  .
  (identifier) @local.definition.function)

(parameter
  (_) @local.definition.parameter
  .
  ":")

(type_declaration
  "type"
  (identifier) @local.definition.type
  .
  "=")

(type_declaration
  "type"
  (identifier) @local.definition.enum
  .
  "="
  (enum_type))

(let_declaration
  "let"
  .
  (identifier) @local.definition.var
  ","?)