diff --git a/src/parser.rs b/src/parser.rs index 36438b7..51d8fd2 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -227,7 +227,12 @@ impl Parser { &TokenType::LeftBrace, &format!("'{{' expected before {} body", kind), )?; - let block = self.parse_block()?; + let block = { + self.loop_state.push(LoopParsingState::None); + let result = self.parse_block(); + self.loop_state.pop(); + result? + }; Ok(ast::StmtNode::FunDecl { name, params,