diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-06 19:55:17 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-06 19:55:17 +0800 |
commit | 6d7c84bd9d8d5e2bec8bc86d22d53975bde6e833 (patch) | |
tree | dddee2de5214120a9808d2f7a367288807703b54 /src/convert/resolve.cpp | |
parent | 414883e7b61d14edb242d320dcf0e5dea3e75e85 (diff) | |
download | mrust-6d7c84bd9d8d5e2bec8bc86d22d53975bde6e833.tar.gz |
Bugfixes exposed by fixing formatted output
Diffstat (limited to 'src/convert/resolve.cpp')
-rw-r--r-- | src/convert/resolve.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/convert/resolve.cpp b/src/convert/resolve.cpp index 3c10a133..cba7d375 100644 --- a/src/convert/resolve.cpp +++ b/src/convert/resolve.cpp @@ -70,7 +70,7 @@ public: void ResolvePaths(AST::Crate& crate);
class CResolvePaths_NodeVisitor:
- public AST::NodeVisitor
+ public AST::NodeVisitorDef
{
CPathResolver& m_res;
public:
@@ -92,8 +92,8 @@ public: m_res.handle_path(node.m_path, CASTIterator::MODE_EXPR);
}
void visit(AST::ExprNode_CallPath& node) {
- DEBUG("ExprNode_CallPath");
- AST::NodeVisitor::visit(node);
+ DEBUG("ExprNode_CallPath - " << node);
+ AST::NodeVisitorDef::visit(node);
m_res.handle_path(node.m_path, CASTIterator::MODE_EXPR);
}
@@ -171,11 +171,13 @@ void CPathResolver::handle_path(AST::Path& path, CASTIterator::PathMode mode) if( path.is_absolute() )
{
DEBUG("Absolute - binding");
+ INDENT();
// Already absolute, our job is done
// - However, if the path isn't bound, bind it
if( !path.is_bound() ) {
path.resolve(m_crate);
}
+ UNINDENT();
}
else if( path.is_relative() )
{
@@ -492,17 +494,23 @@ void ResolvePaths(AST::Crate& crate) {
DEBUG(" >>>");
// Pre-process external crates to tag all paths
+ DEBUG(" --- Extern crates");
+ INDENT();
for(auto& ec : crate.extern_crates())
{
SetCrateName_Mod(crate, ec.first, ec.second.root_module());
}
+ UNINDENT();
// Handle 'use' statements in an initial parss
+ DEBUG(" --- Use Statements");
+ INDENT();
ResolvePaths_HandleModule_Use(crate, AST::Path(AST::Path::TagAbsolute()), crate.root_module());
- DEBUG(" ---");
+ UNINDENT();
// Then do path resolution on all other items
CPathResolver pr(crate);
+ DEBUG(" ---");
pr.handle_module(AST::Path(AST::Path::TagAbsolute()), crate.root_module());
DEBUG(" <<<");
}
|