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

@@ -1347,21 +1347,21 @@ fn nextline(a: *asm_) (*u8, u64) = {
else { a.pos += 1u64; continue; };
// hit newline
let n: u64 = a.pos - start;
let buf: *u8 = amalloc(a.a, n + 1u64): *u8;
let buf: []u8 = alloc([], n + 1u64)!;
let i: u64 = 0u64;
for (i < n) { buf[i] = a.src[start + i]; i += 1u64; };
buf[n] = 0u8;
a.pos += 1u64; // skip newline
return buf, n;
return buf.ptr, n;
};
// EOF without trailing newline
let n: u64 = a.pos - start;
if (n == 0u64) { return nil, 0u64; };
let buf: *u8 = amalloc(a.a, n + 1u64): *u8;
let buf: []u8 = alloc([], n + 1u64)!;
let i: u64 = 0u64;
for (i < n) { buf[i] = a.src[start + i]; i += 1u64; };
buf[n] = 0u8;
return buf, n;
return buf.ptr, n;
};
fn skipws(p: *u8, off: u64, n: u64) u64 = {

View File

@@ -195,21 +195,21 @@ fn nextline(a: *asm_) (*u8, u64) = {
else { a.pos += 1u64; continue; };
// hit newline
let n: u64 = a.pos - start;
let buf: *u8 = amalloc(a.a, n + 1u64): *u8;
let buf: []u8 = alloc([], n + 1u64)!;
let i: u64 = 0u64;
for (i < n) { buf[i] = a.src[start + i]; i += 1u64; };
buf[n] = 0u8;
a.pos += 1u64; // skip newline
return buf, n;
return buf.ptr, n;
};
// EOF without trailing newline
let n: u64 = a.pos - start;
if (n == 0u64) { return nil, 0u64; };
let buf: *u8 = amalloc(a.a, n + 1u64): *u8;
let buf: []u8 = alloc([], n + 1u64)!;
let i: u64 = 0u64;
for (i < n) { buf[i] = a.src[start + i]; i += 1u64; };
buf[n] = 0u8;
return buf, n;
return buf.ptr, n;
};
fn skipws(p: *u8, off: u64, n: u64) u64 = {