Consistency in warnings.

This commit is contained in:
Tristan Hume
2013-08-22 16:15:12 -04:00
parent 86ba2f4174
commit dd3196b22e
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -67,10 +67,8 @@ module Liquid
all_warnings = []
all_warnings.concat(@warnings) if @warnings
return all_warnings unless @children
@children.each do |node|
node_warns = node.respond_to?(:warnings) ? node.warnings : nil
all_warnings.concat(node_warns) if node_warns
all_warnings.concat(node.warnings || [])
end
all_warnings
+1 -1
View File
@@ -18,7 +18,6 @@ module Liquid
def initialize(markup, options = {})
@markup = markup
@name = nil
@warnings = []
@options = options || {}
@@ -29,6 +28,7 @@ module Liquid
begin
strict_parse(markup)
rescue SyntaxError => e
@warnings ||= []
@warnings << e
lax_parse(markup)
end