File tree Expand file tree Collapse file tree 2 files changed +7
-26
lines changed Expand file tree Collapse file tree 2 files changed +7
-26
lines changed Original file line number Diff line number Diff line change 1
- i < 0
1
+ for #i = 0; i < 10; i++ {
2
+
3
+ }
Original file line number Diff line number Diff line change @@ -585,34 +585,13 @@ impl<'a> Parser<'a> {
585
585
}
586
586
587
587
let condition = self . parse_expression ( Precedence :: Lowest ) ?. 0 ;
588
- if ( self . current_token_is ( TokenKind :: Semicolon ) || self . peek_token_is ( TokenKind :: Semicolon ) ) != true {
589
- return Err ( CompileTimeError {
590
- location : self . current_location ( ) ,
591
- etype : ParserErrorType :: MissingSemicolon ,
592
- file_name : Some ( self . lexer . file_name . clone ( ) ) ,
593
- code_raw : Some ( self . lexer . select ( start..self . current_token . span . end ) ) ,
594
- verbose : None ,
595
- caret : true ,
596
- } ) ;
597
- }
598
- self . next_token ( ) ; // consume latest token
599
-
600
- if self . current_token_is ( TokenKind :: Semicolon ) {
601
- self . next_token ( ) ;
602
- }
588
+ self . expect_current ( TokenKind :: Semicolon ) ?;
603
589
604
590
let mut increment: Option < Expression > = None ;
591
+
592
+
605
593
if !self . current_token_is ( TokenKind :: LeftBrace ) {
606
- match self . parse_expression ( Precedence :: Lowest ) {
607
- Ok ( result) => {
608
- increment = Some ( result. 0 ) ;
609
- }
610
- Err ( e) => {
611
- return Err ( e) ;
612
- }
613
- }
614
-
615
- self . next_token ( ) ; // consume increment token
594
+ increment = Some ( self . parse_expression ( Precedence :: Lowest ) ?. 0 ) ;
616
595
}
617
596
618
597
let body = self . parse_for_loop_body ( start) ?;
You can’t perform that action at this time.
0 commit comments