mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
Extract Parser#number parse out of Expression.parse
This commit is contained in:
@@ -52,11 +52,18 @@ module Liquid
|
||||
case token[0]
|
||||
when :string
|
||||
string
|
||||
when :number
|
||||
number
|
||||
else
|
||||
parse_expression(expression_string)
|
||||
end
|
||||
end
|
||||
|
||||
def number
|
||||
num = consume(:number)
|
||||
Expression.parse_number(num)
|
||||
end
|
||||
|
||||
def string
|
||||
consume(:string)[1..-2]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user