mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
fix over-accept #159 SCIENTIFIC-EXP-PLUS: reject '+' in numeric exponent
Solidity 0.8.35's number scanner allows an optional '-' but never a leading
'+' in a scientific-notation exponent. Pinned solc 0.8.35 rejects 1e+5, 1E+5,
1.0e+2, 2e+3 seconds at scan time ("Invalid literal value") and accepts 1e5
(no sign) and 1e-5 (minus). The model over-accepted 1e+5 because
parseDecimalExponentSuffix? had an explicit '+' :: rest branch folding the
exponent as positive.
Fix: drop the '+' :: rest branch so a leading '+' falls through to the
bare-digits branch, where '+' is not a decimal digit and parseSeparatedDigits?
yields none (reject). The '-' branch and the bare positive-digits branch are
unchanged; 1e5/1e-5/2.5e10/1e0/1_000e10/denominations all still parse.
Witness-only (over-accept: solc emits no AST for the rejected literal, no forge
lane). Adds SolidCore/Witness/SciExpPlus.lean (rfl theorems pinning
parseNumberRat? "1e+5"/"1E+5"/"1.0e+2" = none and 1e5/1e-5/2.5e10 unchanged),
imported from SolidCore.lean, plus a witness-only sci-exp-plus manifest lane.
Full lake build green (1116 jobs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 0a7a494eef608225c3b7c33b5a5b2a827b108e2e)
This commit is contained in:
parent
506179b633
commit
3e00bf9b58
4 changed files with 79 additions and 3 deletions
Loading…
Add table
Add a link
Reference in a new issue