Phase 25.1a: selfhost builder hotfix (fn rename, docs)

This commit is contained in:
nyash-codex
2025-11-15 05:42:32 +09:00
parent 8d9bbc40bd
commit 6856922374
40 changed files with 2013 additions and 72 deletions

View File

@ -263,15 +263,23 @@ pub(super) fn lower_program(prog: ProgramV0, imports: std::collections::HashMap<
}
let env = BridgeEnv::with_imports(imports);
let mut module = MirModule::new("ny_json_v0".into());
// Treat CLI entry as taking a single parameter `args`.
let sig = FunctionSignature {
name: "main".into(),
params: vec![],
params: vec![MirType::Unknown],
return_type: MirType::Integer,
effects: EffectMask::PURE,
};
let entry = BasicBlockId::new(0);
let mut f = MirFunction::new(sig, entry);
let mut var_map: HashMap<String, ValueId> = HashMap::new();
// Stage-3 programs (launcher / CLI entry) implicitly reference `args`.
let args_param = ValueId::new(1);
f.params = vec![args_param];
if f.next_value_id < 2 {
f.next_value_id = 2;
}
var_map.insert("args".into(), args_param);
let mut loop_stack: Vec<LoopContext> = Vec::new();
let start_bb = f.entry_block;
let end_bb = lower_stmt_list_with_vars(