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:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user