mod resolve work

This commit is contained in:
Aleksey Kladov
2018-08-17 00:18:14 +03:00
parent 6a3f819f79
commit 55e87e0b74
3 changed files with 50 additions and 7 deletions

View File

@@ -34,6 +34,11 @@ impl PathMap {
.as_path()
}
pub fn resolve(&self, id: FileId, relpath: &Path) -> Option<FileId> {
let path = self.get_path(id).join(relpath);
self.get_id(&path)
}
fn insert(&mut self, path: PathBuf, id: FileId) {
self.path2id.insert(path.clone(), id);
self.id2path.insert(id, path.clone());