Fix failing test

This commit is contained in:
Greg Shuflin 2021-12-16 10:49:46 -08:00
parent 2247d9b58e
commit 4c99be700f
2 changed files with 6 additions and 3 deletions

View File

@ -85,12 +85,17 @@ impl<'a> SymbolTablePopulator<'a> {
let Statement { id, kind, location } = decl_stmt;
let location = *location;
match kind {
decl @ Declaration::FuncDecl(..) => {
decl @ Declaration::FuncDecl(signature, body) => {
let output =
self.add_single_declaration(id, decl, location, scope_stack, true);
if let Err(e) = output {
errors.push(e);
};
let new_scope = ScopeSegment::Name(signature.name.clone());
scope_stack.push(new_scope);
let output = self.add_from_scope(body.as_ref(), scope_stack, true);
scope_stack.pop();
errors.extend(output.into_iter());
}
_other => errors.push(SymbolError::BadImplBlockEntry),
};

View File

@ -28,8 +28,6 @@ enum ScopeType {
pub struct ScopeResolver<'a> {
symbol_table: &'a mut super::SymbolTable,
//TODO maybe this shouldn't be a scope stack, b/c the recursion behavior comes from multiple
//instances of ScopeResolver
lexical_scopes: LexScope<'a>,
}