Files
ww/test/wcc/data/r805_c3_composed_match/case.ww
Hojun-Cho f6628b985e test: migrate 24 residual carriers into the fixture corpus
Audit-driven migrate-and-retire wave (one read-only auditor per
carrier batch, verdicts row-checked through the full corpus gate):
every retired carrier's assertions are now owned by declarative
fixtures or an existing owner. 238 new fixtures land (corpus 1,239 ->
1,477; cells 2,954), covering enum/str/slice/tagged array elements,
inferred-length arrays, global slice/str zero-init and literals,
global array/pointer field reads and stores, struct-literal slice
fields, struct returns, float arithmetic, size/int limits, sort and
log-vstream behavior, place-addressed stores, and append places.
Rejection rows STRENGTHEN the old nonzero-exit checks to required
diagnostic fragments; all byte-id claims fold into the blanket
test-data-byteid sweep (now 1,142 compared, 0 pinned-divergent).
Four carriers were fully redundant with existing fixtures/lang tests
(749, 722, 765, and 771's byteid rows) and retire without new rows.
Native carriers 171 -> 147 (residual 135 -> 111).
2026-08-08 01:29:15 +09:00

51 lines
1.4 KiB
Plaintext

//ww:run-exit 68
package main;
type inst_lit = rune;
type inst_any = void;
type inst_match = bool;
type inst = (inst_lit | inst_any | inst_match);
type re_t = struct { insts: []inst, n_reps: size };
type capture = struct { content: str, start: size, end: size };
type thread = struct { pc: size, root_capture: capture, failed: bool };
fn step(re: *re_t, ts: *[]thread, i: size) i32 = {
match (re.insts[(*ts)[i].pc]) {
case let lt: inst_lit => {
(*ts)[i].root_capture = capture { content = "hit", start = 2, end = 4 };
(*ts)[i].pc += 1;
return 1;
};
case inst_any => {
(*ts)[i].failed = true;
return 2;
};
case let m: inst_match => {
(*ts)[i].pc += 2;
return 3;
};
};
return 9;
};
export fn main() i32 = {
let insts: []inst = [];
append(insts, ('a': inst_lit));
let av: inst_any;
let v: inst = av;
append(insts, v);
append(insts, (true: inst_match));
let re: re_t = re_t { insts = insts, n_reps = 0 };
let ts: []thread = [];
let z: capture = capture { content = "", start = 0, end = 0 };
append(ts, thread { pc = 0, root_capture = z, failed = false });
if (step(&re, &ts, 0) != 1) { return 1; };
if (ts[0].pc != 1) { return 2; };
if (ts[0].root_capture.start != 2) { return 3; };
if (step(&re, &ts, 0) != 2) { return 4; };
if (!ts[0].failed) { return 5; };
let p: *[]thread = &ts;
(*p)[0].pc += 1;
if (ts[0].pc != 2) { return 6; };
if (step(&re, &ts, 0) != 3) { return 7; };
if (ts[0].pc != 4) { return 8; };
return 68;
};