chore: resolve decl package path

This commit is contained in:
Shunsuke Shibayama 2024-02-10 01:20:31 +09:00
parent 027009680a
commit 14bf431c57
5 changed files with 36 additions and 14 deletions

View file

@ -13,7 +13,7 @@ use std::time::{Duration, SystemTime};
use erg_common::config::ErgMode;
use erg_common::config::ErgConfig;
use erg_common::consts::ELS;
use erg_common::consts::{DEBUG_MODE, ELS};
use erg_common::debug_power_assert;
use erg_common::dict::Dict;
use erg_common::env::is_std_decl_path;
@ -525,7 +525,11 @@ impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable>
.spawn()
.and_then(|mut child| child.wait())
{
if let Some(path) = self.cfg.input.resolve_decl_path(Path::new(&__name__[..])) {
if let Some(path) = self
.cfg
.input
.resolve_decl_path(Path::new(&__name__[..]), &self.cfg)
{
let size = metadata(&path).unwrap().len();
// if pylyzer crashed
if !status.success() && size == 0 {
@ -728,7 +732,7 @@ impl<ASTBuilder: ASTBuildable, HIRBuilder: Buildable>
// return;
} else if let Some(inliner) = self.inlines.get(path).cloned() {
self.build_deps_and_module(&inliner, graph);
} else {
} else if DEBUG_MODE {
todo!("{path} is not found in self.inlines and self.asts");
}
}