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

@ -65,7 +65,10 @@ static box StageBMain {
local externs_json = p.get_externs_json()
local ast_json = p.parse_program2(src)
local prefer = flags.prefer_cfg
local jv0 = FlowEntryBox.emit_v0_from_ast(ast_json, prefer)
local jv0 = FlowEntryBox.emit_v0_from_ast_with_context(ast_json, prefer, usings_json, null, externs_json)
if jv0 == null {
jv0 = FlowEntryBox.emit_v0_from_ast(ast_json, prefer)
}
// Attach usings metadata when availableStage-B pipeline consumes via resolver
if jv0 == null || jv0 == "" { jv0 = "{\"version\":0,\"kind\":\"Program\",\"body\":[{\"type\":\"Return\",\"expr\":{\"type\":\"Int\",\"value\":0}}]}" }
print(jv0)