FIX: Modules were attempting to conver std imports into absolute paths.

This commit is contained in:
Jeremy Wall 2019-01-15 19:22:10 -06:00
parent 5b05405618
commit e838554fff
2 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,11 @@ let test_empty_mod = module {
} => {
};
let std_lib_import = module {
} => {
let tpl = import "std/tuples.ucg";
};
let empty_mod_instance = test_empty_mod{};
let test_simple_mod = module {

View File

@ -545,6 +545,10 @@ impl ModuleDef {
}
if let Expression::Import(ref mut def) = e {
let path = PathBuf::from(&def.path.fragment);
// std/ paths are special and do not get made into absolute paths.
if path.starts_with("std/") {
return;
}
if path.is_relative() {
def.path.fragment = base
.join(path)