lib/ww + wcc + w6c + wwdump: strip *arena cascade (γ-6)
amalloc has 0 callers post-γ-2; the *arena threaded through
newnode/newscope/newtype/prim/typesinit/type{ptr,slice,array,chan,
named}/lexinit/parserinit/joindotted/checkinit/arenau64tos/cgeninit
and the scope.a / tctx.a / lex.a / parser.a / checker.a / cgen.a
fields are vestigial.
Drop `import mem;` from 15 files, remove six struct fields, strip
*arena from 14 signatures, update ~120 call sites across lib/ww +
wcc + w6c + wwdump. selfhost/test/sym_link.ww fixture drops the
newarena/freearena probe; still exits 42 on scopedefine/scopelookup.
Both main.combined.ww auto-regenerated.
Comments retidied: typ.ww "once per arena" → "once per program";
parse.ww drops "arena-build" qualifier on joindotted; sym.ww drops
mem-sibling-imports rationale.
Verified 132/132 incl. 994_w6c_ww + 995_self_rebuild byte-identity
(the primary symmetric-stages gate).
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,6 @@
|
||||
package main;
|
||||
|
||||
import os;
|
||||
import mem;
|
||||
import tok;
|
||||
import lex;
|
||||
import ast;
|
||||
@@ -99,7 +98,6 @@ export fn main(argc: i32, argv: **u8) i32 = {
|
||||
};
|
||||
};
|
||||
|
||||
let a: *arena = newarena();
|
||||
let buf: []u8 = alloc([], sz: u64)!;
|
||||
buf.len = sz: i32;
|
||||
let rr: (i64 | os.oserror) = os.readall(fd, buf.ptr, sz: u64);
|
||||
@@ -118,7 +116,7 @@ export fn main(argc: i32, argv: **u8) i32 = {
|
||||
};
|
||||
|
||||
let l: lex;
|
||||
lexinit(&l, a, argstr(path), buf.ptr, sz: u64);
|
||||
lexinit(&l, argstr(path), buf.ptr, sz: u64);
|
||||
|
||||
if (mode == 116) { // '-t'
|
||||
for (true) {
|
||||
@@ -130,17 +128,17 @@ export fn main(argc: i32, argv: **u8) i32 = {
|
||||
};
|
||||
} else { if (mode == 97) { // '-a'
|
||||
let ps: parser;
|
||||
parserinit(&ps, a, &l);
|
||||
parserinit(&ps, &l);
|
||||
let f: *node = parsefile(&ps);
|
||||
astprint(1i32, f);
|
||||
} else { if (mode == 114) { // '-r' — name resolve report
|
||||
let ps: parser;
|
||||
parserinit(&ps, a, &l);
|
||||
parserinit(&ps, &l);
|
||||
let f: *node = parsefile(&ps);
|
||||
let tc: tctx;
|
||||
typesinit(&tc, a);
|
||||
typesinit(&tc);
|
||||
let ck: checker;
|
||||
checkinit(&ck, a, &tc);
|
||||
checkinit(&ck, &tc);
|
||||
// Quiet by default; flip to 1 when debugging missing names.
|
||||
ck.verbose = 0;
|
||||
checkfile(&ck, f);
|
||||
@@ -158,7 +156,7 @@ export fn main(argc: i32, argv: **u8) i32 = {
|
||||
if (ck.nunresolved > 0) { return 1; };
|
||||
} else { if (mode == 99) { // '-c' — codegen / emit asm
|
||||
let ps: parser;
|
||||
parserinit(&ps, a, &l);
|
||||
parserinit(&ps, &l);
|
||||
let f: *node = parsefile(&ps);
|
||||
// #50: mirror w6c — run check before cgen so AST mutations
|
||||
// from #42 (size/align/offset fold) and audit §1.8 (node.type_
|
||||
@@ -166,13 +164,13 @@ export fn main(argc: i32, argv: **u8) i32 = {
|
||||
// (the byte-identity probe for 994) would diverge from w6c_ww
|
||||
// on any program that uses the size/align/offset typed builtins.
|
||||
let tc: tctx;
|
||||
typesinit(&tc, a);
|
||||
typesinit(&tc);
|
||||
let ck: checker;
|
||||
checkinit(&ck, a, &tc);
|
||||
checkinit(&ck, &tc);
|
||||
checkfile(&ck, f);
|
||||
if (ck.errs > 0) { return 1; };
|
||||
let cg: cgen;
|
||||
cgeninit(&cg, a);
|
||||
cgeninit(&cg);
|
||||
cgfile(&cg, f);
|
||||
};};};};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user