Use block in scope resolution
This commit is contained in:
parent
dbd81ca83d
commit
0b57561114
@ -17,13 +17,7 @@ impl<'a> ScopeResolver<'a> {
|
||||
ScopeResolver { symbol_table, name_scope_stack }
|
||||
}
|
||||
pub fn resolve(&mut self, ast: &mut AST) -> Result<(), String> {
|
||||
for statement in ast.statements.iter() {
|
||||
match statement.kind {
|
||||
StatementKind::Declaration(ref decl) => self.decl(decl),
|
||||
StatementKind::Expression(ref expr) => self.expr(expr),
|
||||
StatementKind::Import(ref spec) => self.import(spec),
|
||||
}?;
|
||||
}
|
||||
self.block(&mut ast.statements)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -64,7 +58,7 @@ impl<'a> ScopeResolver<'a> {
|
||||
match statement.kind {
|
||||
StatementKind::Declaration(ref decl) => self.decl(decl),
|
||||
StatementKind::Expression(ref expr) => self.expr(expr),
|
||||
StatementKind::Import(_) => Ok(())
|
||||
StatementKind::Import(ref spec) => self.import(spec),
|
||||
}?;
|
||||
}
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user