parse method
Parse text and return the resulting number. Throws FormatException if we can't parse it.
Implementation
R parse() {
if (text == symbols.NAN) return nan();
if (text == '$_positivePrefix${symbols.INFINITY}$_positiveSuffix') {
return positiveInfinity();
}
if (text == '$_negativePrefix${symbols.INFINITY}$_negativeSuffix') {
return negativeInfinity();
}
checkPrefixes();
var parsed = parseNumber(input);
if (gotPositive && !gotPositiveSuffix) invalidNumber();
if (gotNegative && !gotNegativeSuffix) invalidNumber();
if (!input.atEnd) invalidNumber();
return parsed;
}