From d004d8293e289942a99a2137ce0a0455cf078b0d Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 22 Mar 2015 18:57:47 +0800 Subject: Wildcard lookups in convert resolve, use processing of anon modules --- src/ast/path.cpp | 1 + src/convert/resolve.cpp | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ast/path.cpp b/src/ast/path.cpp index 8e73c095..7eab20dd 100644 --- a/src/ast/path.cpp +++ b/src/ast/path.cpp @@ -78,6 +78,7 @@ void Path::resolve(const Crate& root_crate) const bool is_last = (i+1 == m_nodes.size()); const bool is_sec_last = (i+2 == m_nodes.size()); const PathNode& node = m_nodes[i]; + DEBUG("[" << i << "/"< 0) ? m_res.m_module_stack.back().second : m_res.m_module ); auto idx = parent_mod.add_anon_module( node.m_inner_mod.get() ); - // Increment the module path to include it? (No - Instead handle that when tracing the stack) + // And add to the list of modules to use in lookup m_res.m_module_stack.push_back( ::std::make_pair(idx, node.m_inner_mod.get()) ); + + // Do use resolution on this module, then do + AST::Path local_path = m_res.m_module_path; + for(unsigned int i = 0; i < m_res.m_module_stack.size(); i ++) + local_path.nodes().push_back( AST::PathNode( FMT("#"<