2020-09-11 10:21:39 +01:00
|
|
|
; Scopes
|
|
|
|
|
;-------
|
2020-09-11 10:47:30 +01:00
|
|
|
[
|
2020-09-21 02:11:46 +02:00
|
|
|
(compilation_unit)
|
|
|
|
|
(structure)
|
|
|
|
|
(signature)
|
|
|
|
|
(module_binding)
|
|
|
|
|
(functor)
|
2020-09-11 10:47:30 +01:00
|
|
|
(let_binding)
|
2020-09-21 02:11:46 +02:00
|
|
|
(match_case)
|
2020-09-11 10:47:30 +01:00
|
|
|
(class_binding)
|
|
|
|
|
(class_function)
|
|
|
|
|
(method_definition)
|
2020-09-21 02:11:46 +02:00
|
|
|
(let_expression)
|
2020-09-11 10:47:30 +01:00
|
|
|
(fun_expression)
|
|
|
|
|
(for_expression)
|
2020-09-21 02:11:46 +02:00
|
|
|
(let_class_expression)
|
|
|
|
|
(object_expression)
|
|
|
|
|
(attribute_payload)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.scope
|
2020-09-11 10:21:39 +01:00
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
|
;------------
|
2023-07-22 15:29:32 +02:00
|
|
|
(value_pattern) @local.definition.var
|
2020-09-21 02:11:46 +02:00
|
|
|
|
|
|
|
|
(let_binding
|
2023-07-22 15:29:32 +02:00
|
|
|
pattern: (value_name) @local.definition.var
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! definition.var.scope "parent"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
|
|
|
|
(let_binding
|
2024-03-21 20:44:35 +09:00
|
|
|
pattern: (tuple_pattern
|
|
|
|
|
(value_name) @local.definition.var)
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! definition.var.scope "parent"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
|
|
|
|
(let_binding
|
2024-03-21 20:44:35 +09:00
|
|
|
pattern: (record_pattern
|
|
|
|
|
(field_pattern
|
|
|
|
|
(value_name) @local.definition.var))
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! definition.var.scope "parent"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(external
|
|
|
|
|
(value_name) @local.definition.var)
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(type_binding
|
|
|
|
|
(type_constructor) @local.definition.type)
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(abstract_type
|
|
|
|
|
(type_constructor) @local.definition.type)
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(method_definition
|
|
|
|
|
(method_name) @local.definition.method)
|
2020-09-21 02:11:46 +02:00
|
|
|
|
|
|
|
|
(module_binding
|
2023-07-22 15:29:32 +02:00
|
|
|
(module_name) @local.definition.namespace
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! definition.namespace.scope "parent"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(module_parameter
|
|
|
|
|
(module_name) @local.definition.namespace)
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(module_type_definition
|
|
|
|
|
(module_type_name) @local.definition.type)
|
2020-09-11 10:21:39 +01:00
|
|
|
|
|
|
|
|
; References
|
|
|
|
|
;------------
|
2024-01-06 15:05:50 +09:00
|
|
|
(value_path
|
|
|
|
|
.
|
2023-07-22 15:29:32 +02:00
|
|
|
(value_name) @local.reference
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! reference.kind "var"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(type_constructor_path
|
|
|
|
|
.
|
2023-07-22 15:29:32 +02:00
|
|
|
(type_constructor) @local.reference
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! reference.kind "type"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
|
|
|
|
(method_invocation
|
2023-07-22 15:29:32 +02:00
|
|
|
(method_name) @local.reference
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! reference.kind "method"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(module_path
|
|
|
|
|
.
|
2023-07-22 15:29:32 +02:00
|
|
|
(module_name) @local.reference
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! reference.kind "type"))
|
2020-09-21 02:11:46 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(module_type_path
|
|
|
|
|
.
|
2023-07-22 15:29:32 +02:00
|
|
|
(module_type_name) @local.reference
|
2023-06-21 09:14:44 +02:00
|
|
|
(#set! reference.kind "type"))
|