diff --git a/src/parser.rs b/src/parser.rs index 88cbe54..6614760 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -446,6 +446,7 @@ impl Parser { } else { Some(self.parse_expression()?) }; + self.consume(&TokenType::Semicolon, "';' expected after return statement")?; Ok(ast::StmtNode::Return { token: ret_token.clone(), value,