Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/teal/locals.scm')
-rw-r--r--runtime/queries/teal/locals.scm25
1 files changed, 25 insertions, 0 deletions
diff --git a/runtime/queries/teal/locals.scm b/runtime/queries/teal/locals.scm
new file mode 100644
index 00000000..879aa71c
--- /dev/null
+++ b/runtime/queries/teal/locals.scm
@@ -0,0 +1,25 @@
+
+(var_declaration
+ declarators: (var_declarators
+ (var (identifier)) @local.definition))
+
+(var_assignment
+ variables: (assignment_variables
+ (var (identifier) @local.definition)))
+
+(arg name: (identifier) @local.definition)
+
+(anon_function) @local.scope
+((function_statement
+ (function_name) @local.definition) @local.scope)
+
+(program) @local.scope
+(if_statement) @local.scope
+(generic_for_statement (for_body) @local.scope)
+(numeric_for_statement (for_body) @local.scope)
+(repeat_statement) @local.scope
+(while_statement (while_body) @local.scope)
+(do_statement) @local.scope
+
+(identifier) @local.reference
+