mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 04:40:08 -04:00
feat(tiger): initial support
This commit is contained in:
parent
6227ae19b8
commit
ef385991b6
6 changed files with 270 additions and 0 deletions
69
queries/tiger/indents.scm
Normal file
69
queries/tiger/indents.scm
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
; Control flow {{{
|
||||
(if_expression) @indent
|
||||
"then" @branch
|
||||
"else" @branch
|
||||
|
||||
(while_expression) @indent
|
||||
"do" @branch
|
||||
|
||||
(for_expression) @indent
|
||||
"to" @branch
|
||||
; }}}
|
||||
|
||||
; Class {{{
|
||||
(class_declaration) @indent
|
||||
(class_declaration "}" @indent_end)
|
||||
|
||||
(class_type) @indent
|
||||
(class_type "}" @indent_end)
|
||||
; }}}
|
||||
|
||||
; Groups {{{
|
||||
(let_expression) @indent
|
||||
"in" @branch
|
||||
"end" @branch
|
||||
(let_expression "end" @indent_end)
|
||||
|
||||
(sequence_expression) @indent
|
||||
")" @branch
|
||||
(sequence_expression ")" @indent_end)
|
||||
; }}}
|
||||
|
||||
; Functions and methods {{{
|
||||
(parameters) @indent
|
||||
(parameters ")" @indent_end)
|
||||
|
||||
(function_call) @indent
|
||||
(method_call) @indent
|
||||
")" @branch
|
||||
|
||||
(function_declaration) @indent
|
||||
(primitive_declaration) @indent
|
||||
(method_declaration) @indent
|
||||
; }}}
|
||||
|
||||
; Values and expressions {{{
|
||||
(array_value) @indent
|
||||
"]" @branch
|
||||
(array_value "]" @indent_end)
|
||||
|
||||
(array_expression) @indent
|
||||
"of" @branch
|
||||
|
||||
(record_expression) @indent
|
||||
"}" @branch
|
||||
(record_expression "}" @indent_end)
|
||||
|
||||
(record_type) @indent
|
||||
"}" @branch
|
||||
(record_type "}" @indent_end)
|
||||
|
||||
(variable_declaration) @indent
|
||||
; }}}
|
||||
|
||||
; Misc{{{
|
||||
(comment) @ignore
|
||||
(string_literal) @ignore
|
||||
; }}}
|
||||
|
||||
; vim: sw=2 foldmethod=marker
|
||||
Loading…
Add table
Add a link
Reference in a new issue