mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(liquid): add new parser tree-sitter-liquid (#6359)
(templating language)
This commit is contained in:
parent
29f176c257
commit
f84887230a
5 changed files with 164 additions and 0 deletions
|
|
@ -299,6 +299,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [ledger](https://github.com/cbarrete/tree-sitter-ledger) (maintained by @cbarrete)
|
||||
- [x] [leo](https://github.com/r001/tree-sitter-leo) (maintained by @r001)
|
||||
- [x] [linkerscript](https://github.com/amaanq/tree-sitter-linkerscript) (maintained by @amaanq)
|
||||
- [x] [liquid](https://github.com/hankthetank27/tree-sitter-liquid) (maintained by @hankthetank27)
|
||||
- [x] [liquidsoap](https://github.com/savonet/tree-sitter-liquidsoap) (maintained by @toots)
|
||||
- [x] [llvm](https://github.com/benwilliamgraham/tree-sitter-llvm) (maintained by @benwilliamgraham)
|
||||
- [x] [lua](https://github.com/MunifTanjim/tree-sitter-lua) (maintained by @muniftanjim)
|
||||
|
|
|
|||
|
|
@ -377,6 +377,9 @@
|
|||
"linkerscript": {
|
||||
"revision": "f99011a3554213b654985a4b0a65b3b032ec4621"
|
||||
},
|
||||
"liquid": {
|
||||
"revision": "06a18b68eaa5665c6eeef30e355878835e473d15"
|
||||
},
|
||||
"liquidsoap": {
|
||||
"revision": "09a9e31e2af734a8974dad6ed349648f601eee8c"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1131,6 +1131,14 @@ list.linkerscript = {
|
|||
maintainers = { "@amaanq" },
|
||||
}
|
||||
|
||||
list.liquid = {
|
||||
install_info = {
|
||||
url = "https://github.com/hankthetank27/tree-sitter-liquid",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@hankthetank27" },
|
||||
}
|
||||
|
||||
list.liquidsoap = {
|
||||
install_info = {
|
||||
url = "https://github.com/savonet/tree-sitter-liquidsoap",
|
||||
|
|
|
|||
130
queries/liquid/highlights.scm
Normal file
130
queries/liquid/highlights.scm
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
((comment) @comment @spell
|
||||
(#set! priority 110))
|
||||
|
||||
(raw_statement
|
||||
(raw_content) @spell
|
||||
(#set! priority 110))
|
||||
|
||||
((identifier) @variable
|
||||
(#set! priority 110))
|
||||
|
||||
((string) @string
|
||||
(#set! priority 110))
|
||||
|
||||
((boolean) @boolean
|
||||
(#set! priority 110))
|
||||
|
||||
((number) @number
|
||||
(#set! priority 110))
|
||||
|
||||
(filter
|
||||
name: (identifier) @function.call
|
||||
(#set! priority 110))
|
||||
|
||||
([
|
||||
"as"
|
||||
"assign"
|
||||
"capture"
|
||||
"decrement"
|
||||
"echo"
|
||||
"endcapture"
|
||||
"endform"
|
||||
"endjavascript"
|
||||
"endraw"
|
||||
"endschema"
|
||||
"endstyle"
|
||||
"form"
|
||||
"increment"
|
||||
"javascript"
|
||||
"layout"
|
||||
"liquid"
|
||||
"raw"
|
||||
"schema"
|
||||
"style"
|
||||
"with"
|
||||
] @keyword
|
||||
(#set! priority 110))
|
||||
|
||||
([
|
||||
"case"
|
||||
"else"
|
||||
"elsif"
|
||||
"endcase"
|
||||
"endif"
|
||||
"endunless"
|
||||
"if"
|
||||
"unless"
|
||||
"when"
|
||||
] @keyword.conditional
|
||||
(#set! priority 110))
|
||||
|
||||
([
|
||||
"break"
|
||||
"by"
|
||||
"continue"
|
||||
"cycle"
|
||||
"endfor"
|
||||
"endpaginate"
|
||||
"endtablerow"
|
||||
"for"
|
||||
"paginate"
|
||||
"tablerow"
|
||||
] @keyword.repeat
|
||||
(#set! priority 110))
|
||||
|
||||
([
|
||||
"and"
|
||||
"contains"
|
||||
"in"
|
||||
"or"
|
||||
] @keyword.operator
|
||||
(#set! priority 110))
|
||||
|
||||
([
|
||||
"{{"
|
||||
"}}"
|
||||
"{{-"
|
||||
"-}}"
|
||||
"{%"
|
||||
"%}"
|
||||
"{%-"
|
||||
"-%}"
|
||||
] @tag.delimiter
|
||||
(#set! priority 110))
|
||||
|
||||
[
|
||||
"include"
|
||||
"render"
|
||||
"section"
|
||||
"sections"
|
||||
] @keyword.import
|
||||
|
||||
[
|
||||
"|"
|
||||
":"
|
||||
"="
|
||||
"+"
|
||||
"-"
|
||||
"*"
|
||||
"/"
|
||||
"%"
|
||||
"^"
|
||||
"=="
|
||||
"<"
|
||||
"<="
|
||||
"!="
|
||||
">="
|
||||
">"
|
||||
] @operator
|
||||
|
||||
[
|
||||
"]"
|
||||
"["
|
||||
")"
|
||||
"("
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
"."
|
||||
] @punctuation.delimiter
|
||||
22
queries/liquid/injections.scm
Normal file
22
queries/liquid/injections.scm
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
((template_content) @injection.content
|
||||
(#set! injection.language "html")
|
||||
(#set! injection.combined))
|
||||
|
||||
; TODO we can switch to quantifiers once neovim 0.10 becomes stable
|
||||
(javascript_statement
|
||||
(js_content) @injection.content
|
||||
(#set! injection.language "javascript")
|
||||
(#set! injection.combined))
|
||||
|
||||
(schema_statement
|
||||
(json_content) @injection.content
|
||||
(#set! injection.language "json")
|
||||
(#set! injection.combined))
|
||||
|
||||
(style_statement
|
||||
(style_content) @injection.content
|
||||
(#set! injection.language "css")
|
||||
(#set! injection.combined))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue