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:
@@ -1372,32 +1372,30 @@ static const struct row rows[] = {
|
||||
" raw[0] = 102u8; raw[1] = 111u8; raw[2] = 111u8; raw[3] = 10u8;\n"
|
||||
" raw[4] = 98u8; raw[5] = 97u8; raw[6] = 114u8; raw[7] = 10u8;\n"
|
||||
" raw[8] = 98u8; raw[9] = 97u8; raw[10] = 122u8;\n"
|
||||
" let mem: memio.state;\n"
|
||||
" let m: io.stream;\n"
|
||||
" memio.fixed(&mem, &m, raw[0:11]);\n"
|
||||
" let mst: memio.stream = memio.fixed(raw[0:11]);\n"
|
||||
" let m: io.stream = &mst.vt;\n"
|
||||
" let buf: [16]u8;\n"
|
||||
" let sc: bufio.scanner;\n"
|
||||
" bufio.newscanner(&sc, &m, buf[0:16]);\n"
|
||||
" let sc: bufio.scanner = bufio.newscannerbuf(m, buf[0:16]);\n"
|
||||
" let acc: i32 = 0;\n"
|
||||
" let l1: (str | io.eof | io.closed | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" let l1: (str | io.eof | io.error | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" match (l1) {\n"
|
||||
" case let s: str => acc += s.len;\n"
|
||||
" case io.eof => acc += -100;\n"
|
||||
" case io.closed => acc += -1000;\n"
|
||||
" case let _e: io.error => acc += -1000;\n"
|
||||
" case bufio.overflow => acc += -10000;\n"
|
||||
" };\n"
|
||||
" let l2: (str | io.eof | io.closed | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" let l2: (str | io.eof | io.error | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" match (l2) {\n"
|
||||
" case let s: str => acc += s.len;\n"
|
||||
" case io.eof => acc += -100;\n"
|
||||
" case io.closed => acc += -1000;\n"
|
||||
" case let _e: io.error => acc += -1000;\n"
|
||||
" case bufio.overflow => acc += -10000;\n"
|
||||
" };\n"
|
||||
" let l3: (str | io.eof | io.closed | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" let l3: (str | io.eof | io.error | bufio.overflow) = bufio.scanline(&sc);\n"
|
||||
" match (l3) {\n"
|
||||
" case let s: str => acc += -100;\n"
|
||||
" case io.eof => acc += 7;\n"
|
||||
" case io.closed => acc += -1000;\n"
|
||||
" case let _e: io.error => acc += -1000;\n"
|
||||
" case bufio.overflow => acc += -10000;\n"
|
||||
" };\n"
|
||||
" return acc;\n"
|
||||
@@ -1715,11 +1713,16 @@ static const struct row rows[] = {
|
||||
* mixed-type args at the call site. End-to-end exercises the
|
||||
* lib/fmt graduation: the wrapper-chain `println → fdprintln →
|
||||
* fdprint` is itself variadic-forwarding, so this validates both
|
||||
* gather (at main) and `args...` forward (inside lib/fmt). The
|
||||
* exit code is bytes printed (`hello 7\n` = 8). */
|
||||
* gather (at main) and `args...` forward (inside lib/fmt). println
|
||||
* returns Hare's `(size | io.error)` (#94 fold-eFinal); the size
|
||||
* arm carries bytes printed (`hello 7\n` = 8). */
|
||||
{ "import fmt;\n"
|
||||
"import io;\n"
|
||||
"fn main() i32 = {\n"
|
||||
" return fmt.println(\"hello\", 7i64): i32;\n"
|
||||
" match (fmt.println(\"hello\", 7i64)) {\n"
|
||||
" case let n: size => return n: i32;\n"
|
||||
" case let _e: io.error => return -1;\n"
|
||||
" };\n"
|
||||
"};", 8 },
|
||||
/* short-circuit `&&`: RHS skipped when LHS is false. Without
|
||||
* short-circuit the `p.x` deref on a nil pointer segfaults.
|
||||
|
||||
Reference in New Issue
Block a user