diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-15 11:44:12 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-15 11:44:12 +0800 |
commit | 3044ae80284fb958051ffd2926fcbff470ff8591 (patch) | |
tree | e09bd7461c76118926426acad388c315a86e4703 /src/convert/resolve.cpp | |
parent | 801bce6026e86d32b6971463a3aefd38eb3b2f27 (diff) | |
download | mrust-3044ae80284fb958051ffd2926fcbff470ff8591.tar.gz |
Type alias bound to path, considering removing std hack and implementing AST read
Diffstat (limited to 'src/convert/resolve.cpp')
-rw-r--r-- | src/convert/resolve.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/convert/resolve.cpp b/src/convert/resolve.cpp index a696e802..bba534a3 100644 --- a/src/convert/resolve.cpp +++ b/src/convert/resolve.cpp @@ -125,6 +125,15 @@ public: m_res.pop_scope();
}
}
+
+ void visit(AST::ExprNode_LetBinding& node)
+ {
+ DEBUG("ExprNode_LetBinding");
+
+ AST::NodeVisitor::visit(node.m_value);
+
+ m_res.handle_pattern(node.m_pat);
+ }
};
CPathResolver::CPathResolver(const AST::Crate& crate, const AST::Module& mod, AST::Path module_path):
@@ -148,7 +157,7 @@ void CPathResolver::resolve_path(AST::Path& path, ResolvePathMode mode) const }
// Convert to absolute
- if( !path.is_relative() )
+ if( path.is_absolute() )
{
DEBUG("Absolute - binding");
// Already absolute, our job is done
@@ -156,8 +165,8 @@ void CPathResolver::resolve_path(AST::Path& path, ResolvePathMode mode) const if( !path.is_bound() ) {
path.resolve(m_crate);
}
- }
- else
+ }
+ else if( path.is_relative() )
{
// If there's a single node, and we're in expresion mode, look for a variable
// Otherwise, search for a type
|