diff options
author | John Hodge <tpg@mutabah.net> | 2016-08-29 16:29:27 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-08-29 16:29:27 +0800 |
commit | 3a15a02099f8d1e8442d68072fc1ee7a14ae5b92 (patch) | |
tree | b996a18f889bd86f54788800a1d94dbffc09f115 /src/hir/from_ast.cpp | |
parent | 2954698f2063b83355c64af0bf6ec93bf151e66f (diff) | |
download | mrust-3a15a02099f8d1e8442d68072fc1ee7a14ae5b92.tar.gz |
HIR From AST - Convert use statements into HIR items
Diffstat (limited to 'src/hir/from_ast.cpp')
-rw-r--r-- | src/hir/from_ast.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp index b99cc0cf..df43678c 100644 --- a/src/hir/from_ast.cpp +++ b/src/hir/from_ast.cpp @@ -1030,6 +1030,23 @@ void _add_mod_val_item(::HIR::Module& mod, ::std::string name, bool is_pub, ::H ) } + for( const auto& ie : ast_mod.m_namespace_items ) + { + if( ie.second.is_import ) { + _add_mod_ns_item(mod, ie.first, ie.second.is_pub, ::HIR::TypeItem::make_Import({ + LowerHIR_SimplePath( Span(), ie.second.path ) + }) ); + } + } + for( const auto& ie : ast_mod.m_value_items ) + { + if( ie.second.is_import ) { + _add_mod_val_item(mod, ie.first, ie.second.is_pub, ::HIR::ValueItem::make_Import({ + LowerHIR_SimplePath( Span(), ie.second.path ) + }) ); + } + } + return mod; } |