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

@@ -58,19 +58,3 @@ export fn fprintint(fd: i32, v: i64) void = {
os.write(fd, buf.ptr, n: u64);
};
// errpos — write "<file>:<line>:<col>: <msg>\n" to fd 2. The shape
// every compiler diagnostic uses; centralised so the format stays
// consistent across phases.
export fn errpos(file: str, line: i32, col: i32, msg: str) void = {
os.write(2, file.ptr, file.len: u64);
os.write(2, ":".ptr, 1u64);
let buf: [32]u8;
let n: i32 = strconv.i64tos(buf[0:32], line: i64);
os.write(2, buf.ptr, n: u64);
os.write(2, ":".ptr, 1u64);
n = strconv.i64tos(buf[0:32], col: i64);
os.write(2, buf.ptr, n: u64);
os.write(2, ": ".ptr, 2u64);
os.write(2, msg.ptr, msg.len: u64);
os.write(2, "\n".ptr, 1u64);
};