Fix bug where global names could only be used once in the root scope

Global names previously would only load once, and then not again because
of issues with how the root scope is compiled. This is fixed.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-10-19 16:57:40 -07:00
parent f35d44cf65
commit 1d6b2e35bc
3 changed files with 19 additions and 2 deletions

View File

@@ -104,6 +104,10 @@ impl Compile {
pub(crate) fn collect_locals(&mut self, body: &Body) {
locals::CollectLocals::new(self).collect(body);
}
pub(crate) fn scope(&self) -> &Scope {
&self.scope
}
}
/// Constant data pool used for building the const pool.