class Crass::Tokenizer

def start_number?(text = nil)

4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number

stream will be checked, but will not be consumed.
If _text_ is `nil`, the current and next two characters in the input
Returns `true` if the given three-character _text_ would start a number.
def start_number?(text = nil)
  text = @s.current + @s.peek(2) if text.nil?
  case text[0]
  when '+', '-'
    !!(text[1] =~ RE_DIGIT || (text[1] == '.' && text[2] =~ RE_DIGIT))
  when '.'
    !!(text[1] =~ RE_DIGIT)
  when RE_DIGIT
    true
  else
    false
  end
end