diff options
Diffstat (limited to 'runtime/queries/c')
-rw-r--r-- | runtime/queries/c/indents.scm | 33 | ||||
-rw-r--r-- | runtime/queries/c/indents.toml | 16 |
2 files changed, 33 insertions, 16 deletions
diff --git a/runtime/queries/c/indents.scm b/runtime/queries/c/indents.scm new file mode 100644 index 00000000..353ea81b --- /dev/null +++ b/runtime/queries/c/indents.scm @@ -0,0 +1,33 @@ +[ + (compound_statement) + (field_declaration_list) + (enumerator_list) + (parameter_list) + (init_declarator) + (case_statement) + (expression_statement) +] @indent + +[ + "case" + "}" + "]" +] @outdent + +(if_statement + consequence: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "all")) +(while_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "all")) +(do_statement + body: (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "all")) +(for_statement + ")" + (_) @indent + (#not-kind-eq? @indent "compound_statement") + (#set! "scope" "all")) diff --git a/runtime/queries/c/indents.toml b/runtime/queries/c/indents.toml deleted file mode 100644 index f4076e17..00000000 --- a/runtime/queries/c/indents.toml +++ /dev/null @@ -1,16 +0,0 @@ -indent = [ - "compound_statement", - "field_declaration_list", - "enumerator_list", - "parameter_list", - "init_declarator", - "case_statement", - "condition_clause", - "expression_statement", -] - -outdent = [ - "case", - "}", - "]", -] |