erg/compiler/erg_compiler/link.rs
2022-09-21 01:21:17 +09:00

19 lines
502 B
Rust

use erg_common::traits::Stream;
use crate::hir::{Expr, HIR};
use crate::mod_cache::SharedModuleCache;
pub struct Linker {}
impl Linker {
pub fn link(mod_cache: SharedModuleCache) -> HIR {
let mut main_mod_hir = mod_cache.remove("<module>").unwrap().hir.unwrap();
for chunk in main_mod_hir.module.iter_mut() {
match chunk {
Expr::Def(def) if def.def_kind().is_module() => {}
_ => {}
}
}
main_mod_hir
}
}