Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Feb 23, 2025
2 parents 305cf38 + 0020198 commit f94dc46
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Syntaxes/Liquid.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ contexts:
- include: liquid-conditionals
- include: liquid-iterations
- include: liquid-functions
- include: liquid-filters
- include: liquid-expression-continuation
- include: liquid-other

liquid-expression:
Expand Down Expand Up @@ -453,6 +455,32 @@ contexts:
- match: \bby\b
scope: keyword.operator.liquid

liquid-expression-continuation:
# hack to handle multi-line expressions
# If first token of a new line matches one of the following patterns
# it is most likely a continuation of an expression.
- match: ':'
scope: punctuation.separator.key-value.liquid
push: liquid-expression
- match: ','
scope: punctuation.separator.sequence.liquid
push: liquid-expression
- match: =
scope: keyword.operator.assignment.liquid
push: liquid-expression
- match: (?:!=|==|<=|>=|<|>)
scope: keyword.operator.comparison.liquid
push: liquid-expression
- match: \bas\b
scope: keyword.operator.assignment.liquid
push: liquid-expression
- match: \b(?:and|or|not|contains)\b
scope: keyword.operator.logical.liquid
push: liquid-expression
- match: \bby\b
scope: keyword.operator.liquid
push: liquid-expression

###[ LIQUID LITERALS ]########################################################

liquid-constants:
Expand Down
17 changes: 17 additions & 0 deletions tests/syntax_test_liquid.liquid.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@
| ^^^^^^^ meta.string.liquid string.quoted.double.liquid
| ^^ punctuation.section.embedded.end.liquid

{%- if foo != blank
and bar != ''
|^^^^^^^^^^^^^^ meta.embedded.liquid source.liquid meta.statement.liquid
| ^^^ keyword.operator.logical.liquid
| ^^^ variable.other.liquid
| ^^ keyword.operator.comparison.liquid
| ^^ meta.string.liquid string.quoted.single.liquid
or baz
|^^^^^^^^ meta.embedded.liquid source.liquid meta.statement.liquid
| ^^ keyword.operator.logical.liquid
| ^^^ variable.other.liquid
== true
|^^^^^^^^ meta.embedded.liquid source.liquid meta.statement.liquid
| ^^ keyword.operator.assignment.liquid
| ^^^^ constant.language.boolean.liquid
-%}

{% case handle %}
|^^^^^^^^^^^^^^^^ meta.embedded.liquid source.liquid meta.statement.liquid
| ^^^^ keyword.control.conditional.case.liquid
Expand Down

0 comments on commit f94dc46

Please sign in to comment.