#370
Accept underscores in float literals (B5)
Summary
Float literals accepted digits '.' digits but rejected any input containing _, while integer literals accept 1_000.0-style separators. The asymmetry forces numeric groupings to be omitted in float sources and produces a confusing TYP019 for 1_000.5.
This PR mirrors the integer path: copy the source into a stack buffer, reject leading, trailing, and double underscores, then run the existing digit shape check and strtod on the stripped text. Behavior stays byte-equivalent for inputs without _.
Closes one item from #318 (audit finding B5, re-confirmed against main).
Test plan
-
conformance/native/pass/float-literal-underscores.0covers1_000.5,0.0_5,1.0e1_0,1_000.0 -
conformance/native/fail/malformed-float-underscores.0covers trailing underscore (still TYP019) -
pnpm run conformancepasses (all 600+ pass fixtures, all fail fixtures) -
compiler-metrics.mtshas 0 violations (budget bumped by 20) - No C compiler warnings
Activity
9vercel[bot]reviewed5mo ago
vercel[bot]reviewed5mo ago
@TumCucTom is attempting to deploy a commit to the Vercel Labs Team on Vercel.
A member of the Team first needs to authorize it.