diff --git a/libasr b/libasr index 9c7c52c21f..f2a04fc2ae 160000 --- a/libasr +++ b/libasr @@ -1 +1 @@ -Subproject commit 9c7c52c21f847470c301cffd224f5cc2cf95fe63 +Subproject commit f2a04fc2ae4dd9ccb940c0fee3f694791fec7005 diff --git a/src/lpython/semantics/python_ast_to_asr.cpp b/src/lpython/semantics/python_ast_to_asr.cpp index 2ce695f68b..52ebceb66c 100644 --- a/src/lpython/semantics/python_ast_to_asr.cpp +++ b/src/lpython/semantics/python_ast_to_asr.cpp @@ -4959,28 +4959,30 @@ class SymbolTableVisitor : public CommonVisitor { } paths.push_back(rl_path); paths.push_back(parent_dir); - std::vector mods; + for (size_t i=0; iget_scope() ) { if( ASR::is_a(*item.second) ) { @@ -4991,6 +4993,19 @@ class SymbolTableVisitor : public CommonVisitor { } else { current_module_dependencies.push_back(al, s2c(al, mod_sym)); } + + // ALIAS LOGIC + if (alias) { + std::string alias_str = std::string(alias); + if (current_scope->get_symbol(alias_str) == nullptr) { + ASR::asr_t *ext_sym = ASR::make_ExternalSymbol_t( + al, x.base.base.loc, current_scope, + s2c(al, alias_str), t, s2c(al, mod_sym), + nullptr, 0, s2c(al, mod_sym), ASR::accessType::Public + ); + current_scope->add_symbol(alias_str, ASR::down_cast(ext_sym)); + } + } } }