mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Add range support
This commit is contained in:
@@ -50,7 +50,7 @@ module Liquid
|
|||||||
|
|
||||||
def expression
|
def expression
|
||||||
token = @tokens[@p]
|
token = @tokens[@p]
|
||||||
if token[0] == :id
|
str = if token[0] == :id
|
||||||
variable_signature
|
variable_signature
|
||||||
elsif [:string, :number].include? token[0]
|
elsif [:string, :number].include? token[0]
|
||||||
consume
|
consume
|
||||||
@@ -58,6 +58,13 @@ module Liquid
|
|||||||
else
|
else
|
||||||
raise SyntaxError, "#{token} is not a valid expression."
|
raise SyntaxError, "#{token} is not a valid expression."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if look(:dot) && look(:dot, 1)
|
||||||
|
@p += 2
|
||||||
|
str + expression
|
||||||
|
else
|
||||||
|
str
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def argument
|
def argument
|
||||||
|
|||||||
Reference in New Issue
Block a user