aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/nim/indents.scm
blob: 6774354070a3b56d0b0d698bd97b24c310e188ae (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
[
  (typeDef)
  (ifStmt)
  (whenStmt)
  (elifStmt)
  (elseStmt)
  (ofBranch) ; note: not caseStmt
  (whileStmt)
  (tryStmt)
  (tryExceptStmt)
  (tryFinallyStmt)
  (forStmt)
  (blockStmt)
  (staticStmt)
  (deferStmt)
  (asmStmt)
  ; exprStmt?
] @indent
;; increase the indentation level

[
  (ifStmt)
  (whenStmt)
  (elifStmt)
  (elseStmt)
  (ofBranch) ; note: not caseStmt
  (whileStmt)
  (tryStmt)
  (tryExceptStmt)
  (tryFinallyStmt)
  (forStmt)
  (blockStmt)
  (staticStmt)
  (deferStmt)
  (asmStmt)
  ; exprStmt?
] @extend
;; ???

[
  (returnStmt)
  (raiseStmt)
  (yieldStmt)
  (breakStmt)
  (continueStmt)
] @extend.prevent-once
;; end a level of indentation while staying indented

[
  ")" ; tuples
  "]" ; arrays, seqs
  "}" ; sets
] @outdent
;; end a level of indentation and unindent the line