Skip to content

Commit

Permalink
Update c queries and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielkonge committed Dec 8, 2023
1 parent 2806d83 commit 9d5cb59
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
16 changes: 10 additions & 6 deletions queries/c/context.scm
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,33 @@
) @context

(function_definition
body: (_ (_) @context.end)
body: (_) @context.end
) @context

(for_statement
(compound_statement) @context.end
) @context

(if_statement
consequence: (_ (_) @context.end)
consequence: (_) @context.end
) @context

(else_clause
(_) @context.end
) @context

(while_statement
body: (_ (_) @context.end)
body: (_) @context.end
) @context

(do_statement
body: (_ (_) @context.end)
body: (_) @context.end
) @context

(struct_specifier
body: (_ (_) @context.end)
body: (_) @context.end
) @context

(enum_specifier
body: (_ (_) @context.end)
body: (_) @context.end
) @context
41 changes: 41 additions & 0 deletions test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,46 @@ int main(int arg1,
// comment
}

} else if (arg1 == 4) {
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
} else {
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
// comment
}
}

0 comments on commit 9d5cb59

Please sign in to comment.