diff --git a/lib/strconv/decimal.ww b/lib/strconv/decimal.ww index a70babc9..c89fccf0 100644 --- a/lib/strconv/decimal.ww +++ b/lib/strconv/decimal.ww @@ -24,6 +24,13 @@ // → ww requires a `{}` block body throughout. // - Hare bare `assert(cond)` builtin → `os.assert(cond, msg)`; // wwstage cgen has no `assert` intercept (deferred fold). +// - In-file instances of the above hoist pattern: `i_sz` (line 93) +// hoists a per-iteration size cast out of a for-loop comparison +// (bullet 3 sub-case — the size-cast hoist applied inside a loop +// body, not just at function entry); `lowbit_lit` (line 242) +// decomposes Hare's `(nd > 0 && d.digits[nd - 1] & 1 != 0)` into +// a stepwise boolean local to dodge ww parser precedence on mixed +// `&` / `&&` / `!=` within a single expression. // // CGEN class closures consumed (post-prereqs): // - #131 (4acab6e) — `len(d.digits)` compile-time-folds cs==ww diff --git a/selfhost/cmd/w6c/main.combined.ww b/selfhost/cmd/w6c/main.combined.ww index b38703c8..4616c501 100644 --- a/selfhost/cmd/w6c/main.combined.ww +++ b/selfhost/cmd/w6c/main.combined.ww @@ -2730,6 +2730,13 @@ export fn rpad(s: str, p: rune, maxlen: i32) str = { // → ww requires a `{}` block body throughout. // - Hare bare `assert(cond)` builtin → `os.assert(cond, msg)`; // wwstage cgen has no `assert` intercept (deferred fold). +// - In-file instances of the above hoist pattern: `i_sz` (line 93) +// hoists a per-iteration size cast out of a for-loop comparison +// (bullet 3 sub-case — the size-cast hoist applied inside a loop +// body, not just at function entry); `lowbit_lit` (line 242) +// decomposes Hare's `(nd > 0 && d.digits[nd - 1] & 1 != 0)` into +// a stepwise boolean local to dodge ww parser precedence on mixed +// `&` / `&&` / `!=` within a single expression. // // CGEN class closures consumed (post-prereqs): // - #131 (4acab6e) — `len(d.digits)` compile-time-folds cs==ww diff --git a/selfhost/cmd/wwdump/main.combined.ww b/selfhost/cmd/wwdump/main.combined.ww index a5714279..42eced79 100644 --- a/selfhost/cmd/wwdump/main.combined.ww +++ b/selfhost/cmd/wwdump/main.combined.ww @@ -753,6 +753,13 @@ export fn exists(path: str) bool = { // → ww requires a `{}` block body throughout. // - Hare bare `assert(cond)` builtin → `os.assert(cond, msg)`; // wwstage cgen has no `assert` intercept (deferred fold). +// - In-file instances of the above hoist pattern: `i_sz` (line 93) +// hoists a per-iteration size cast out of a for-loop comparison +// (bullet 3 sub-case — the size-cast hoist applied inside a loop +// body, not just at function entry); `lowbit_lit` (line 242) +// decomposes Hare's `(nd > 0 && d.digits[nd - 1] & 1 != 0)` into +// a stepwise boolean local to dodge ww parser precedence on mixed +// `&` / `&&` / `!=` within a single expression. // // CGEN class closures consumed (post-prereqs): // - #131 (4acab6e) — `len(d.digits)` compile-time-folds cs==ww diff --git a/selfhost/test/smoke.combined.ww b/selfhost/test/smoke.combined.ww index 3c8763e6..ed340db3 100644 --- a/selfhost/test/smoke.combined.ww +++ b/selfhost/test/smoke.combined.ww @@ -753,6 +753,13 @@ export fn exists(path: str) bool = { // → ww requires a `{}` block body throughout. // - Hare bare `assert(cond)` builtin → `os.assert(cond, msg)`; // wwstage cgen has no `assert` intercept (deferred fold). +// - In-file instances of the above hoist pattern: `i_sz` (line 93) +// hoists a per-iteration size cast out of a for-loop comparison +// (bullet 3 sub-case — the size-cast hoist applied inside a loop +// body, not just at function entry); `lowbit_lit` (line 242) +// decomposes Hare's `(nd > 0 && d.digits[nd - 1] & 1 != 0)` into +// a stepwise boolean local to dodge ww parser precedence on mixed +// `&` / `&&` / `!=` within a single expression. // // CGEN class closures consumed (post-prereqs): // - #131 (4acab6e) — `len(d.digits)` compile-time-folds cs==ww