External spans: address review.

* The lazy loading mechanism has been moved to a more appropriate place.
* Return values from the functions invoked there are properly used.
* Documentation has gotten some minor improvements.
* Possibly some larger restructuring will need to take place still.
This commit is contained in:
Inokentiy Babushkin
2017-06-12 15:37:26 +02:00
parent afe841587d
commit 271133b03e
4 changed files with 28 additions and 36 deletions

View File

@@ -559,19 +559,9 @@ impl CodeMapper for CodeMap {
}
sp
}
fn load_source_for_filemap(&self, filename: FileName) -> bool {
let file_map = if let Some(fm) = self.get_filemap(&filename) {
fm
} else {
return false;
};
if *file_map.external_src.borrow() == ExternalSource::AbsentOk {
let src = self.file_loader.read_file(Path::new(&filename)).ok();
return file_map.add_external_src(src);
}
false
fn ensure_filemap_source_present(&self, file_map: Rc<FileMap>) -> bool {
let src = self.file_loader.read_file(Path::new(&file_map.name)).ok();
return file_map.add_external_src(src)
}
}