class Crass::Tokenizer

def consume_number

4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number

`:integer` or `:number`).
original representation, its numeric value, and its type (either
Consumes a number and returns a 3-element array containing the number's
def consume_number
  repr = String.new
  type = :integer
  repr << @s.consume if @s.peek =~ RE_NUMBER_SIGN
  repr << (@s.scan(RE_DIGIT) || '')
  if match = @s.scan(RE_NUMBER_DECIMAL)
    repr << match
    type = :number
  end
  if match = @s.scan(RE_NUMBER_EXPONENT)
    repr << match
    type = :number
  end
  [repr, convert_string_to_number(repr), type]
end