From bf2f4a5483c6e6c36718c287f21759a294682e60 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 1 Sep 2016 16:19:53 +0800 Subject: Resolve Abs - Abs import paths --- src/resolve/absolute.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index 597097aa..7106e572 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -1895,6 +1895,24 @@ void Resolve_Absolute_Mod( Context item_context, ::AST::Module& mod ) item_context.pop(impl_def.params()); item_context.pop_self( impl_def.type() ); } + + // - Run through the indexed items and fix up those paths + static Span sp; + for(auto& i : mod.m_namespace_items) { + if( i.second.is_import ) { + Resolve_Absolute_Path(item_context, sp, Context::LookupMode::Namespace, i.second.path); + } + } + for(auto& i : mod.m_type_items) { + if( i.second.is_import ) { + Resolve_Absolute_Path(item_context, sp, Context::LookupMode::Type, i.second.path); + } + } + for(auto& i : mod.m_value_items) { + if( i.second.is_import ) { + Resolve_Absolute_Path(item_context, sp, Context::LookupMode::Constant, i.second.path); + } + } } void Resolve_Absolutise(AST::Crate& crate) -- cgit v1.2.3