diff options
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/index.cpp | 4 | ||||
-rw-r--r-- | src/resolve/use.cpp | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/resolve/index.cpp b/src/resolve/index.cpp index 57f33cc6..c63b424d 100644 --- a/src/resolve/index.cpp +++ b/src/resolve/index.cpp @@ -149,6 +149,7 @@ void Resolve_Index_Module_Base(AST::Module& mod) BUG(sp, "Import was bound to struct method"); ), + (Crate , _add_item(sp, mod, IndexName::Namespace, i.name, i.is_pub, i.data.path); ), (Module, _add_item(sp, mod, IndexName::Namespace, i.name, i.is_pub, i.data.path); ), //(Crate, _add_item_type(sp, mod, IndexName::Namespace, i.name, i.is_pub, i.data.path); ), (Enum, _add_item_type(sp, mod, i.name, i.is_pub, i.data.path); ), @@ -225,6 +226,9 @@ void Resolve_Index_Module_Wildcard(AST::Module& mod, bool handle_pub) BUG(sp, "Import was bound to struct method"); ), + (Crate, + TODO(sp, "Glob import of crate"); + ), (Module, DEBUG("Glob mod " << i.data.path); if( e.module_ == &mod ) { diff --git a/src/resolve/use.cpp b/src/resolve/use.cpp index 3ddee7c2..12c4b458 100644 --- a/src/resolve/use.cpp +++ b/src/resolve/use.cpp @@ -220,11 +220,10 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path // IMPOSSIBLE - Handled above ), (MacroInv, - BUG(span, "HIt MacroInv in use resolution"); + BUG(span, "Hit MacroInv in use resolution"); ), (Crate, - //return ::AST::PathBinding::make_Crate({&e}); - TODO(span, "Handle importing from a crate"); + return ::AST::PathBinding::make_Crate({ &crate.m_extern_crates.at(e.name) }); ), (Type, return ::AST::PathBinding::make_TypeAlias({&e}); @@ -313,6 +312,9 @@ void Resolve_Use_Mod(const ::AST::Crate& crate, ::AST::Module& mod, ::AST::Path ( ERROR(span, E0000, "Unexpected item type in import"); ), + (Crate, + TODO(span, "Get binding within an extern crate"); + ), (Enum, const auto& enum_ = *e.enum_; i += 1; |