Skip to content

Commit

Permalink
feat: add zig queries (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
bomgar authored Oct 18, 2024
1 parent 1975afe commit 57d3a4b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions after/queries/zig/matchup.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; inherits: quote

(function_declaration
"fn" @open.function) @scope.function
(return_expression
"return" @mid.function.1)

; 'else' and 'else if'
(else_clause
"else" @_start (if_statement "if" @_end)?
(#make-range! "mid.if.1" @_start @_end))

; if
((if_statement
"if" @open.if) @scope.if
(#not-has-parent? @scope.if else_clause))

; Loops
(while_statement "while" @open.loop) @scope.loop
(break_expression "break" @mid.loop.1)
(continue_expression "continue" @mid.loop.2)

0 comments on commit 57d3a4b

Please sign in to comment.