mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 17:30:08 -04:00
feat(svelte)!: switch upstream parser
This commit is contained in:
parent
b3e53e9423
commit
3a7b5a9fb4
8 changed files with 52 additions and 34 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
[
|
||||
"{"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
1
queries/svelte/locals.scm
Normal file
1
queries/svelte/locals.scm
Normal file
|
|
@ -0,0 +1 @@
|
|||
; inherits: html
|
||||
Loading…
Add table
Add a link
Reference in a new issue