nvim-treesitter/queries/c/indents.scm

48 lines
768 B
Scheme
Raw Normal View History

2021-01-05 19:26:08 +07:00
[
(init_declarator)
(compound_statement)
(preproc_arg)
(field_declaration_list)
(case_statement)
(conditional_expression)
(enumerator_list)
(struct_specifier)
2021-07-31 12:59:19 -04:00
(compound_literal_expression)
2022-01-18 21:17:26 +06:00
(parameter_list)
(initializer_list)
(concatenated_string)
(while_statement)
(for_statement)
(switch_statement)
2021-01-05 19:26:08 +07:00
] @indent
2022-01-18 21:17:26 +06:00
(if_statement condition: (_) @indent)
((if_statement
consequence: (_) @_consequence
(#not-has-type? @_consequence compound_statement)
) @indent)
(init_declarator
value: [
(binary_expression)
] @indent)
2021-01-05 19:26:08 +07:00
(compound_statement "}" @indent_end)
2021-01-05 19:26:08 +07:00
[
"#define"
"#ifdef"
2022-01-18 21:17:26 +06:00
"#if"
"#else"
"else"
2021-01-05 19:26:08 +07:00
"#endif"
2022-01-18 21:17:26 +06:00
")"
2021-01-05 19:26:08 +07:00
"}"
] @branch
[
(comment)
2022-01-18 21:17:26 +06:00
(preproc_arg)
(string_literal)
] @ignore
2022-01-18 21:17:26 +06:00
(binary_expression) @auto