2023-03-27 00:06:48 +02:00
|
|
|
[
|
2024-02-29 02:49:10 +01:00
|
|
|
(if)
|
|
|
|
(when)
|
|
|
|
(elif_branch)
|
|
|
|
(else_branch)
|
|
|
|
(of_branch) ; note: not case_statement
|
|
|
|
(block)
|
|
|
|
(while)
|
|
|
|
(for)
|
|
|
|
(try)
|
|
|
|
(except_branch)
|
|
|
|
(finally_branch)
|
|
|
|
(defer)
|
|
|
|
(static_statement)
|
|
|
|
(proc_declaration)
|
|
|
|
(func_declaration)
|
|
|
|
(iterator_declaration)
|
|
|
|
(converter_declaration)
|
|
|
|
(method_declaration)
|
|
|
|
(template_declaration)
|
|
|
|
(macro_declaration)
|
|
|
|
(symbol_declaration)
|
2023-03-27 00:06:48 +02:00
|
|
|
] @indent
|
|
|
|
;; increase the indentation level
|
|
|
|
|
|
|
|
[
|
2024-02-29 02:49:10 +01:00
|
|
|
(if)
|
|
|
|
(when)
|
|
|
|
(elif_branch)
|
|
|
|
(else_branch)
|
|
|
|
(of_branch) ; note: not case_statement
|
|
|
|
(block)
|
|
|
|
(while)
|
|
|
|
(for)
|
|
|
|
(try)
|
|
|
|
(except_branch)
|
|
|
|
(finally_branch)
|
|
|
|
(defer)
|
|
|
|
(static_statement)
|
|
|
|
(proc_declaration)
|
|
|
|
(func_declaration)
|
|
|
|
(iterator_declaration)
|
|
|
|
(converter_declaration)
|
|
|
|
(method_declaration)
|
|
|
|
(template_declaration)
|
|
|
|
(macro_declaration)
|
|
|
|
(symbol_declaration)
|
2023-03-27 00:06:48 +02:00
|
|
|
] @extend
|
|
|
|
;; ???
|
|
|
|
|
|
|
|
[
|
2024-02-29 02:49:10 +01:00
|
|
|
(return_statement)
|
|
|
|
(raise_statement)
|
|
|
|
(yield_statement)
|
|
|
|
(break_statement)
|
|
|
|
(continue_statement)
|
2023-03-27 00:06:48 +02:00
|
|
|
] @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
|