FIX: Include source file for parsing/build errors in the std lib.

This commit is contained in:
Jeremy Wall 2019-04-15 19:07:43 -05:00
parent 76e8510f15
commit 0e2e396ac3
2 changed files with 6 additions and 3 deletions

View File

@ -398,7 +398,10 @@ impl<'a> FileBuilder<'a> {
Some(v) => v.clone(),
None => {
let mut b = self.clone_builder();
b.eval_string(self.std.get(&def.path.fragment).unwrap())?;
b.eval_input(
OffsetStrIter::new(self.std.get(&def.path.fragment).unwrap())
.with_src_file(&def.path.fragment),
)?;
b.get_outputs_as_val()
}
};

View File

@ -30,8 +30,8 @@ impl<'a> OffsetStrIter<'a> {
}
}
pub fn with_src_file(mut self, file: PathBuf) -> Self {
self.source_file = Some(file);
pub fn with_src_file<P: Into<PathBuf>>(mut self, file: P) -> Self {
self.source_file = Some(file.into());
self
}
}