test: banner purge + WHY-only comment sweep (rule 8)

Every section banner dies (103 -> 0) across test/lang, the observer
suites, the C carriers, and the five comment-heavy corpus fixtures;
banner provenance (#N cites, carrier numbers, repair-cluster labels)
folded into headers or adjacent WHY comments. Narration deleted; row
provenance, ref cites, divergence pins, and layout contracts kept
(fwd-ref decl-order guards and bootstrap-gate corpus rationale
restored where the sweep over-cut). Comment-only proven: all 3742
wwbuild workdir .s byte-identical before/after; test-commit and
test-byteid (161 lang + 1399 data, 0 pinned-divergent) green.
This commit is contained in:
2026-08-08 21:40:23 +09:00
parent aadc6618f0
commit 83f5956df2
120 changed files with 184 additions and 530 deletions

View File

@@ -1,6 +1,4 @@
/*
* 738_module_decl — sentinel for the `package <name>;` keyword.
*
* Pins three invariants from the module-system rewrite:
* 1. The parser ACCEPTS `package foo;` as the first non-comment item.
* 2. The parser ACCEPTS multiple `package X;` decls (concatenated
@@ -70,38 +68,32 @@ main(void)
{
int pass = 0, fail = 0;
/* Row 1: `package foo;` accepted as first non-comment item. */
if (parses_clean("package foo;\nfn x() void = {};\n")) pass++;
else { fprintf(stderr, "738[1] basic package accept FAILED\n"); fail++; }
/* Row 2: comments before `package foo;` legal. */
if (parses_clean("// header\n// more\npackage foo;\nfn x() void = {};\n")) pass++;
else { fprintf(stderr, "738[2] package after comments FAILED\n"); fail++; }
/* Row 3: subsequent decls stamped with current package. */
if (check_module_stamps(
"package foo;\nfn x() void = {};\nfn y() void = {};\n",
"foo", "foo")) pass++;
else { fprintf(stderr, "738[3] decl module stamping FAILED\n"); fail++; }
/* Row 4: concatenated multi-section stream — second package
* decl switches the stamp for subsequent decls. Mirrors driver-
* emitted multi-file modules. */
/* Mirrors driver-emitted multi-file concatenated streams. */
if (check_module_stamps(
"package foo;\nfn a() void = {};\n"
"package bar;\nfn b() void = {};\n",
"foo", "bar")) pass++;
else { fprintf(stderr, "738[4] mid-stream package switch FAILED\n"); fail++; }
/* Row 5: dotted import accepted with leaf stored on N_USE. */
if (parses_clean(
"package foo;\nimport encoding.utf8;\nfn x() void = {};\n")) pass++;
else { fprintf(stderr, "738[5] dotted import accept FAILED\n"); fail++; }
/* Row 6: dotted import stores only the leaf identifier on
* N_USE.str (post-task-#22 — the driver translates the full
* dotted path to a directory walk; the checker only needs the
* package bareword for n_use → decl disambiguation). */
/* Dotted import stores only the leaf identifier on N_USE.str
* (post-task-#22 — the driver translates the full dotted path to
* a directory walk; the checker only needs the package bareword
* for n_use → decl disambiguation). */
{
Arena *a = newarena();
Lex l;