Fixed some parse errors thanks to Daniel Sheppard [Closes #6]

This commit is contained in:
Tobias Lütke
2008-12-22 11:47:26 -05:00
parent 7b9b5f31fb
commit 88309cf415
3 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -33,7 +33,8 @@ module Liquid
VariableStart = /\{\{/
VariableEnd = /\}\}/
VariableIncompleteEnd = /\}\}?/
QuotedFragment = /"[^"]+"|'[^']+'|[^\s,\|]+/
QuotedString = /"[^"]+"|'[^']+'/
QuotedFragment = /#{QuotedString}|(?:[^\s,\|'"]|#{QuotedString})+/
StrictQuotedFragment = /"[^"]+"|'[^']+'|[^\s,\|,\:,\,]+/
FirstFilterArgument = /#{FilterArgumentSeparator}(?:#{StrictQuotedFragment})/
OtherFilterArgument = /#{ArgumentSeparator}(?:#{StrictQuotedFragment})/
+2 -3
View File
@@ -13,8 +13,8 @@ module Liquid
# <div class="green"> Item five</div>
#
class Cycle < Tag
SimpleSyntax = /#{Expression}/
NamedSyntax = /(#{Expression})\s*\:\s*(.*)/
SimpleSyntax = /^#{Expression}/
NamedSyntax = /^(#{Expression})\s*\:\s*(.*)/
def initialize(tag_name, markup, tokens)
case markup
@@ -27,7 +27,6 @@ module Liquid
else
raise SyntaxError.new("Syntax Error in 'cycle' - Valid syntax: cycle [name :] var [, var2, var3 ...]")
end
super
end