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:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user