phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0

This commit is contained in:
nyash-codex
2025-11-06 15:41:52 +09:00
parent 2dc370223d
commit 77d4fd72b3
1658 changed files with 6288 additions and 2612 deletions

View File

@ -130,13 +130,13 @@ impl NyashRunner {
}
}
}
// Preferred: run Ny selfhost compiler program (apps/selfhost/compiler/compiler.nyash)
// Preferred: run Ny selfhost compiler program (apps/selfhost/compiler/compiler.hako)
// This avoids inline embedding pitfalls and supports Stage-3 gating via args.
{
use crate::runner::modes::common_util::selfhost::{child, json};
let exe = std::env::current_exe()
.unwrap_or_else(|_| std::path::PathBuf::from("target/release/nyash"));
let parser_prog = std::path::Path::new("apps/selfhost/compiler/compiler.nyash");
let parser_prog = std::path::Path::new("apps/selfhost/compiler/compiler.hako");
if parser_prog.exists() {
// Build extra args forwarded to child program
let mut extra_owned: Vec<String> = Vec::new();
@ -384,9 +384,9 @@ impl NyashRunner {
_ => esc.push(ch),
}
}
let inline_path = std::path::Path::new("tmp").join("inline_selfhost_emit.nyash");
let inline_path = std::path::Path::new("tmp").join("inline_selfhost_emit.hako");
let inline_code = format!(
"include \"apps/selfhost/compiler/boxes/parser_box.nyash\"\ninclude \"apps/selfhost/compiler/boxes/emitter_box.nyash\"\nstatic box Main {{\n main(args) {{\n local s = \"{}\"\n local p = new ParserBox()\n p.stage3_enable(1)\n local json = p.parse_program2(s)\n local e = new EmitterBox()\n json = e.emit_program(json, \"[]\")\n print(json)\n return 0\n }}\n}}\n",
"include \"apps/selfhost/compiler/boxes/parser_box.hako\"\ninclude \"apps/selfhost/compiler/boxes/emitter_box.hako\"\nstatic box Main {{\n main(args) {{\n local s = \"{}\"\n local p = new ParserBox()\n p.stage3_enable(1)\n local json = p.parse_program2(s)\n local e = new EmitterBox()\n json = e.emit_program(json, \"[]\")\n print(json)\n return 0\n }}\n}}\n",
esc
);
if let Err(e) = std::fs::write(&inline_path, inline_code) {