Skip to content

Commit

Permalink
feat(svelte)!: adapt queries to new parser (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 24, 2024
1 parent 7f81ae1 commit 2d660e4
Showing 1 changed file with 51 additions and 20 deletions.
71 changes: 51 additions & 20 deletions after/queries/svelte/matchup.scm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
] @scope.tag

(start_tag (tag_name) @open.tag)

(end_tag
(tag_name) @close.tag
(#offset! @close.tag 0 -1 0 0))
Expand All @@ -16,40 +17,70 @@
"/>" @close.selftag) @scope.selftag

; await

(await_statement
(await_start_expr
(special_block_keyword) @open.await
(await_start
"await" @open.await
(#offset! @open.await 0 -1 0 0))) @scope.await
(await_end_expr
(special_block_keyword) @close.await

(await_end
"await" @close.await
(#offset! @close.await 0 -1 0 0))
(then_expr
(special_block_keyword) @mid.await.1

("then" @mid.await.1
(#offset! @mid.await.1 0 -1 0 0))
(catch_expr
(special_block_keyword) @mid.await.2

("catch" @mid.await.2
(#offset! @mid.await.2 0 -1 0 0))

; each

(each_statement
(each_start_expr
(special_block_keyword) @open.each
(each_start
"each" @open.each
(#offset! @open.each 0 -1 0 0))) @scope.each
(each_end_expr
(special_block_keyword) @close.each

(each_end
"each" @close.each
(#offset! @close.each 0 -1 0 0))

; if

(if_statement
(if_start_expr
(special_block_keyword) @open.if
(if_start
"if" @open.if
(#offset! @open.if 0 -1 0 0))) @scope.if
(if_end_expr
(special_block_keyword) @close.if

(if_end
"if" @close.if
(#offset! @close.if 0 -1 0 0))
(else_expr
(special_block_keyword) @mid.if.1

(else_block
"else" @mid.if.1
(#offset! @mid.if.1 0 -1 0 0))
(else_if_expr
. (special_block_keyword) @mid.if.2

(else_if_block
"else" @mid.if.2
(#offset! @mid.if.2 0 -1 0 0))

; key

(key_statement
(key_start
"key" @open.key
(#offset! @open.key 0 -1 0 0))) @scope.key

(key_end
"key" @close.key
(#offset! @close.key 0 -1 0 0))

; snippet

(snippet_statement
(snippet_start
"snippet" @open.snippet
(#offset! @open.snippet 0 -1 0 0))) @scope.snippet

(snippet_end
"snippet" @close.snippet
(#offset! @close.snippet 0 -1 0 0))

0 comments on commit 2d660e4

Please sign in to comment.