parseNumber method

R parseNumber(
  1. StringStack input
)

Parse the number portion of the input, i.e. not any prefixes or suffixes, and assuming NaN and Infinity are already handled.

Implementation

R parseNumber(StringStack input) {
  if (gotNegative) {
    _normalized.write('-');
  }
  while (!done && !input.atEnd) {
    var digit = asDigit(input.peek());
    if (digit != null) {
      _normalized.writeCharCode(constants.asciiZeroCodeUnit + digit);
      input.next();
    } else {
      processNonDigit();
    }
    checkSuffixes();
  }

  var normalizedText = _normalized.toString();
  final parsed = fromNormalized(normalizedText);
  return scaled(parsed, scale);
}