wwdump: -c/-r gate on parse errors

wwdump's -c/-r modes emitted output from a garbage parse silently.
Gate on the parse-error count first (the w6c main gate, main.ww:162);
wwstage-only — the C wwdump has no -c/-r modes.
This commit is contained in:
2026-06-13 04:40:58 +09:00
parent 4dc8459a90
commit 2ce94a194a
4 changed files with 169 additions and 0 deletions

View File

@@ -263,6 +263,7 @@ TESTS = $(BIN)/test_smoke $(BIN)/test_lex $(BIN)/test_parse $(BIN)/test_check \
$(BIN)/test_defercap_run \
$(BIN)/test_loopcap_run \
$(BIN)/test_enumcap_run \
$(BIN)/test_wwdumpgate_run \
$(BIN)/test_ampfncollide_run \
$(BIN)/test_trycallcollide_run \
$(BIN)/test_gunsigned_run \
@@ -829,6 +830,13 @@ $(BIN)/test_enumcap_run: test/wcc/989_enumcap_run.c \
$(LIB)/libwwrt.a | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_wwdumpgate_run (#52, F15 c4): wwdump_ww's -c/-r arms gate on parse-stage
# errors instead of silently emitting asm / a resolve report on a broken AST.
# Runs wwdump + wwdump_ww directly (rule-10). See the test header.
$(BIN)/test_wwdumpgate_run: test/wcc/989_wwdumpgate_run.c \
$(BIN)/wwdump $(BIN)/wwdump_ww | $(BIN)
$(CC) $(CFLAGS) -o $@ $<
# 989_ampfncollide_run (#4, c2): `&fn` synthesis (unoptype TK_AMP +
# assignableaddrfn) prefers the current module's fn when a same-leaf fn is
# declared in a later module. Builds/rejects on BOTH driver twins (rule-10).