mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-07 21:25:31 +00:00
disallow consecutive separators when parsing floats
This commit is contained in:
parent
51b5f80ae3
commit
36f34ce5d2
1 changed files with 1 additions and 0 deletions
|
@ -31,6 +31,7 @@ fn parse_inner(literal: &[u8]) -> Option<f64> {
|
||||||
// lexical-core's format::PYTHON_STRING is inaccurate
|
// lexical-core's format::PYTHON_STRING is inaccurate
|
||||||
const PYTHON_STRING: u128 = NumberFormatBuilder::rebuild(PYTHON3_LITERAL)
|
const PYTHON_STRING: u128 = NumberFormatBuilder::rebuild(PYTHON3_LITERAL)
|
||||||
.no_special(false)
|
.no_special(false)
|
||||||
|
.consecutive_digit_separator(false)
|
||||||
.build();
|
.build();
|
||||||
f64::from_lexical_with_options::<PYTHON_STRING>(literal, &Options::new()).ok()
|
f64::from_lexical_with_options::<PYTHON_STRING>(literal, &Options::new()).ok()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue