True when token, already trimmed, is exactly one legal STEP REAL or
INTEGER literal (ISO 10303-21 §5.3): an optional sign, then digits with an
optional decimal point (1, 1., 1.5) or a bare-dot decimal (.5),
then an optional exponent (e/E, optional sign, digits) — nothing before
or after.
The one copy of this grammar (#5193). parseFloat accepts any leading
numeric prefix and discards the rest (parseFloat('1.52.3') is 1.52, a
dropped comma fused into a plausible coordinate), so every STEP token
reader gates on this before trusting it: parseStepValue
(step-serializers.ts), and @ifc-lite/parser's parseAttributeValue and
getNumber.
Hand-rolled rather than a regex: parseAttributeValue runs this once per
attribute of every entity in the file, on tokens almost always under 20
characters, and a single forward scan with no backtracking is cheaper at
that call volume than compiling or running a regex engine.
True when
token, already trimmed, is exactly one legal STEP REAL or INTEGER literal (ISO 10303-21 §5.3): an optional sign, then digits with an optional decimal point (1,1.,1.5) or a bare-dot decimal (.5), then an optional exponent (e/E, optional sign, digits) — nothing before or after.The one copy of this grammar (#5193).
parseFloataccepts any leading numeric prefix and discards the rest (parseFloat('1.52.3')is1.52, a dropped comma fused into a plausible coordinate), so every STEP token reader gates on this before trusting it:parseStepValue(step-serializers.ts), and@ifc-lite/parser'sparseAttributeValueandgetNumber.Hand-rolled rather than a regex:
parseAttributeValueruns this once per attribute of every entity in the file, on tokens almost always under 20 characters, and a single forward scan with no backtracking is cheaper at that call volume than compiling or running a regex engine.