lib/fnmatch: explicit '\\': u8 cast; fnmatch graduates to the byte-id gate

wwstage over-rejects harec's flexible-rune-const narrow (rune lit
promotes into any int whose range fits — harec check.c:1910,
types.c promote_flexible); explicit cast until that promotion lands
in ww (#29, revert to bare '\\' then). With the enum-as fix fnmatch
is byte-identical across stages: 989 #59.14 graduates
M_WWREJECT -> M_ID, transferring 972's cstage 8/8 behavior to the
provably-identical wwstage binary — the dark-regression gate. (#29)
This commit is contained in:
2026-06-11 02:37:40 +09:00
parent 00b9933ee0
commit 14b33993c2
2 changed files with 7 additions and 2 deletions

View File

@@ -123,7 +123,8 @@ fn pat_next(pat: str, pos: *i32, fl: flag) (u8 | star | question | bracket | end
*pos += 1;
return c2;
};
return '\\';
// #29: wwstage over-rejects the implicit flexible-rune-const narrow (harec promote_flexible accepts); explicit cast until flexible-const promotion lands — revert to bare '\\' then.
return '\\': u8;
};
return c;
};

View File

@@ -154,8 +154,12 @@ static const struct ent ents[] = {
/* -------- wwstage front-end gaps (task #59) -------------- */
{ .fixture = "lib/crypto/sha256/sha256_test.ww",
.mode = M_WWREJECT, .cite = "#59.13" },
/* #59.14 graduated to M_ID by #27: the #27b enum-as-int cgen fix
* (value passthrough, not a tagged assertion) + the fnmatch.ww:126
* `'\\': u8` explicit cast (the rune-lit→u8 narrow w6c_ww rejects at
* a checked position) make w6c_ww compile fnmatch byte-identically. */
{ .fixture = "lib/fnmatch/fnmatchtest.ww",
.mode = M_WWREJECT, .cite = "#59.14" },
.mode = M_ID, .cite = "#59.14 graduated by #27" },
/* #59.15 shlex graduated to M_ID by B-full Layer 1 (#14 nominal
* typeeqast): the cross-module bare-vs-qualified variant forward
* w6c_ww over-rejected now compiles byte-identically. */