bufio: make scanning bounded and incremental

This commit is contained in:
2026-08-09 18:17:42 +09:00
parent 09b6f22e85
commit a04de3e02b
7 changed files with 362 additions and 139 deletions

View File

@@ -5,6 +5,7 @@
package bufio_test;
import bufio;
import errors;
import io;
import memio;
@@ -415,7 +416,7 @@ fn checkpartialflush(zero: bool) void = {
let sbuf: [32]u8;
let sc: bufio.scanner = bufio.newscannerbuf(p, sbuf[0:32]);
let lr: (str | io.eof | io.error | bufio.overflow) = bufio.scanline(&sc);
let lr: (str | io.eof | io.error | errors.overflow) = bufio.scanline(&sc);
match (lr) {
case let v: str => {
assert(!(v.len != 8)); // "XYZhello"
@@ -424,7 +425,7 @@ fn checkpartialflush(zero: bool) void = {
};
case io.eof => abort();
case let e: io.error => abort();
case bufio.overflow => abort();
case errors.overflow => abort();
};
bufio.finish(&sc);
};