mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Use a private constant to stash token-types
This commit is contained in:
@@ -44,11 +44,14 @@ module Liquid
|
||||
tok[0] == type
|
||||
end
|
||||
|
||||
CONSUME_TOKENS = [:string, :number]
|
||||
private_constant :CONSUME_TOKENS
|
||||
|
||||
def expression
|
||||
token = @tokens[@p]
|
||||
if token[0] == :id
|
||||
variable_signature
|
||||
elsif [:string, :number].include? token[0]
|
||||
elsif CONSUME_TOKENS.include? token[0]
|
||||
consume
|
||||
elsif token.first == :open_round
|
||||
consume
|
||||
|
||||
Reference in New Issue
Block a user