This commit is contained in:
Edgar 2024-02-03 13:01:34 +01:00
parent e5ea36a25c
commit 40d71d6b83
No known key found for this signature in database
GPG key ID: 70ADAE8F35904387

View file

@ -30,13 +30,13 @@ pub fn lower_modules(modules: &[ast::Module]) -> Vec<ir::ModuleBody> {
} }
fn lower_module(mut ctx: BuildCtx, module: &ast::Module) -> (BuildCtx, ir::ModuleBody) { fn lower_module(mut ctx: BuildCtx, module: &ast::Module) -> (BuildCtx, ir::ModuleBody) {
let module_id = *ctx.module_name_to_id.get(&module.name.name).unwrap();
let mut body = ir::ModuleBody { let mut body = ir::ModuleBody {
module_id: ctx.module_id_counter, module_id,
functions: Default::default(), functions: Default::default(),
modules: Default::default(), modules: Default::default(),
span: module.span, span: module.span,
}; };
ctx.module_id_counter += 1;
let mut module_ctx = ModuleCtx { let mut module_ctx = ModuleCtx {
id: body.module_id, id: body.module_id,