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 -2
View File
@@ -314,7 +314,7 @@ pub struct LoxFunction {
pub return_type: Option<String>,
pub body: AstNode<Stmt>,
pub closure: Option<EnvironmentStack<BaseValue>>,
pub guard: Option<Box<Expr>>,
pub guard: Option<Box<AstNode<Expr>>>,
}
impl LoxFunction {
@@ -322,7 +322,7 @@ impl LoxFunction {
parameters: Vec<(String, String)>,
body: AstNode<Stmt>,
closure: Option<EnvironmentStack<BaseValue>>,
guard: Option<Box<Expr>>,
guard: Option<Box<AstNode<Expr>>>,
) -> Self {
LoxFunction {
parameters,