2020-04-18 19:21:01 +02:00
|
|
|
;;; DECLARATIONS AND SCOPES
|
|
|
|
|
|
|
|
|
|
;; Variable and field declarations
|
|
|
|
|
((variable_declarator
|
2020-05-07 09:23:33 +02:00
|
|
|
(identifier) @definition.var))
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
((variable_declarator
|
2020-11-25 21:26:31 +01:00
|
|
|
(field_expression . (_) @definition.associated (property_identifier) @definition.var)))
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
;; Parameters
|
2020-08-15 09:24:24 -05:00
|
|
|
(parameters (identifier) @definition.parameter)
|
2020-04-18 19:21:01 +02:00
|
|
|
|
2020-04-23 10:29:41 +02:00
|
|
|
;; Loops
|
|
|
|
|
((loop_expression
|
2020-05-07 09:23:33 +02:00
|
|
|
(identifier) @definition.var))
|
2020-04-23 10:29:41 +02:00
|
|
|
|
2020-04-18 19:21:01 +02:00
|
|
|
;; Function definitions
|
|
|
|
|
;; Functions definitions creates both a definition and a new scope
|
|
|
|
|
((function
|
2020-04-23 10:29:41 +02:00
|
|
|
(function_name
|
|
|
|
|
(function_name_field
|
|
|
|
|
(identifier) @definition.associated
|
2020-05-07 09:23:33 +02:00
|
|
|
(property_identifier) @definition.method))) @scope)
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
((function
|
2020-05-07 09:23:33 +02:00
|
|
|
(function_name (identifier) @definition.function)) @scope)
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
((local_function
|
2020-05-07 09:23:33 +02:00
|
|
|
(identifier) @definition.function) @scope)
|
2020-11-26 01:59:43 +00:00
|
|
|
[
|
2020-11-26 01:11:29 +00:00
|
|
|
(local_variable_declaration
|
|
|
|
|
(variable_declarator
|
|
|
|
|
(identifier) @definition.function)
|
|
|
|
|
(function_definition) @scope)
|
2020-11-26 01:59:43 +00:00
|
|
|
(function_definition) @scope
|
|
|
|
|
]
|
|
|
|
|
|
2020-11-26 01:11:29 +00:00
|
|
|
|
2020-08-03 01:03:50 +02:00
|
|
|
(program) @scope
|
2020-04-18 19:21:01 +02:00
|
|
|
((if_statement) @scope)
|
|
|
|
|
((for_in_statement) @scope)
|
|
|
|
|
((repeat_statement) @scope)
|
2020-04-23 10:29:41 +02:00
|
|
|
((while_statement) @scope)
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
;;; REFERENCES
|
|
|
|
|
((identifier) @reference)
|
2020-08-03 01:03:50 +02:00
|
|
|
((property_identifier) @reference)
|