step_numeric_literal_len

Function step_numeric_literal_len 

Source
pub fn step_numeric_literal_len(bytes: &[u8]) -> Option<usize>
Expand description

Length of the STEP REAL/INTEGER literal at the start of bytes, when the bytes there are exactly one literal followed by something that may legally follow a list item: end of input, ,, ), STEP whitespace, or a /* comment. None otherwise.

Grammar (ISO 10303-21 ยง5.3, as isCompleteStepNumericLiteral reads it): optional sign, digits with an optional . and fraction digits or a bare-dot fraction (1, 1., 1.5, .5), at least one digit overall, then an optional exponent (e/E, optional sign, at least one digit).

A hand-rolled forward scan with no allocation: it runs once per number on the geometry hot path.