aboutsummaryrefslogtreecommitdiffstats
path: root/queries/t32/locals.scm
diff options
context:
space:
mode:
Diffstat (limited to 'queries/t32/locals.scm')
-rw-r--r--queries/t32/locals.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/queries/t32/locals.scm b/queries/t32/locals.scm
new file mode 100644
index 000000000..dd03b4246
--- /dev/null
+++ b/queries/t32/locals.scm
@@ -0,0 +1,35 @@
+(block) @scope
+
+; Parameter definitions
+(parameter_declaration
+ command: (identifier)
+ macro: (macro) @definition.parameter)
+
+; Variable definitions
+(macro_definition
+ command: (identifier)
+ macro: (macro) @definition.var)
+
+(command_expression
+ command: (identifier)
+ arguments: (argument_list
+ variable: (identifier) @definition.var))
+
+; Function definitions
+(subroutine_block
+ command: (identifier)
+ subroutine: (identifier) @definition.function)
+
+(labeled_expression
+ label: (identifier) @definition.function
+ (block))
+
+; References
+(
+ (subroutine_call_expression
+ command: (identifier)
+ subroutine: (identifier) @reference)
+ (set! reference.kind "function")
+)
+
+(macro) @reference