Fix failing test
This commit is contained in:
parent
2247d9b58e
commit
4c99be700f
@ -85,12 +85,17 @@ impl<'a> SymbolTablePopulator<'a> {
|
|||||||
let Statement { id, kind, location } = decl_stmt;
|
let Statement { id, kind, location } = decl_stmt;
|
||||||
let location = *location;
|
let location = *location;
|
||||||
match kind {
|
match kind {
|
||||||
decl @ Declaration::FuncDecl(..) => {
|
decl @ Declaration::FuncDecl(signature, body) => {
|
||||||
let output =
|
let output =
|
||||||
self.add_single_declaration(id, decl, location, scope_stack, true);
|
self.add_single_declaration(id, decl, location, scope_stack, true);
|
||||||
if let Err(e) = output {
|
if let Err(e) = output {
|
||||||
errors.push(e);
|
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),
|
_other => errors.push(SymbolError::BadImplBlockEntry),
|
||||||
};
|
};
|
||||||
|
@ -28,8 +28,6 @@ enum ScopeType {
|
|||||||
|
|
||||||
pub struct ScopeResolver<'a> {
|
pub struct ScopeResolver<'a> {
|
||||||
symbol_table: &'a mut super::SymbolTable,
|
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>,
|
lexical_scopes: LexScope<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user