lib: drop non-Hare extras (ascii.digitval, bytes.copy, fmt.errpos)

ascii.digitval/isidstart/isidpart are lexer-private, not Hare-stdlib.
Moved into lib/ww/lex/lex.ww as fn (renamed digitval to hexval since
its sole job is the \\xHH escape decoder).

bytes.copy and fmt.errpos have no Hare counterpart and no external
callers; gone.
This commit is contained in:
2026-05-13 03:24:33 +09:00
parent f4743dc5d5
commit 9bc973dc96
8 changed files with 110 additions and 169 deletions

View File

@@ -21,17 +21,6 @@ export fn indexbyte(s: []u8, c: u8) (i32 | void) = {
return;
};
export fn copy(dst: []u8, src: []u8) i32 = {
let n: i32 = dst.len;
if (src.len < n) { n = src.len; };
let i: i32 = 0;
for (i < n) {
dst[i] = src[i];
i += 1;
};
return n;
};
// index — first index of `sub` in `s`. Mirrors Hare's bytes::index
// (the []u8 needle variant; the u8 needle stays as indexbyte until we
// have union-arg dispatch). Empty `sub` matches at 0.