Fix warnings and make tags a proper syntax tree.

This commit is contained in:
Tristan Hume
2013-08-22 12:44:23 -04:00
parent 93fcd5687c
commit b0cba5298a
3 changed files with 13 additions and 7 deletions
+3 -3
View File
@@ -13,12 +13,12 @@ module Liquid
class Variable
FilterParser = /(?:#{FilterSeparator}|(?:\s*(?:#{QuotedFragment}|#{ArgumentSeparator})\s*)+)/o
EasyParse = /^ *(\w+(?:\.\w+)*) *$/
attr_accessor :filters, :name
attr_accessor :filters, :name, :warnings
def initialize(markup, options = {})
@markup = markup
@name = nil
@warning = nil
@warnings = []
@options = options || {}
@@ -29,7 +29,7 @@ module Liquid
begin
strict_parse(markup)
rescue SyntaxError => e
@warning = e
@warnings << e
lax_parse(markup)
end
end