mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-30 23:27:39 +00:00
fix: nested module resolution bug
This commit is contained in:
parent
83aae24317
commit
ded10fc3d9
7 changed files with 51 additions and 24 deletions
|
@ -5522,6 +5522,7 @@ pub enum DefKind {
|
|||
PyImport,
|
||||
RsImport,
|
||||
Patch,
|
||||
InlineModule,
|
||||
/// type alias included
|
||||
Other,
|
||||
}
|
||||
|
@ -5556,6 +5557,10 @@ impl DefKind {
|
|||
self.is_erg_import() || self.is_py_import() || self.is_rs_import()
|
||||
}
|
||||
|
||||
pub fn is_inline_module(&self) -> bool {
|
||||
matches!(self, Self::InlineModule)
|
||||
}
|
||||
|
||||
pub const fn is_other(&self) -> bool {
|
||||
matches!(self, Self::Other)
|
||||
}
|
||||
|
@ -5607,6 +5612,7 @@ impl DefBody {
|
|||
Some("rsimport") => DefKind::RsImport,
|
||||
_ => DefKind::Other,
|
||||
},
|
||||
Expr::InlineModule(_) => DefKind::InlineModule,
|
||||
_ => DefKind::Other,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue