From 2cc7375dc027ed3d9ff72ad79d5c4a78acaf9abf Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 11 Sep 2016 17:42:55 +0800 Subject: Resolve Index - Replace imported item paths with the destination --- src/resolve/index.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp index 3486e8d9..70c25187 100644 --- a/src/resolve/index.cpp +++ b/src/resolve/index.cpp @@ -509,7 +509,12 @@ void Resolve_Index_Module_Normalise_Path(const ::AST::Crate& crate, const Span& if( ie.is_import ) { // Need to replace all nodes up to and including the current with the import path - TODO(sp, "Replace imports - " << path << " (0 - " << i << ") with " << ie.path); + auto new_path = ie.path; + for(unsigned int j = i+1; j < info.nodes.size(); j ++) + new_path.nodes().push_back( mv$(info.nodes[j]) ); + new_path.bind( path.binding().clone() ); + path = mv$(new_path); + return Resolve_Index_Module_Normalise_Path(crate, sp, path); } else { TU_MATCH_DEF(::AST::PathBinding, (ie.path.binding()), (e), -- cgit v1.2.3