mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 09:20:42 -07:00
Update the parser to use the new tokens
This commit is contained in:
+16
-1
@@ -48,7 +48,7 @@ module Liquid
|
||||
|
||||
def expression
|
||||
token = @tokens[@p]
|
||||
case token[0]
|
||||
expr = case token[0]
|
||||
when :id
|
||||
str = consume
|
||||
str << variable_lookups
|
||||
@@ -69,6 +69,21 @@ module Liquid
|
||||
else
|
||||
raise SyntaxError, "#{token} is not a valid expression"
|
||||
end
|
||||
if look(:comparison)
|
||||
operator = consume(:comparison)
|
||||
left = expr
|
||||
right = expression
|
||||
|
||||
"#{left} #{operator} #{right}"
|
||||
elsif look(:boolean_operator)
|
||||
operator = consume(:boolean_operator)
|
||||
left = expr
|
||||
right = expression
|
||||
|
||||
"#{left} #{operator} #{right}"
|
||||
else
|
||||
expr
|
||||
end
|
||||
end
|
||||
|
||||
def argument
|
||||
|
||||
Reference in New Issue
Block a user