selfhost-compiler: remove duplicate using; use unqualified Box names (ParserBox/EmitterBox/etc.) to match grammar; add dev selfhost smoke

This commit is contained in:
nyash-codex
2025-09-28 20:40:06 +09:00
parent dd65cf7e4c
commit 4736d2ceb5

View File

@ -38,7 +38,7 @@ static box Main {
// Parser delegation // Parser delegation
parse_program(src, stage3_flag) { parse_program(src, stage3_flag) {
local parser = new ParserBoxMod.ParserBox() local parser = new ParserBox()
if stage3_flag == 1 { parser.stage3_enable(1) } if stage3_flag == 1 { parser.stage3_enable(1) }
// Collect using metadata (no-op acceptance in Stage15) // Collect using metadata (no-op acceptance in Stage15)
parser.extract_usings(src) parser.extract_usings(src)
@ -48,7 +48,7 @@ static box Main {
main(args) { main(args) {
// Debug setup // Debug setup
me.dbg = new DebugBoxMod.DebugBox() me.dbg = new DebugBox()
me.dbg.set_enabled(0) me.dbg.set_enabled(0)
// Source selection (EXE-first friendly) // Source selection (EXE-first friendly)
@ -115,11 +115,11 @@ static box Main {
if emit_mir == 1 { if emit_mir == 1 {
// Lower minimal AST to MIR JSON (Return(Int) only for MVP) // Lower minimal AST to MIR JSON (Return(Int) only for MVP)
local mir = new MirEmitterBoxMod.MirEmitterBox() local mir = new MirEmitterBox()
json = mir.emit_mir_min(ast_json) json = mir.emit_mir_min(ast_json)
} else { } else {
// Emit Stage1 JSON with metadata // Emit Stage1 JSON with metadata
local emitter = new EmitterBoxMod.EmitterBox() local emitter = new EmitterBox()
json = emitter.emit_program(ast_json, me._usings) json = emitter.emit_program(ast_json, me._usings)
} }