diff options
author | John Hodge <tpg@mutabah.net> | 2016-05-20 11:55:31 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-05-20 11:55:31 +0800 |
commit | a0c013a290f88e4ade34c08ff618d8f1ed3f63f6 (patch) | |
tree | ae0d233b2189ab58d00beeeadebeda07ac792bea /src/resolve/absolute.cpp | |
parent | 19b8d4012bf6d81c47f7eab66a7e38d05d7af718 (diff) | |
download | mrust-a0c013a290f88e4ade34c08ff618d8f1ed3f63f6.tar.gz |
AST/Path - Move crate name to Absolute form
Diffstat (limited to 'src/resolve/absolute.cpp')
-rw-r--r-- | src/resolve/absolute.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index da27261f..5685ae82 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -218,7 +218,7 @@ struct Context break; case LookupMode::Type: - //if( name == "SizeHint" ) { + //if( name == "IntoIterator" ) { // DEBUG("lookup_in_mod(mod="<<mod.path()<<")"); // for(const auto& v : mod.m_type_items) { // DEBUG("- " << v.first << " = " << (v.second.is_pub ? "pub " : "") << v.second.path); @@ -465,6 +465,7 @@ void Resolve_Absolute_Path(/*const*/ Context& context, const Span& sp, Context:: (Absolute, DEBUG("- Absolute"); // Nothing to do (TODO: Bind?) + Resolve_Absolute_PathNodes(context, Span(), e.nodes); ), (UFCS, DEBUG("- UFCS"); @@ -476,6 +477,26 @@ void Resolve_Absolute_Path(/*const*/ Context& context, const Span& sp, Context:: Resolve_Absolute_PathNodes(context, Span(), e.nodes); ) ) + + #if 0 + TU_MATCH_DEF(::AST::Path::Class, (path.m_class), (e), + ( + BUG(sp, "Path wasn't absolutised correctly"); + ), + (Local, + // TODO: Ensure that local paths are bound to the variable/type index + ), + (Absolute, + if( e.crate != "" ) { + // TODO: Handle items from other crates (back-converting HIR paths) + } + TODO(sp, "Bind absolute paths to relevant items (and expand)"); + ), + (UFCS, + // TODO: Resolve UFCS to item class (if possible) + ) + ) + #endif } void Resolve_Absolute_Type(Context& context, TypeRef& type) |