(&mut self)
| 1091 | } |
| 1092 | |
| 1093 | fn while_statement(&mut self) -> Option<Stmt<'gc>> { |
| 1094 | // Set flag before parsing condition |
| 1095 | self.stop_at_brace = true; |
| 1096 | let condition = self.expression()?; |
| 1097 | self.stop_at_brace = false; |
| 1098 | |
| 1099 | self.consume(TokenType::OpenBrace, "Expect '{' before loop body."); |
| 1100 | self.loop_depth += 1; |
| 1101 | let body = Box::new(self.block_statement()?); |
| 1102 | self.loop_depth -= 1; |
| 1103 | |
| 1104 | Some(Stmt::Loop { |
| 1105 | initializer: None, |
| 1106 | condition, |
| 1107 | body, |
| 1108 | increment: None, |
| 1109 | line: self.previous.line, |
| 1110 | }) |
| 1111 | } |
| 1112 | |
| 1113 | fn for_statement(&mut self) -> Option<Stmt<'gc>> { |
| 1114 | let initializer = if self.match_token(TokenType::Semicolon) { |
no test coverage detected