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
|
|
|
|
|
((function
|
2020-04-23 10:29:41 +02:00
|
|
|
(function_name
|
|
|
|
|
(function_name_field
|
2021-02-06 22:29:14 -05:00
|
|
|
(identifier) @definition.associated . (property_identifier) @definition.method)))
|
|
|
|
|
(#set! definition.method.scope "parent"))
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
((function
|
2021-02-06 22:29:14 -05:00
|
|
|
(function_name (identifier) @definition.function))
|
|
|
|
|
(#set! definition.function.scope "parent"))
|
|
|
|
|
|
|
|
|
|
((local_function (identifier) @definition.function)
|
|
|
|
|
(#set! definition.function.scope "parent"))
|
2020-04-18 19:21:01 +02:00
|
|
|
|
2020-11-26 01:11:29 +00:00
|
|
|
(local_variable_declaration
|
2021-02-06 22:29:14 -05:00
|
|
|
(variable_declarator (identifier) @definition.function) . (function_definition))
|
2020-11-26 01:59:43 +00:00
|
|
|
|
2021-02-06 22:29:14 -05:00
|
|
|
;; Scopes
|
2021-01-27 09:32:45 +01:00
|
|
|
[
|
|
|
|
|
(program)
|
2021-02-06 22:29:14 -05:00
|
|
|
(function)
|
|
|
|
|
(local_function)
|
|
|
|
|
(function_definition)
|
2021-01-27 09:32:45 +01:00
|
|
|
(if_statement)
|
|
|
|
|
(for_in_statement)
|
|
|
|
|
(repeat_statement)
|
|
|
|
|
(while_statement)
|
|
|
|
|
(do_statement)
|
|
|
|
|
] @scope
|
2020-04-18 19:21:01 +02:00
|
|
|
|
|
|
|
|
;;; REFERENCES
|
2021-01-27 09:32:45 +01:00
|
|
|
[
|
|
|
|
|
(identifier)
|
|
|
|
|
(property_identifier)
|
|
|
|
|
] @reference
|