mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 02:10:41 -07:00
Address comments
This commit is contained in:
+4
-14
@@ -11,7 +11,7 @@ module Liquid
|
||||
|
||||
def parse(tokens)
|
||||
@body = new_body
|
||||
while parse_body(@body, tokens, partial: true)
|
||||
while parse_body(@body, tokens)
|
||||
end
|
||||
@body.freeze
|
||||
end
|
||||
@@ -68,9 +68,7 @@ module Liquid
|
||||
end
|
||||
|
||||
# @api public
|
||||
def parse_body(body, tokens, partial: false)
|
||||
block_terminated = true
|
||||
|
||||
def parse_body(body, tokens)
|
||||
if parse_context.depth >= MAX_DEPTH
|
||||
raise StackLevelError, "Nesting too deep"
|
||||
end
|
||||
@@ -79,10 +77,7 @@ module Liquid
|
||||
body.parse(tokens, parse_context) do |end_tag_name, end_tag_params|
|
||||
@blank &&= body.blank?
|
||||
|
||||
if end_tag_name == block_delimiter
|
||||
block_terminated = false
|
||||
next
|
||||
end
|
||||
return false if end_tag_name == block_delimiter
|
||||
raise_tag_never_closed(block_name) unless end_tag_name
|
||||
|
||||
# this tag is not registered with the system
|
||||
@@ -93,12 +88,7 @@ module Liquid
|
||||
parse_context.depth -= 1
|
||||
end
|
||||
|
||||
unless partial
|
||||
body.remove_blank_strings if body.blank?
|
||||
body.freeze
|
||||
end
|
||||
|
||||
block_terminated
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user