File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,6 @@ def test_float_exponent_tokenization(self):
179
179
self .assertEqual (1 if 0 else 0 , 0 )
180
180
self .assertRaises (SyntaxError , eval , "0 if 1Else 0" )
181
181
182
- # TODO: RUSTPYTHON
183
- @unittest .expectedFailure
184
182
def test_underscore_literals (self ):
185
183
for lit in VALID_UNDERSCORE_LITERALS :
186
184
self .assertEqual (eval (lit ), eval (lit .replace ('_' , '' )))
Original file line number Diff line number Diff line change @@ -316,10 +316,21 @@ where
316
316
317
317
// 1e6 for example:
318
318
if self . chr0 == Some ( 'e' ) || self . chr0 == Some ( 'E' ) {
319
+ if self . chr1 == Some ( '_' ) {
320
+ return Err ( LexicalError {
321
+ error : LexicalErrorType :: OtherError ( "Invalid Syntax" . to_owned ( ) ) ,
322
+ location : self . get_pos ( ) ,
323
+ } ) ;
324
+ }
319
325
value_text. push ( self . next_char ( ) . unwrap ( ) . to_ascii_lowercase ( ) ) ;
320
-
321
326
// Optional +/-
322
327
if self . chr0 == Some ( '-' ) || self . chr0 == Some ( '+' ) {
328
+ if self . chr1 == Some ( '_' ) {
329
+ return Err ( LexicalError {
330
+ error : LexicalErrorType :: OtherError ( "Invalid Syntax" . to_owned ( ) ) ,
331
+ location : self . get_pos ( ) ,
332
+ } ) ;
333
+ }
323
334
value_text. push ( self . next_char ( ) . unwrap ( ) ) ;
324
335
}
325
336
You can’t perform that action at this time.
0 commit comments