Stage-B: route FlowEntry context (using/extern) and default Stage-B entry

This commit is contained in:
nyash-codex
2025-11-01 03:03:51 +09:00
parent c868667e26
commit 1f415e733c
6 changed files with 29 additions and 11 deletions

View File

@ -2,7 +2,7 @@
- [x] StageB 専用エントリ(`lang/src/compiler/entry/compiler_stageb.hako`)を追加。`--prefer-cfg` を受理。
- [x] `ParserBox.parse_program2` → AST JSON を取得Quiet: 1行。StageA map parser は空/空白/エスケープに対応。
- [x] pipeline_v2 FlowEntry.emit_v0_from_ast で v0 を出力prefer_cfg=1 既定)。
- [x] FlowEntry.emit_v0_from_ast_with_contextusing/extern メタを統合)。
- [x] selfhost canaryreturn/binop/if/indexを StageB でも PASSoptin `SMOKES_ENABLE_STAGEB=1` で緑)。
- [ ] v1→v0 降格MirJsonV1Adapter経路を整備必要箇所のみ
- [x] tools/smokes/v2/profiles/quick/core/selfhost_* を追加optin。配列ネスト/境界ケースを含む。

View File

@ -8,8 +8,8 @@
## フェーズ分割
1) 入口統合StageB ルートの optin 実装)
- `lang/src/compiler/entry/compiler_stageb.hako` を追加(既定: StageB emit 専用)。
- `ParserBox.parse_program2(src)``FlowEntryBox.emit_v0_from_ast(ast_json, prefer_cfg)` → print 1 行 JSON。
- フラグ: `--prefer-cfg <N>` で pipeline 選好を切替できるようにする
- `ParserBox.parse_program2(src)``FlowEntryBox.emit_v0_from_ast_with_context(..., usings, modules?, externs)` → print 1 行 JSON。
- フラグ: `--prefer-cfg <N>` で pipeline 選好を切替。StageB は using あり / externs あり時の経路を統合済み
2) 代表構文の緑化
- binop/compare/if/index/new/boxcall/externcall を pipeline_v2 で受理できるよう確認。
- StageA canary と同等の selfhost canary を StageB でも PASS。

View File

@ -29,7 +29,7 @@
- 既定 OFF のため quick/integration は回帰なし。
実装メモ
- StageB エントリを `lang/src/compiler/entry/compiler_stageb.hako` として分離。`--source` / `--prefer-cfg {0|1|2}` を受理
- StageB エントリを `lang/src/compiler/entry/compiler_stageb.hako` として分離。`FlowEntryBox.emit_v0_from_ast_with_context`using/extern メタを集約)を既定で使う
- StageA map parser を強化(空/空白/エスケープ対応)。対応済み canary: `index_operator_hako`
- StageB canary は `SMOKES_ENABLE_STAGEB=1` で有効化。binop/if/indexネスト・境界ケース込みを opt-in で検証可能。
- Module 解決: `nyash.toml` に lang/compiler/shared/vm の論理名を追記し、using resolver から参照可能にした。