class Liquid::Parser
def expression
def expression token = @tokens[@p] case token[0] when :id str = consume str << variable_lookups when :open_square str = consume str << expression str << consume(:close_square) str << variable_lookups when :string, :number consume when :open_round consume first = expression consume(:dotdot) last = expression consume(:close_round) "(#{first}..#{last})" else raise SyntaxError, "#{token} is not a valid expression" end end