This commit is contained in:
Nilton Constantino
2026-02-02 16:31:06 +00:00
parent 6330c6cbae
commit f80cb64f66
17 changed files with 594 additions and 157 deletions
@@ -113,6 +113,21 @@ pub fn lower_function(
arg_count: *arg_count
}, None));
}
ir_core::Instr::ImportCall(dep_alias, module_path, symbol_name, arg_count) => {
// Pop arguments from type stack
for _ in 0..*arg_count {
stack_types.pop();
}
// Push return type (Assume Int for v0 imports if unknown)
stack_types.push(ir_core::Type::Int);
vm_func.body.push(ir_vm::Instruction::new(ir_vm::InstrKind::ImportCall {
dep_alias: dep_alias.clone(),
module_path: module_path.clone(),
symbol_name: symbol_name.clone(),
arg_count: *arg_count,
}, None));
}
ir_core::Instr::HostCall(id, slots) => {
// HostCall return types are not easily known without a registry,
// but we now pass the number of slots.