compiler: route --stage-b through main entry; document Stage-B status

This commit is contained in:
nyash-codex
2025-11-01 08:59:43 +09:00
parent e5331c87b0
commit bec43ea206
2 changed files with 9 additions and 2 deletions

View File

@ -39,7 +39,7 @@ Update — 2025-09-28 (json_query_vm PASS・最終ガード適用)
Update — 2025-10-31 (Phase 20.33 bring-up) Update — 2025-10-31 (Phase 20.33 bring-up)
- Stage-A map literal parser hardened空白エスケープ; quick `index_operator_hako` expands coverage。 - 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 canariesbinop/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 canariesbinop/if/index + nested/boundary…)は Stage-B 本体が未整備な場合は SKIP 振る舞い
- `nyash.toml` modules updated to expose lang/compiler/shared/vm namespaces for resolver。 - `nyash.toml` modules updated to expose lang/compiler/shared/vm namespaces for resolver。
- quick profile: 72/72 PASSFileBox 未展開時は SKIP ハンドリング)。 - quick profile: 72/72 PASSFileBox 未展開時は SKIP ハンドリング)。

View File

@ -2,6 +2,8 @@
// - When invoked with --min-json, emit minimal Program JSON v0 to stdout // - When invoked with --min-json, emit minimal Program JSON v0 to stdout
// - Otherwise, act as a silent placeholder (return 0) // - Otherwise, act as a silent placeholder (return 0)
using "lang/src/compiler/entry/compiler_stageb.hako" as StageBMain
static box Main { static box Main {
_parse_signed_int(raw) { _parse_signed_int(raw) {
if raw == null { return null } if raw == null { return null }
@ -28,7 +30,7 @@ static box Main {
_collect_flags(args) { _collect_flags(args) {
// Stage-A flags: emit/source/return only // 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 } if args == null { return flags }
local i = 0 local i = 0
@ -37,6 +39,8 @@ static box Main {
local token = "" + args.get(i) local token = "" + args.get(i)
if token == "--min-json" { if token == "--min-json" {
flags.emit = 1 flags.emit = 1
} else if token == "--stage-b" {
flags.stage_b = 1
} else if token == "--source" && i + 1 < n { } else if token == "--source" && i + 1 < n {
flags.source = "" + args.get(i + 1) flags.source = "" + args.get(i + 1)
i = i + 1 i = i + 1
@ -464,6 +468,9 @@ static box Main {
main(args) { main(args) {
local flags = me._collect_flags(args) local flags = me._collect_flags(args)
if flags.stage_b == 1 {
return StageBMain.main(args)
}
if flags.emit == 1 { if flags.emit == 1 {
local json = me._compile_source_to_json_v0(flags.source) local json = me._compile_source_to_json_v0(flags.source)
print(json) print(json)