selfhost/cmd/w6a/parse + lib/ww/lex: amalloc → alloc([], N)! (α-8)

Phase 0 #8 eighth α-batch. 3 sites:
 - w6a/parse.ww:198 nextline newline-hit branch
 - w6a/parse.ww:208 nextline EOF-no-newline branch
 - lib/ww/lex/lex.ww:457 float underscore-strip buffer

All α: alloc([], n+1)! + p[k] indexing + .ptr at the consumer
(`return buf.ptr, n` for parse; `parsef64(clean.ptr, j)` for lex).
No struct-field shape change, no escape.

Verified 132/132 + 995_self_rebuild byte-identity.
This commit is contained in:
2026-05-21 03:14:04 +09:00
parent 4972ab4a5c
commit 4f4504d10a
5 changed files with 14 additions and 14 deletions

View File

@@ -454,7 +454,7 @@ fn lexnum(l: *lex, start: *pos, out: *tok) void = {
// Strip underscores from the digits (Hare allows 1_000.5)
// before parsing — match what cmd/wcc/lex.c does with
// strtod over a cleaned buffer.
let clean: *u8 = amalloc(l.a, n + 1u64): *u8;
let clean: []u8 = alloc([], n + 1u64)!;
let i: u64 = 0u64;
let j: u64 = 0u64;
for (i < n) {
@@ -466,7 +466,7 @@ fn lexnum(l: *lex, start: *pos, out: *tok) void = {
i += 1u64;
};
clean[j] = 0u8;
let fv: f64 = parsef64(clean, j);
let fv: f64 = parsef64(clean.ptr, j);
out.fval = fv;
// Stash the IEEE bits in uval — cgen consumers read floats
// as integers (n.uval) to avoid an SSE round-trip when