mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 09:20:04 -04:00
feat(t32): add indent rules (#4782)
This commit is contained in:
parent
102f1b2f55
commit
16cce8df58
11 changed files with 291 additions and 5 deletions
|
|
@ -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
36
queries/t32/indents.scm
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue