mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 04:40:08 -04:00
feat(snl): add parser and queries
This commit is contained in:
parent
6ac9f2e512
commit
53819acac2
7 changed files with 520 additions and 0 deletions
61
runtime/queries/snl/indents.scm
Normal file
61
runtime/queries/snl/indents.scm
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
[
|
||||
(field_declaration_list)
|
||||
(state_set)
|
||||
(state)
|
||||
(block)
|
||||
(member_decl)
|
||||
] @indent.begin
|
||||
|
||||
(block
|
||||
"}" @indent.end)
|
||||
|
||||
[
|
||||
"else"
|
||||
"}"
|
||||
] @indent.branch
|
||||
|
||||
(call_expression) @indent.begin
|
||||
|
||||
(call_expression
|
||||
")" @indent.end)
|
||||
|
||||
(if_statement
|
||||
condition: (_) @indent.begin)
|
||||
|
||||
(if_statement
|
||||
consequence: (_) @_consequence
|
||||
(#not-kind-eq? @_consequence block)) @indent.begin
|
||||
|
||||
(else_statement
|
||||
consequence: (_) @_consequence
|
||||
(#not-kind-eq? @_consequence block)) @indent.begin
|
||||
|
||||
(while_statement
|
||||
body: (statement
|
||||
(_) @_body)
|
||||
(#not-kind-eq? @_body block)) @indent.begin
|
||||
|
||||
(for_statement
|
||||
body: (statement
|
||||
(_) @_body)
|
||||
(#not-kind-eq? @_body block)) @indent.begin
|
||||
|
||||
(init_declarator) @indent.begin
|
||||
|
||||
(transition
|
||||
condition: (_) @indent.begin)
|
||||
|
||||
[
|
||||
"#define"
|
||||
"#ifdef"
|
||||
"#if"
|
||||
"#else"
|
||||
"#endif"
|
||||
] @indent.zero
|
||||
|
||||
[
|
||||
(preproc_arg)
|
||||
(string_literal)
|
||||
] @indent.ignore
|
||||
|
||||
(comment) @indent.auto
|
||||
Loading…
Add table
Add a link
Reference in a new issue