blob: 263672eed3f8ba6cdc49aaf2b927b558a9caa06f (
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
|
;;; DECLARATIONS AND SCOPES
;; Variable and field declarations
((variable_declarator
(identifier) @definition.var))
((variable_declarator
(field_expression object:(*) @definition.associated (property_identifier) @definition.var)))
;; Parameters
(parameters (identifier) @definition.var)
;; Loops
((loop_expression
(identifier) @definition.var))
;; Function definitions
;; Functions definitions creates both a definition and a new scope
((function
(function_name
(function_name_field
(identifier) @definition.associated
(property_identifier) @definition.method))) @scope)
((function
(function_name (identifier) @definition.function)) @scope)
((local_function
(identifier) @definition.function) @scope)
(function_definition) @scope
((if_statement) @scope)
((for_in_statement) @scope)
((repeat_statement) @scope)
((while_statement) @scope)
;;; REFERENCES
((identifier) @reference)
|