diff --git a/apps/selfhost-compiler/boxes/emitter_box.nyash b/apps/selfhost-compiler/boxes/emitter_box.nyash index bb132879..8c348759 100644 --- a/apps/selfhost-compiler/boxes/emitter_box.nyash +++ b/apps/selfhost-compiler/boxes/emitter_box.nyash @@ -1,5 +1,5 @@ // EmitterBox — thin wrapper to emit JSON v0 (extracted) -box EmitterBox { +static box EmitterBox { emit_program(json, usings_json) { if json == null { return json } // Normalize usings payload to at least an empty array so meta.usings is always present @@ -20,7 +20,3 @@ box EmitterBox { return head + "\"meta\":{\"usings\":" + payload + "}" + tail } } - -static box EmitterStub { - main(args) { return 0 } -} diff --git a/apps/selfhost-compiler/boxes/mir_emitter_box.nyash b/apps/selfhost-compiler/boxes/mir_emitter_box.nyash index fa0c0740..4b56aef6 100644 --- a/apps/selfhost-compiler/boxes/mir_emitter_box.nyash +++ b/apps/selfhost-compiler/boxes/mir_emitter_box.nyash @@ -2,7 +2,7 @@ // Scope: Return(Int) only (const + ret). Safe default to 0 when not found. // Future: add Binary/Compare/ExternCall/BoxCall lowering incrementally. -box MirEmitterBox { +static box MirEmitterBox { // Extract first Return(Int) value from Stage-1 JSON (very small string scan) _extract_return_int(ast_json) { if ast_json == null { return 0 } @@ -47,6 +47,3 @@ box MirEmitterBox { return s } } - -static box MirEmitterStub { main(args) { return 0 } } - diff --git a/apps/selfhost-compiler/compiler.nyash b/apps/selfhost-compiler/compiler.nyash index 9f1752ef..88392c36 100644 --- a/apps/selfhost-compiler/compiler.nyash +++ b/apps/selfhost-compiler/compiler.nyash @@ -115,12 +115,10 @@ static box Main { if emit_mir == 1 { // Lower minimal AST to MIR JSON (Return(Int) only for MVP) - local mir = new MirEmitterBox() - json = mir.emit_mir_min(ast_json) + json = MirEmitterBox.emit_mir_min(ast_json) } else { // Emit Stage‑1 JSON with metadata - local emitter = new EmitterBox() - json = emitter.emit_program(ast_json, me._usings) + json = EmitterBox.emit_program(ast_json, me._usings) } // Output JSON diff --git a/tools/selfhost_smoke.sh b/tools/selfhost_smoke.sh index 3c950cde..03efe890 100644 --- a/tools/selfhost_smoke.sh +++ b/tools/selfhost_smoke.sh @@ -16,8 +16,8 @@ fi echo "[selfhost-smoke] Step 1: Emit JSON via selfhost compiler (min-json, stage3)" OUT_JSON="/tmp/nyash_selfhost_out.json" set -x -if NYASH_ENABLE_USING=1 NYASH_ALLOW_USING_FILE=1 NYASH_USING_AST=1 NYASH_NY_COMPILER_MIN_JSON=1 \ - "${NY_BIN}" apps/selfhost-compiler/compiler.nyash -- --stage3 > "${OUT_JSON}"; then +if NYASH_ENABLE_USING=1 NYASH_ALLOW_USING_FILE=1 NYASH_USING_AST=1 \ + "${NY_BIN}" apps/selfhost-compiler/compiler.nyash -- --min-json --emit-mir --stage3 > "${OUT_JSON}"; then : else echo "[selfhost-smoke] WARN: selfhost compiler emission failed (policy/duplicates?). Continuing." >&2