summaryrefslogtreecommitdiff
path: root/queries/tiger/indents.scm
blob: 4ac8d2452d958bea6a9ce8f60c4e46e5c7b0f651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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