Remove ExpressionParser in favor of ParseContext#safe_parse

This commit is contained in:
Guilherme Carreiro
2025-10-27 16:33:31 +01:00
committed by Guilherme Carreiro
parent d56e3c50f9
commit e413104e78
13 changed files with 34 additions and 812 deletions
+8 -19
View File
@@ -42,25 +42,14 @@ class ExpressionTest < Minitest::Test
assert_template_result("3..4", "{{ ( 3 .. 4 ) }}")
assert_expression_result(1..2, "(1..2)")
if Liquid::Environment.default.error_mode == :rigid
assert_match_syntax_error(
'Invalid expression type in range expression in "{{ (false..true) }}"',
"{{ (false..true) }}",
)
assert_match_syntax_error(
'Liquid syntax error (line 1): Invalid expression type in range expression in "{{ ((1..2)..3) }}"',
"{{ ((1..2)..3) }}",
)
else
assert_match_syntax_error(
"Liquid syntax error (line 1): Invalid expression type 'false' in range expression",
"{{ (false..true) }}",
)
assert_match_syntax_error(
"Liquid syntax error (line 1): Invalid expression type '(1..2)' in range expression",
"{{ ((1..2)..3) }}",
)
end
assert_match_syntax_error(
"Liquid syntax error (line 1): Invalid expression type 'false' in range expression",
"{{ (false..true) }}",
)
assert_match_syntax_error(
"Liquid syntax error (line 1): Invalid expression type '(1..2)' in range expression",
"{{ ((1..2)..3) }}",
)
end
def test_quirky_negative_sign_expression_markup