Variable indexing

This commit is contained in:
2026-04-16 10:12:49 +02:00
parent 3e1fa5cd18
commit 2d46afff9a
2 changed files with 20 additions and 1 deletions
+7
View File
@@ -28,6 +28,13 @@ impl Scope {
Scope::Local(l) => l.get_reference(name),
}
}
pub fn next_var_idx(&self) -> usize {
match self {
Scope::TopLevel(tl) => tl.next_var_idx(),
Scope::Local(l) => l.parent.next_var_idx(),
}
}
}
#[derive(Debug)]