Skip to content

Commit a03e2a3

Browse files
Thirumalai-ShaktivelShaikh-Ubaid
authored andcommitted
WIP
1 parent 4219afc commit a03e2a3

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/lpython/semantics/python_ast_to_asr.cpp

+15-17
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,18 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
366366
} else {
367367
if( !is_compilation_needed(infile) ) {
368368
mod1 = load_pycfile(al, input, false);
369-
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
370-
LFORTRAN_ASSERT(asr_verify(*mod1));
371-
compile_module = false;
372369
} else {
373370
infile.pop_back();
374-
std::string cmd = "lpython -c --disable-main " + infile;
375-
system(cmd.c_str());
376-
bool found = set_module_path(infile0c, rl_path, infile,
377-
path_used, input, ltypes, enum_py);
378-
mod1 = load_pycfile(al, input, false);
379-
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
380-
LFORTRAN_ASSERT(asr_verify(*mod1));
381-
compile_module = false;
371+
mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
372+
// std::string cmd = "lpython -c --disable-main " + infile;
373+
// system(cmd.c_str());
374+
// bool found = set_module_path(infile0c, rl_path, infile,
375+
// path_used, input, ltypes, enum_py);
376+
// mod1 = load_pycfile(al, input, false);
382377
}
378+
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
379+
LFORTRAN_ASSERT(asr_verify(*mod1));
380+
compile_module = false;
383381
}
384382

385383
if( enum_py ) {
@@ -392,12 +390,12 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
392390
if (ltypes) return nullptr;
393391

394392
if( compile_module ) {
395-
// mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
396-
std::string cmd = "lpython -c --disable-main " + infile;
397-
system(cmd.c_str());
398-
bool found = set_module_path(infile0c, rl_path, infile,
399-
path_used, input, ltypes, enum_py);
400-
mod1 = load_pycfile(al, input, false);
393+
mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
394+
// std::string cmd = "lpython -c --disable-main " + infile;
395+
// system(cmd.c_str());
396+
// bool found = set_module_path(infile0c, rl_path, infile,
397+
// path_used, input, ltypes, enum_py);
398+
// mod1 = load_pycfile(al, input, false);
401399
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
402400
LFORTRAN_ASSERT(asr_verify(*mod1));
403401
}

0 commit comments

Comments
 (0)