feat(t32): add indent rules (#4782)

This commit is contained in:
Christoph Sax 2023-05-18 09:40:13 +02:00 committed by GitHub
parent 102f1b2f55
commit 16cce8df58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 291 additions and 5 deletions

View file

@ -121,6 +121,7 @@
; Parameter declarations
(parameter_declaration
command: (identifier) @keyword
(identifier)? @constant.builtin
macro: (macro) @parameter)
; Control flow

36
queries/t32/indents.scm Normal file
View file

@ -0,0 +1,36 @@
; Subroutines & scoping
(block
")" @indent.branch .) @indent.begin
; Control flow statements
(
(if_block
_*
condition: (_)
. (_) @_then) @indent.begin
(#not-has-type? @_then block)
)
(else_block) @indent.branch
(else_block
(if_block) @indent.dedent) @indent.branch
(
(else_block
(if_block
_*
condition: (_)
. (_) @_then)) @indent.branch
(#not-has-type? @_then block)
)
(while_block
(command_expression)) @indent.begin
(repeat_block
(command_expression)) @indent.begin
(comment) @indent.ignore