fix(sema, ir): Potential elvate bugs

This commit is contained in:
2026-06-13 09:10:49 +08:00
parent 2d87760c79
commit 7bcf77f1c1
6 changed files with 135 additions and 34 deletions
+4
View File
@@ -59,6 +59,10 @@ impl Parser {
}
fn parse_stmt(&mut self) -> Result<Statement, ParseProcessError> {
if self.peek().value == TokenValue::Semicolon {
self.advance(1);
return Ok(Statement::Block(BlockStmt { statements: vec![] }));
}
match self.parse_var_decl_stmt(ParseType::TryParse) {
Ok(var_decl) => return Ok(Statement::VarDecl(var_decl)),
Err(ParseProcessError::ErrorInMatch) => return Err(ParseProcessError::ErrorInMatch),