diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-11 17:42:55 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-11 17:42:55 +0800 |
commit | 2cc7375dc027ed3d9ff72ad79d5c4a78acaf9abf (patch) | |
tree | d34ab752afd3bc9cc430cdf8a0cef22bb2b92065 /src | |
parent | 18e863ba303abc9fcf5a3de3e0c94f662e13040e (diff) | |
download | mrust-2cc7375dc027ed3d9ff72ad79d5c4a78acaf9abf.tar.gz |
Resolve Index - Replace imported item paths with the destination
Diffstat (limited to 'src')
-rw-r--r-- | src/resolve/index.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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), |