rust-bakery / nom

Rust parser combinator framework
MIT License
9.18k stars 792 forks source link

Float parsing with trailing `e` broken #1725

Open grantslatton opened 5 months ago

grantslatton commented 5 months ago
rustc -V
rustc 1.75.0 (82e1608df 2023-12-21)
nom 7.1.3

This code

nom::number::complete::recognize_float("123episode")

Fails with Failure(Error { input: "pisode", code: Digit }) instead of returning ("episode", 123.0)

The nom::number::complete::double parser is similarly broken

This is something to do with scientific notation (e.g. 123e6) handling