Add get_fqsn_from_id opposite lookup method

This commit is contained in:
greg 2019-09-19 03:06:49 -07:00
parent 6ebe893acb
commit 8b1dd561f2
1 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,10 @@ impl SymbolTable {
self.id_to_fqsn.insert(id.clone(), fqsn);
}
pub fn get_fqsn_from_id(&mut self, id: &ItemId) -> Option<FullyQualifiedSymbolName> {
self.id_to_fqsn.get(&id).cloned()
}
fn add_new_symbol(&mut self, 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 });