lib: collapse the parallel vstream scaffold onto the single Hare io surface (#94 fold-eFinal)

The Option-C parallel _v vstream API was scaffolding to bring the io stack up alongside the old surface; carrying both permanently is a rule-9 divergence from ref/hare, which has exactly one io surface. Collapse onto that surface (stream = *vtable, ref/hare/io/stream.ha) and rename the _v symbols to their Hare names (io vstream->stream, fmt vfprint->fprint, bufio/memio/log surfaces, log.new). Deletes the 4 lib/*/vstream.ww scaffold files; regenerates w6c/wwdump combined.ww. cstage and wwstage stay byte-identical and combined_ww_fresh holds; all 220 tests pass.
This commit is contained in:
2026-05-30 03:24:23 +09:00
parent 80184a3acf
commit 7d39f6d623
31 changed files with 2371 additions and 4834 deletions

View File

@@ -713,14 +713,13 @@ fn localfind(c: *cgen, name: str) i32 = {
// Re-init per fn would abandon the buffer (no [[io.close]] path → no
// [[os.free]]) and re-grow from 0 via the 8→…→65536 ladder for every
// function. Same idiom as lib/log/log.ww:124 `ensureinit`.
let cgoutstate: memio.state;
let cgoutstream: io.stream;
let cgoutstream: memio.stream;
let cgoutmode: i32 = 0;
let cgoutinit: i32 = 0;
fn cgout_enable() void = {
if (cgoutinit == 0) {
memio.dynamic(&cgoutstate, &cgoutstream);
cgoutstream = memio.dynamic();
cgoutinit = 1;
};
cgoutmode = 1;
@@ -729,9 +728,9 @@ fn cgout_enable() void = {
fn cgout_disable() void = { cgoutmode = 0; };
fn cgout_flush() void = {
if (cgoutstate.pos > 0) {
os.write(1, cgoutstate.ptr, cgoutstate.pos: u64);
memio.reset(&cgoutstate);
if (cgoutstream.pos > 0) {
os.write(1, cgoutstream.ptr, cgoutstream.pos: u64);
memio.reset(&cgoutstream);
};
};
@@ -740,9 +739,10 @@ fn emitbytes(p: *u8, n: u64) void = {
let buf: []u8;
buf.ptr = p;
buf.len = n: i32;
// memio.dynamicwrite never returns io.closed (memio.ww:166);
// bare-discard mirrors lib/log/log.ww:169 fmt.fprintln.
io.write(&cgoutstream, buf);
// io.write over the embedded vtable (&cgoutstream.vt = io.stream);
// memio.dynamicwrite never errors. Bare-discard mirrors
// lib/log/log.ww stdprintln. #94 fold-eFinal.
io.write(&cgoutstream.vt, buf);
} else {
os.write(1, p, n);
};