add_new_symbol clarification

This commit is contained in:
greg 2019-09-25 02:18:36 -07:00
parent 355604d911
commit 2e42313991

View File

@ -102,11 +102,11 @@ impl SymbolTable {
self.id_to_fqsn.get(&id).cloned()
}
fn add_new_symbol(&mut self, name: &Rc<String>, scope_path: &Vec<ScopeSegment>, spec: SymbolSpec) {
fn add_new_symbol(&mut self, local_name: &Rc<String>, scope_path: &Vec<ScopeSegment>, spec: SymbolSpec) {
let mut vec: Vec<ScopeSegment> = scope_path.clone();
vec.push(ScopeSegment { name: name.clone(), kind: ScopeSegmentKind::Terminal });
vec.push(ScopeSegment { name: local_name.clone(), kind: ScopeSegmentKind::Terminal });
let fully_qualified_name = FullyQualifiedSymbolName(vec);
let symbol = Symbol { local_name: name.clone(), fully_qualified_name: fully_qualified_name.clone(), spec };
let symbol = Symbol { local_name: local_name.clone(), fully_qualified_name: fully_qualified_name.clone(), spec };
self.symbol_path_to_symbol.insert(fully_qualified_name, symbol);
}