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

@ -389,7 +389,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [styled](https://github.com/mskelton/tree-sitter-styled) (maintained by @mskelton)
- [x] [supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) (maintained by @madskjeldgaard)
- [x] [surface](https://github.com/connorlay/tree-sitter-surface) (maintained by @connorlay)
- [x] [svelte](https://github.com/Himujjal/tree-sitter-svelte) (maintained by @elianiva)
- [x] [svelte](https://github.com/tree-sitter-grammars/tree-sitter-svelte) (maintained by @amaanq)
- [x] [swift](https://github.com/alex-pinkus/tree-sitter-swift) (maintained by @alex-pinkus)
- [x] [sxhkdrc](https://github.com/RaafatTurki/tree-sitter-sxhkdrc) (maintained by @RaafatTurki)
- [x] [systemtap](https://github.com/ok-ryoko/tree-sitter-systemtap) (maintained by @ok-ryoko)

View file

@ -648,7 +648,7 @@
"revision": "f4586b35ac8548667a9aaa4eae44456c1f43d032"
},
"svelte": {
"revision": "bd60db7d3d06f89b6ec3b287c9a6e9190b5564bd"
"revision": "04a126d9210def99f06d9ab84a255110b862d47c"
},
"swift": {
"revision": "e1ac0c3b48f4c42c40f92f400f14c6561369d4dd"

View file

@ -1893,10 +1893,10 @@ list.surface = {
list.svelte = {
install_info = {
url = "https://github.com/Himujjal/tree-sitter-svelte",
url = "https://github.com/tree-sitter-grammars/tree-sitter-svelte",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@elianiva" },
maintainers = { "@amaanq" },
}
list.swift = {

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