Skip to content

Commit

Permalink
feat(c): add function and loop queries (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq authored Jul 11, 2023
1 parent f1093d8 commit 3c4ccc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions after/queries/c/matchup.scm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@
(compound_statement
(if_statement
"if" @open.if) @scope.if)

; Functions
(function_definition) @scope.function
(function_declarator declarator: (identifier) @open.function)
(return_statement "return" @mid.function.1)

; Loops
(for_statement "for" @open.loop) @scope.loop
(while_statement "while" @open.loop) @scope.loop
(do_statement "do" @open.loop "while" @close.loop) @scope.loop
(break_statement "break" @mid.loop.1)

0 comments on commit 3c4ccc4

Please sign in to comment.