compiler: route --stage-b through main entry; document Stage-B status
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user