Skip to content

Commit 47726f0

Browse files
WIP
1 parent 238c3af commit 47726f0

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
@@ -357,20 +357,18 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
357357
} else {
358358
if( !is_compilation_needed(infile) ) {
359359
mod1 = load_pycfile(al, input, false);
360-
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
361-
LFORTRAN_ASSERT(asr_verify(*mod1));
362-
compile_module = false;
363360
} else {
364361
infile.pop_back();
365-
std::string cmd = "lpython -c --disable-main " + infile;
366-
system(cmd.c_str());
367-
bool found = set_module_path(infile0c, rl_path, infile,
368-
path_used, input, ltypes, enum_py);
369-
mod1 = load_pycfile(al, input, false);
370-
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
371-
LFORTRAN_ASSERT(asr_verify(*mod1));
372-
compile_module = false;
362+
mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
363+
// std::string cmd = "lpython -c --disable-main " + infile;
364+
// system(cmd.c_str());
365+
// bool found = set_module_path(infile0c, rl_path, infile,
366+
// path_used, input, ltypes, enum_py);
367+
// mod1 = load_pycfile(al, input, false);
373368
}
369+
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
370+
LFORTRAN_ASSERT(asr_verify(*mod1));
371+
compile_module = false;
374372
}
375373

376374
if( enum_py ) {
@@ -382,12 +380,12 @@ ASR::Module_t* load_module(Allocator &al, SymbolTable *symtab,
382380
if (ltypes) return nullptr;
383381

384382
if( compile_module ) {
385-
// mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
386-
std::string cmd = "lpython -c --disable-main " + infile;
387-
system(cmd.c_str());
388-
bool found = set_module_path(infile0c, rl_path, infile,
389-
path_used, input, ltypes, enum_py);
390-
mod1 = load_pycfile(al, input, false);
383+
mod1 = compile_module_till_asr(al, rl_path, infile, loc, err);
384+
// std::string cmd = "lpython -c --disable-main " + infile;
385+
// system(cmd.c_str());
386+
// bool found = set_module_path(infile0c, rl_path, infile,
387+
// path_used, input, ltypes, enum_py);
388+
// mod1 = load_pycfile(al, input, false);
391389
fix_external_symbols(*mod1, *ASRUtils::get_tu_symtab(symtab));
392390
LFORTRAN_ASSERT(asr_verify(*mod1));
393391
}

0 commit comments

Comments
 (0)