feat(snl): add parser and queries

This commit is contained in:
Minijackson 2025-09-11 15:27:19 +02:00 committed by Christian Clason
parent 6ac9f2e512
commit 53819acac2
7 changed files with 520 additions and 0 deletions

View 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