feat(svelte)!: switch upstream parser

This commit is contained in:
Amaan Qureshi 2024-02-19 02:53:49 -05:00
parent b3e53e9423
commit 3a7b5a9fb4
8 changed files with 52 additions and 34 deletions

View file

@ -1,9 +1,12 @@
; inherits: html
[
(style_element)
(script_element)
(element)
(if_statement)
(else_statement)
(else_if_block)
(else_block)
(each_statement)
(await_statement)
(then_block)
(catch_block)
(key_statement)
(snippet_statement)
] @fold

View file

@ -1,20 +1,32 @@
; inherits: html_tags
(raw_text_expr) @none
; inherits: html
(raw_text) @none
[
(special_block_keyword)
(then)
(as)
"as"
"key"
"html"
"snippet"
"render"
] @keyword
((special_block_keyword) @keyword.coroutine
(#eq? @keyword.coroutine "await"))
"const" @type.qualifier
((special_block_keyword) @keyword.exception
(#eq? @keyword.exception "catch"))
[
"if"
"else"
"then"
] @keyword.conditional
((special_block_keyword) @keyword.conditional
(#any-of? @keyword.conditional "if" "else"))
"each" @keyword.repeat
[
"await"
"then"
] @keyword.coroutine
"catch" @keyword.exception
"debug" @keyword.debug
[
"{"

View file

@ -1,28 +1,33 @@
; inherits: html_tags
; inherits: html
[
(if_statement)
(each_statement)
(await_statement)
(key_statement)
(snippet_statement)
] @indent.begin
(if_end_expr
(if_end
"}" @indent.end)
(each_end_expr
(each_end
"}" @indent.end)
(await_end_expr
(await_end
"}" @indent.end)
(key_end_expr
(key_end
"}" @indent.end)
(snippet_end
"}" @indent.end)
[
(if_end_expr)
(else_if_statement)
(else_statement)
(each_end_expr)
(await_end_expr)
(key_end_expr)
(if_end)
(else_if_block)
(else_block)
(each_end)
(await_end)
(key_end)
(snippet_end)
] @indent.branch

View file

@ -10,10 +10,7 @@
(#any-of? @_lang "scss" "postcss" "less")
(#set! injection.language "scss"))
([
(raw_text_expr)
(raw_text_each)
] @injection.content
((svelte_raw_text) @injection.content
(#set! injection.language "javascript"))
((script_element

View file

@ -0,0 +1 @@
; inherits: html