Move variable resolution to middleend

- Introduce AST-based visitor and resolver in middleend
- Update guard field and parser to use AstNode<Expr>
- Remove backend variable_resolution and adjust exports
- Expose middleend in the library
This commit is contained in:
Giulio Agostini
2026-06-30 09:47:22 +02:00
parent 29c86d278d
commit ef8abda048
10 changed files with 361 additions and 326 deletions
+2 -3
View File
@@ -252,11 +252,10 @@ impl Parser {
end_position: end_position.end_position,
};
let mut guard: Option<Box<Expr>> = None;
let mut guard: Option<Box<AstNode<Expr>>> = None;
if self.peek().token_type == TokenType::LeftBrace {
self.consume(TokenType::LeftBrace, "Expected '{' after guard expression")?;
println!("ho trovato una guradia");
guard = Some(Box::new(self.expression()?.node.clone()));
guard = Some(Box::new(self.expression()?));
self.consume(TokenType::RightBrace, "Expected '}' after guard expression")?;
}