interplane.Get Omega
Read in your language

tree-sitter-omega

aien-dev/tree-sitter-omega

Brought by drakestapleton

branch main Branches Tags History

tree-sitter-omega / queries / locals.scm

38 lines · 874 bytes Raw Blame History
1; Omega scoping (OMEGESE.md 3 rule 4): a name first written inside a block dies at its `end`;
2; parameters live for the whole function.
3
4(function_definition) @local.scope
5
6(block) @local.scope
7
8(function_definition
9 name: (identifier) @local.definition.function)
10
11(parameter_list
12 (identifier) @local.definition.parameter)
13
14(assignment
15 name: (identifier) @local.definition.var)
16
17(for_statement
18 counter: (identifier) @local.definition.var)
19
20(global_declaration
21 name: (identifier) @local.definition.var)
22
23(text_declaration
24 name: (identifier) @local.definition.var)
25
26(const_declaration
27 name: (identifier) @local.definition.constant)
28
29(struct_declaration
30 name: (identifier) @local.definition.type)
31
32(layout_declaration
33 name: (identifier) @local.definition.type)
34
35(abstract_declaration
36 name: (identifier) @local.definition.type)
37
38(identifier) @local.reference