Add support for parenthesized expressions

This commit is contained in:
Charles-P. Clermont
2026-01-27 10:07:35 -05:00
parent f9b5313020
commit 10c0de74b5
4 changed files with 60 additions and 13 deletions
+4 -5
View File
@@ -35,11 +35,10 @@ class ParsingQuirksTest < Minitest::Test
assert_raises(Liquid::SyntaxError) { Template.parse("{{test |a|b|}}") }
end
def test_meaningless_parens_error
assert_raises(SyntaxError) do
markup = "a == 'foo' or (b == 'bar' and c == 'baz') or false"
Template.parse("{% if #{markup} %} YES {% endif %}")
end
def test_supported_parens
markup = "a == 'foo' or (b == 'bar' and c == 'baz') or false"
out = Template.parse("{% if #{markup} %} YES {% endif %}").render({ 'b' => 'bar', 'c' => 'baz' })
assert_equal(' YES ', out)
end
def test_unexpected_characters_syntax_error