We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 531f678 commit 623a78dCopy full SHA for 623a78d
extra_tests/snippets/syntax_decimal.py
@@ -0,0 +1,6 @@
1
+try:
2
+ eval("0.E")
3
+except SyntaxError:
4
+ pass
5
+else:
6
+ assert False
parser/src/lexer.rs
@@ -300,7 +300,10 @@ where
300
value_text.push_str(&self.radix_run(10));
301
}
302
303
- let value = f64::from_str(&value_text).unwrap();
+ let value = f64::from_str(&value_text).map_err(|_| LexicalError {
304
+ error: LexicalErrorType::OtherError("Invalid decimal literal".to_owned()),
305
+ location: self.get_pos(),
306
+ })?;
307
// Parse trailing 'j':
308
if self.chr0 == Some('j') || self.chr0 == Some('J') {
309
self.next_char();
0 commit comments