Working module cache

This commit is contained in:
2026-06-13 19:54:05 +02:00
parent c8187379a5
commit b2ff76d691
2 changed files with 40 additions and 16 deletions
+10 -4
View File
@@ -77,11 +77,17 @@ pub class Module {
}
}
pub fn output_path(*self, parent_dir *PathBuf) PathBuf {
if self.path.is_dir() || self.is_package() {
parent_dir.join(&self.name).join("mod.rs")
pub fn output_path(*self, parent_dir *PathBuf, curr_mod_decl *Option<[mist_parser::ast::Visibility, mist_parser::ast::Identifier]>) PathBuf {
let name = if let Some[[_, name]] = curr_mod_decl {
&name.0
} else {
parent_dir.join(&self.name).with_extension("rs")
&self.name
};
if self.path.is_dir() || self.is_package() {
parent_dir.join(name).join("mod.rs")
} else {
parent_dir.join(name).with_extension("rs")
}
}
}