diff --git a/CURRENT_TASK.md b/CURRENT_TASK.md index 05b3f7f4..ab25f69c 100644 --- a/CURRENT_TASK.md +++ b/CURRENT_TASK.md @@ -39,7 +39,7 @@ Update — 2025-09-28 (json_query_vm PASS・最終ガード適用) Update — 2025-10-31 (Phase 20.33 bring-up) - Stage-A map literal parser hardened(空/空白/エスケープ); quick `index_operator_hako` expands coverage。 -- Stage-B entry separated (`lang/src/compiler/entry/compiler_stageb.hako`); FlowEntry `emit_v0_from_ast_with_context` (using/extern) を既定採用。`--v1-compat` で MirJsonV1Adapter 経路へ opt-in。opt-in canaries(binop/if/index + nested/boundary、v1)緑。 +- Stage-B entry separated (`lang/src/compiler/entry/compiler_stageb.hako`); `compiler.hako -- --stage-b` から StageBMain を呼び出し、FlowEntry `emit_v0_from_ast_with_context` (using/extern) を既定採用。`--v1-compat` は MirJsonV1Adapter 経路へ opt-in(現状は未配線のため SKIP)。opt-in canaries(binop/if/index + nested/boundary…)は Stage-B 本体が未整備な場合は SKIP 振る舞い。 - `nyash.toml` modules updated to expose lang/compiler/shared/vm namespaces for resolver。 - quick profile: 72/72 PASS(FileBox 未展開時は SKIP ハンドリング)。 diff --git a/lang/src/compiler/entry/compiler.hako b/lang/src/compiler/entry/compiler.hako index 6aebab2d..f93f1800 100644 --- a/lang/src/compiler/entry/compiler.hako +++ b/lang/src/compiler/entry/compiler.hako @@ -2,6 +2,8 @@ // - When invoked with --min-json, emit minimal Program JSON v0 to stdout // - Otherwise, act as a silent placeholder (return 0) +using "lang/src/compiler/entry/compiler_stageb.hako" as StageBMain + static box Main { _parse_signed_int(raw) { if raw == null { return null } @@ -28,7 +30,7 @@ static box Main { _collect_flags(args) { // Stage-A flags: emit/source/return only - local flags = { emit: 0, ret: null, source: null } + local flags = { emit: 0, ret: null, source: null, stage_b: 0 } if args == null { return flags } local i = 0 @@ -37,6 +39,8 @@ static box Main { local token = "" + args.get(i) if token == "--min-json" { flags.emit = 1 + } else if token == "--stage-b" { + flags.stage_b = 1 } else if token == "--source" && i + 1 < n { flags.source = "" + args.get(i + 1) i = i + 1 @@ -464,6 +468,9 @@ static box Main { main(args) { local flags = me._collect_flags(args) + if flags.stage_b == 1 { + return StageBMain.main(args) + } if flags.emit == 1 { local json = me._compile_source_to_json_v0(flags.source) print(json)