Unnamed repository; edit this file 'description' to name the repository.
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
; -----------
; Definitions
; -----------

; Variables
(assignment
  (identifier) @local.definition)

(assignment
  (tuple_expression
    (identifier) @local.definition))

; Constants
(const_statement
  (assignment
    . (identifier) @local.definition))

; let/const bindings
(let_binding
  (identifier) @local.definition)

(let_binding
  (tuple_expression
    (identifier) @local.definition))

; For bindings
(for_binding
  (identifier) @local.definition)

(for_binding
  (tuple_expression
    (identifier) @local.definition))

; Types
(struct_definition
  name: (identifier) @local.definition)

(abstract_definition
  name: (identifier) @local.definition)

(abstract_definition
  name: (identifier) @local.definition)

(type_parameter_list
  (identifier) @local.definition)

; Module imports
(import_statement
  (identifier) @local.definition)

; Parameters
(parameter_list
  (identifier) @local.definition)

(optional_parameter
  .
  (identifier) @local.definition)

(slurp_parameter
  (identifier) @local.definition)

(typed_parameter
  parameter: (identifier) @local.definition
  (_))

; Single parameter arrow function
(function_expression
  .
  (identifier) @local.definition)

; Function/macro definitions
(function_definition
  name: (identifier) @local.definition) @local.scope

(short_function_definition
  name: (identifier) @local.definition) @local.scope

(macro_definition
  name: (identifier) @local.definition) @local.scope

; ----------
; References
; ----------

(identifier) @local.reference
 
; ------
; Scopes
; ------

[
  (for_statement)
  (while_statement)
  (try_statement)
  (catch_clause)
  (finally_clause)
  (let_statement)
  (quote_statement)
  (do_clause)
] @local.scope