Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
refactor paired statements to generic constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
hankthetank27 committed Feb 21, 2024
1 parent fb4385b commit a155332
Show file tree
Hide file tree
Showing 10 changed files with 22,164 additions and 21,837 deletions.
952 changes: 429 additions & 523 deletions grammar.js

Large diffs are not rendered by default.

74 changes: 35 additions & 39 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -35,56 +35,52 @@

([
"as"
"assign"
"break"
"by"
"in"
"with"
"liquid"
"cycle"

"capture"
"case"
"when"
"continue"
"cycle"
"decrement"
"echo"
"else"
"elsif"
"endcapture"
"endcase"

"for"
"endfor"

"form"
"endform"

"style"
"endstyle"

"javascript"
"endjavascript"

"capture"
"endcapture"

"if"
"else"
"elsif"
"endif"

"unless"
"endunless"

"schema"
"endschema"

"raw"
"endjavascript"
"endpaginate"
"endraw"

"tablerow"
"endschema"
"endstyle"
"endtablerow"

"endunless"
"for"
"form"
"if"
"in"
"include"
"increment"
"javascript"
"layout"
"liquid"
"paginate"
"endpaginate"

(statement)
"raw"
"render"
"schema"
"section"
"sections"
"style"
"tablerow"
"unless"
"when"
"with"
] @keyword
(#set! priority 101))


((identifier) @variable (#set! priority 101))
((string) @string (#set! priority 101))
((boolean) @boolean (#set! priority 101))
Expand All @@ -93,7 +89,7 @@
(filter
name: (identifier) @function.call (#set! priority 101))

(raw_tag
(raw_statement
(raw_content) @text.reference (#set! priority 102))

((comment) @comment (#set! priority 102))
Expand Down
17 changes: 9 additions & 8 deletions queries/injections.scm
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
((content) @injection.content
((template_content) @injection.content
(#set! injection.language "html")
(#set! injection.combined))

((schema_tag
(content) @injection.content)
((schema_statement
(template_content) @injection.content)
(#set! injection.language "json")
(#set! injection.combined))

((style_tag
(content) @injection.content)
((style_statement
(template_content) @injection.content)
(#set! injection.language "css")
(#set! injection.combined))

((javascript_tag
(content) @injection.content)
(#set! injection.language "javascript"))
((javascript_statement
(template_content) @injection.content)
(#set! injection.language "javascript")
(#set! injection.combined))

Loading

0 comments on commit a155332

Please sign in to comment.