From e838554fff4480ddda214978c97e9b74559851b2 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Tue, 15 Jan 2019 19:22:10 -0600 Subject: [PATCH] FIX: Modules were attempting to conver std imports into absolute paths. --- integration_tests/modules_test.ucg | 5 +++++ src/ast/mod.rs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/integration_tests/modules_test.ucg b/integration_tests/modules_test.ucg index a78ac8b..ac6742e 100644 --- a/integration_tests/modules_test.ucg +++ b/integration_tests/modules_test.ucg @@ -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 { diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 5eb2202..6dd25e3 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -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)