helix-mirror/runtime/queries/nim/indents.scm

55 lines
802 B
Scheme
Raw Normal View History

2023-03-27 02:06:48 +04:00
[
(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