[src] dec2flt:: parse
: internal routines only exposed for testing
Validating and decomposing a decimal string of the form:
(digits | digits? '.'? digits?) (('e' | 'E') ('+' | '-')? digits)?
In other words, standard floating-point syntax, with two exceptions: No sign, and no handling of "inf" and "NaN". These are handled by the driver function (super::dec2flt).
Although recognizing valid inputs is relatively easy, this module also has to reject the countless invalid variations, never panic, and perform numerous checks that the other modules rely on to not panic (or overflow) in turn. To make matters worse, all that happens in a single pass over the input. So, be careful when modifying anything, and double-check with the other modules.
The interesting parts of a decimal string.
Carve off decimal digits up to the first non-digit character.
Check if the input string is a valid floating point number and if so, locate the integral part, the fractional part, and the exponent in it. Does not handle signs.
Exponent extraction and error checking.