mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 19:30:02 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
39
runtime/queries/tiger/locals.scm
Normal file
39
runtime/queries/tiger/locals.scm
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
; 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.type
|
||||
(#set! definition.var.scope "parent"))
|
||||
|
||||
(parameters
|
||||
name: (identifier) @local.definition.parameter)
|
||||
|
||||
(function_declaration
|
||||
name: (identifier) @local.definition.function
|
||||
(#set! definition.var.scope "parent"))
|
||||
|
||||
(primitive_declaration
|
||||
name: (identifier) @local.definition.function
|
||||
(#set! definition.var.scope "parent"))
|
||||
|
||||
(variable_declaration
|
||||
name: (identifier) @local.definition.var
|
||||
(#set! definition.var.scope "parent"))
|
||||
|
||||
; }}}
|
||||
; References {{{
|
||||
(identifier) @local.reference
|
||||
|
||||
; }}}
|
||||
; vim: sw=2 foldmethod=marker
|
||||
Loading…
Add table
Add a link
Reference in a new issue