Parser - Fixed loop parsing state in function bodies
This commit is contained in:
parent
549e93e9a9
commit
0edabd4a48
1 changed files with 6 additions and 1 deletions
|
@ -227,7 +227,12 @@ impl Parser {
|
||||||
&TokenType::LeftBrace,
|
&TokenType::LeftBrace,
|
||||||
&format!("'{{' expected before {} body", kind),
|
&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 {
|
Ok(ast::StmtNode::FunDecl {
|
||||||
name,
|
name,
|
||||||
params,
|
params,
|
||||||
|
|
Loading…
Reference in a new issue