mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-29 15:15:19 -07:00
Fix cycle tag
- `respond_to?` was returning `false` in the parser switcher
because `rigid_parse` was private
It was working before because `parse_context` was doing
the double-parsing thing, but when we removed that, this
test fairly started breaking
This commit is contained in:
committed by
Guilherme Carreiro
parent
e413104e78
commit
75c95d0791
@@ -52,8 +52,6 @@ module Liquid
|
|||||||
output
|
output
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
# cycle [name:] expression(, expression)*
|
# cycle [name:] expression(, expression)*
|
||||||
def rigid_parse(markup)
|
def rigid_parse(markup)
|
||||||
p = @parse_context.new_parser(markup)
|
p = @parse_context.new_parser(markup)
|
||||||
@@ -73,6 +71,8 @@ module Liquid
|
|||||||
raise_syntax_error(options) if @variables.empty?
|
raise_syntax_error(options) if @variables.empty?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
# Temporarily until we migrate
|
# Temporarily until we migrate
|
||||||
def strict_parse(markup)
|
def strict_parse(markup)
|
||||||
lax_parse(markup)
|
lax_parse(markup)
|
||||||
|
|||||||
@@ -55,10 +55,9 @@ class CycleTagTest < Minitest::Test
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
skip("todo(guilherme): parse_context.safe_parse_expression in progress...")
|
with_error_mode(:rigid) do
|
||||||
# with_error_mode(:rigid) do
|
assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5: 'a', 'b' %}") }
|
||||||
# assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5: 'a', 'b' %}") }
|
assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5, .4 %}") }
|
||||||
# assert_raises(Liquid::SyntaxError) { Template.parse("{% cycle .5, .4 %}") }
|
end
|
||||||
# end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user