finishNumber method

  1. @override
Token finishNumber()
override

Implementation

@override
Token finishNumber() {
  eatDigits();

  if (_peekChar() == 46 /*.*/) {
    // Handle the case of 1.toString().
    _nextChar();
    if (TokenizerHelpers.isDigit(_peekChar())) {
      eatDigits();
      return _finishToken(TokenKind.DOUBLE);
    } else {
      _index -= 1;
    }
  }

  return _finishToken(TokenKind.INTEGER);
}