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
+7
View File
@@ -79,6 +79,13 @@ impl<T: Clone + Debug + PartialEq> EnvironmentStack<T> {
format!("Undefined variable '{}'", name),
)
}
pub fn depth(&self) -> usize {
self.stack.len()
}
pub fn scope_contains(&self, index: usize, name: &str) -> bool {
self.stack[index].contains_key(name)
}
}
#[cfg(test)]