aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/snl/indents.scm
blob: 0d65236158574c7bd52efb05c5a8c7b3da903ffb (plain) (blame)
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
[
  (field_declaration_list)
  (state_set)
  (state)
  (block)
  (member_decl)
] @indent.begin

(block
  "}" @indent.end)

[
  "else"
  "}"
] @indent.branch

(call_expression) @indent.begin

(call_expression
  ")" @indent.end)

(if_statement
  condition: (_) @indent.begin)

(if_statement
  consequence: (_) @_consequence
  (#not-kind-eq? @_consequence block)) @indent.begin

(else_statement
  consequence: (_) @_consequence
  (#not-kind-eq? @_consequence block)) @indent.begin

(while_statement
  body: (statement
    (_) @_body)
  (#not-kind-eq? @_body block)) @indent.begin

(for_statement
  body: (statement
    (_) @_body)
  (#not-kind-eq? @_body block)) @indent.begin

(init_declarator) @indent.begin

(transition
  condition: (_) @indent.begin)

[
  "#define"
  "#ifdef"
  "#if"
  "#else"
  "#endif"
] @indent.zero

[
  (preproc_arg)
  (string_literal)
] @indent.ignore

(comment) @indent.auto