lib/ww/syntax: export the 16 public types consumed by the wcc backend (#72)

After the frontend consolidated into one syntax package, the wcc backend
imports syntax and calls its exported fns — whose signatures reference
types that were unexported. Producing syntax's .wwi interface re-triggered
check_exported_type ("exported declaration references unexported type"):
the residual of BUG-A at the one surviving syntax->wcc boundary. Export
the 16 types that appear in syntax's wcc-facing public surface (directly
in an exported signature, or via a recursively-referenced exported struct
field): nkind, node, lex, tok, tkind, parser, scope, sym, skind, tinfo,
tykind, tfield, tparam, ttupleelem, tctx, tinfocacheent. The set is
minimal (unexporting any one re-breaks the producer) and complete; pos
stays internal. Pure source change — exporting a type emits no code, so
the bootstrap binaries are byte-identical (verified against a clean base
build); only syntax's .wwi gains the type decls.

Post-frontend-reorg residual (#74). syntax now sep-produces clean both
stages. The separate concern of wcc's currently-unqualified refs to
syntax symbols (#75) is a distinct follow-up. Gate 989_syntaxexport_run.
This commit is contained in:
2026-06-16 20:19:14 +09:00
parent 7a8acfb952
commit 697e413113
10 changed files with 343 additions and 48 deletions

View File

@@ -562,6 +562,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_sepbuild_run \
$(BIN)/test_sepdotpath_run \
$(BIN)/test_seproot_export_run \
$(BIN)/test_syntaxexport_run \
$(BIN)/test_sepstructdef_run \
$(BIN)/test_sepcycle_dup \
$(BIN)/test_separchive_run \
@@ -3131,6 +3132,18 @@ $(BIN)/test_seproot_export_run: test/wcc/989_seproot_export_run.c $(BIN)/ww $(BI
$(BIN)/w6l $(BIN)/w6l_ww $(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_syntaxexport_run — BUG-A residual (#72) at the surviving syntax->wcc
# boundary after the #74 consolidation: syntax's exported fns name frontend
# types, so the producer's check_exported_type (recursing exported-struct
# FIELDS too) rejects until those 16 types carry `export`. Drives BOTH driver
# stages on the real lib/ww/syntax via a qualified-ref root + replays the
# producer on the produced unit (both compilers, export-strip = the bug), so
# it needs both driver + both compiler + both linker stages + libwwrt.
$(BIN)/test_syntaxexport_run: test/wcc/989_syntaxexport_run.c $(BIN)/ww $(BIN)/ww_ww \
$(BIN)/w6c $(BIN)/w6c_ww $(BIN)/w6a $(BIN)/w6a_ww \
$(BIN)/w6l $(BIN)/w6l_ww $(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_sepstructdef_run — sep-build of a dep exporting aggregate-initializer
# defs (N_STRUCTLIT info / N_ARRLIT arr) (#70, BUG-2): the producer must emit a
# value-LESS prototype `export def X: T;` for an aggregate-init def (DATA-global