diff options
| author | Bruno BELANYI <bruno@belanyi.fr> | 2022-06-14 17:24:28 +0200 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-06-14 22:34:03 +0200 |
| commit | ef385991b615807df3731b5f0779895515999f33 (patch) | |
| tree | 6c0aa246b08798d9c33a3e2b6faf3660c75d076b /queries/tiger/locals.scm | |
| parent | 6227ae19b88061ec69770d7ef712a4d76c108acb (diff) | |
feat(tiger): initial support
Diffstat (limited to 'queries/tiger/locals.scm')
| -rw-r--r-- | queries/tiger/locals.scm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/queries/tiger/locals.scm b/queries/tiger/locals.scm new file mode 100644 index 00000000..70baf874 --- /dev/null +++ b/queries/tiger/locals.scm @@ -0,0 +1,35 @@ +; See this issue [1] for support for "lazy scoping" which is somewhat needed +; for Tiger semantics (e.g: one can call a function before it has been defined +; top-to-bottom). +; +; [1]: https://github.com/tree-sitter/tree-sitter/issues/918 + +; Scopes {{{ +[ + (for_expression) + (let_expression) + (function_declaration) +] @local.scope +; }}} + +; Definitions {{{ +(type_declaration + name: (identifier) @local.definition) + +(parameters + name: (identifier) @local.definition) + +(function_declaration + name: (identifier) @local.definition) +(primitive_declaration + name: (identifier) @local.definition) + +(variable_declaration + name: (identifier) @local.definition) +; }}} + +; References {{{ +(identifier) @local.reference +; }}} + +; vim: sw=2 foldmethod=marker |
