lib: banner purge + WHY-only comment sweep (rule 8)
Every // ---- section banner dies (132 -> 0): names carry the WHAT. Narration deleted (filename restatements, run-with lines, what-the- next-line-does); every ref/hare cite, task cite, divergence, ABI/ layout contract, and ownership qualifier kept (borrowed-view lines restored where the sweep over-cut). Comment-only proven: all 442 walk-workdir .s and 32 import-probe .s byte-identical before/after; libbyteid 56-roster all-ID.
This commit is contained in:
@@ -1,23 +1,6 @@
|
||||
// fmt — formatting writers. Mirrors Hare's lib/fmt subset. Project #94
|
||||
// fold-eFinal; io fold-2 (#5) graduated the sink to [[io.handle]].
|
||||
//
|
||||
// fprint / fprintln / fprintf / fprintfln
|
||||
// write to an [[io.handle]] (= `(io.file |
|
||||
// io.stream)`) — Hare's primary surface
|
||||
// (ref/hare/fmt/print.ha:13). Errors via
|
||||
// [[io.error]]. A file handle (raw fd) and a stream
|
||||
// (`*io.vtable`) both flow in; [[io.write]]
|
||||
// dispatches per arm.
|
||||
//
|
||||
// The process-stdio wrappers (print/println/errorln/printf/printfln/
|
||||
// errorfln/fatal/fatalf) route through the fprint family over a file
|
||||
// handle built from os.STD{OUT,ERR}_FILENO. The #5 handle convergence
|
||||
// retired the prior `fd_ctx` shim — the fake-stream vtable around
|
||||
// os.write that stood in before io.write took a handle.
|
||||
//
|
||||
// Call sites take Hare's variadic shape: `fmt.println(42, "hi", true)`
|
||||
// gathers the args into a `[]formattable` slice; wrappers forward via
|
||||
// `args...`.
|
||||
// fmt — formatting writers. Mirrors Hare's lib/fmt subset (primary
|
||||
// surface ref/hare/fmt/print.ha:13). Project #94 fold-eFinal; io
|
||||
// fold-2 (#5) graduated the sink to [[io.handle]].
|
||||
|
||||
package fmt;
|
||||
|
||||
@@ -90,11 +73,6 @@ fn i64dec(v: i64) str = {
|
||||
// construction — both stages now accept bare int by MEMBERSHIP.
|
||||
export type formattable = (i64 | str | bool | rune | f64 | int | uint);
|
||||
|
||||
// ---- internal stream formatters --------------------------------------
|
||||
|
||||
// putbytes — io.write(s, [ptr..ptr+n)). Internal helper; the inline
|
||||
// `let v` slice synthesis composes the (ptr, len) triple each
|
||||
// formattable arm carries.
|
||||
fn putbytes(s: io.handle, p: *u8, n: i32) (size | io.error) = {
|
||||
let v: []u8;
|
||||
v.ptr = p;
|
||||
@@ -102,7 +80,6 @@ fn putbytes(s: io.handle, p: *u8, n: i32) (size | io.error) = {
|
||||
return io.write(s, v);
|
||||
};
|
||||
|
||||
// writeone — emit one formattable through io.write.
|
||||
fn writeone(s: io.handle, a: formattable) (size | io.error) = {
|
||||
match (a) {
|
||||
case let n: i64 => {
|
||||
@@ -145,8 +122,6 @@ fn writeone(s: io.handle, a: formattable) (size | io.error) = {
|
||||
return 0: size;
|
||||
};
|
||||
|
||||
// ---- {n}-placeholder parser -----------------------------------------
|
||||
//
|
||||
// Mirrors ref/hare/fmt/{iter,print,wrappers}.ha. Format sequences:
|
||||
//
|
||||
// {} implicit-positional next arg
|
||||
@@ -636,8 +611,6 @@ fn formatfield(s: io.handle, f: field, m: *mods) (size | io.error) = {
|
||||
};
|
||||
};
|
||||
|
||||
// ---- stream sinks ----------------------------------------------------
|
||||
|
||||
// fprint — write the formatted form of each `args` element to `s`,
|
||||
// separated by spaces. Returns total bytes written or the first
|
||||
// io.error. Mirrors ref/hare/fmt/print.ha (fprint) + wrappers.ha.
|
||||
@@ -818,9 +791,7 @@ export fn asprintf(fmt: str, args: field...) str = {
|
||||
return strings.frombytes(tight);
|
||||
};
|
||||
|
||||
// ---- process-stdio wrappers -----------------------------------------
|
||||
//
|
||||
// Mirror ref/hare/fmt/wrappers.ha. Hare routes these through
|
||||
// Mirror ref/hare/fmt/wrappers.ha. Hare routes the stdio wrappers through
|
||||
// os::stdout / os::stderr (io::handle); ww's os plays the sys role and
|
||||
// can't import io (import floor), so it exports the std fd NUMBERS
|
||||
// (os.STD{OUT,ERR}_FILENO) and the io.file binding is cast at the call
|
||||
|
||||
Reference in New Issue
Block a user