test: banner purge + WHY-only comment sweep (rule 8)
Every section banner dies (103 -> 0) across test/lang, the observer suites, the C carriers, and the five comment-heavy corpus fixtures; banner provenance (#N cites, carrier numbers, repair-cluster labels) folded into headers or adjacent WHY comments. Narration deleted; row provenance, ref cites, divergence pins, and layout contracts kept (fwd-ref decl-order guards and bootstrap-gate corpus rationale restored where the sweep over-cut). Comment-only proven: all 3742 wwbuild workdir .s byte-identical before/after; test-commit and test-byteid (161 lang + 1399 data, 0 pinned-divergent) green.
This commit is contained in:
@@ -24,8 +24,6 @@ import os;
|
||||
import strconv;
|
||||
import ascii;
|
||||
|
||||
// --- bump arena ---------------------------------------------------------
|
||||
|
||||
type arena = struct {
|
||||
buf: *u8,
|
||||
off: u64,
|
||||
@@ -49,18 +47,14 @@ fn arena_alloc(a: *arena, n: u64) *u8 = {
|
||||
return p;
|
||||
};
|
||||
|
||||
// --- (i32 | str) error idiom -------------------------------------------
|
||||
|
||||
fn checked_div(num: i32, den: i32) (i32 | str) = {
|
||||
if (den == 0) { return "div by zero"; };
|
||||
return num / den;
|
||||
};
|
||||
|
||||
// --- struct-of-fn-pointer polymorphism ---------------------------------
|
||||
//
|
||||
// A trivial "writer" abstraction: a function pointer plus a context.
|
||||
// This mirrors how io.stream / Plan 9 Bio work. The ctx pointer lets
|
||||
// the implementation own its own state without a global.
|
||||
// A "writer" is a function pointer plus a context, mirroring how
|
||||
// io.stream / Plan 9 Bio work. The ctx pointer lets the implementation
|
||||
// own its own state without a global.
|
||||
|
||||
type counter = struct {
|
||||
n: i32,
|
||||
@@ -76,22 +70,19 @@ fn count_emit(ctx: *void, b: u8) void = {
|
||||
c.n += 1;
|
||||
};
|
||||
|
||||
// --- size/align/offset typed-builtin fixtures (#42) --------------------
|
||||
|
||||
type point = struct {
|
||||
x: i32,
|
||||
y: i32,
|
||||
};
|
||||
|
||||
// Mixed-alignment struct: i8 lays at 0, then i64 needs to skip to
|
||||
// offset 8 (the i64's natural align). Probe asserts both ends.
|
||||
// #42 size/align/offset typed-builtin fixture. Mixed-alignment struct:
|
||||
// i8 lays at 0, then i64 needs to skip to offset 8 (the i64's natural
|
||||
// align). Probe asserts both ends.
|
||||
type mixalign = struct {
|
||||
tag: i8,
|
||||
val: i64,
|
||||
};
|
||||
|
||||
// --- byte scanner like lex.ww's hot path -------------------------------
|
||||
|
||||
fn count_digits(s: str) i32 = {
|
||||
let i: i32 = 0;
|
||||
let n: i32 = 0;
|
||||
@@ -105,8 +96,6 @@ fn count_digits(s: str) i32 = {
|
||||
return n;
|
||||
};
|
||||
|
||||
// --- entry --------------------------------------------------------------
|
||||
|
||||
export fn main() i32 = {
|
||||
// Probe 1 — arena hands out distinct pointers, refuses oversize.
|
||||
let buf: [256]u8;
|
||||
|
||||
Reference in New Issue
Block a user