diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-28 10:41:19 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-28 10:41:19 +0800 |
commit | 5ed0a0944d7d0c5205d78de9195765de755815bc (patch) | |
tree | 58f0ff0b12151c1e43d8edab6fa9a4677e173329 /src/resolve/absolute.cpp | |
parent | e7bae8f3f2188c6b04e4f4d62e898275f072a6e3 (diff) | |
download | mrust-5ed0a0944d7d0c5205d78de9195765de755815bc.tar.gz |
Resolve Absolute - Implement TODO with imported modules
Diffstat (limited to 'src/resolve/absolute.cpp')
-rw-r--r-- | src/resolve/absolute.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index ce9abd0a..29e7fa4b 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -1098,7 +1098,16 @@ void Resolve_Absolute_Path_BindAbsolute(Context& context, const Span& sp, Contex ), (Module, if( name_ref.is_import ) { - TODO(sp, "Replace path component with new path - " << path << "[.."<<i<<"] with " << name_ref.path); + //TODO(sp, "Replace path component with new path - " << path << "[.."<<i+1<<"] with " << name_ref.path); + auto newpath = name_ref.path; + for(unsigned int j = i+1; j < path_abs.nodes.size(); j ++) + { + newpath.nodes().push_back( mv$(path_abs.nodes[j]) ); + } + DEBUG("- Module import, " << path << " => " << newpath); + path = mv$(newpath); + Resolve_Absolute_Path_BindAbsolute(context, sp, mode, path); + return ; } else { mod = e.module_; |