Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Last updated: 2026-08-08

## gen-zig: for-range start expression, not the loop variable (Closes #1942)

- `for i in 0..10` emitted `for (i..10) |i|` -- gen_for_range_stmt wrote the loop VARIABLE where the range start belongs; now emits children[0]
- Surfaced by the tri-net testbench transcription (first real for-range uses in the zig corpus)
- FROZEN_HASH resealed

## parser: silent statement drop is DEAD -- malformed input hard-errors (Closes #1940)

- Statement-level and module-level "recovery" silently DROPPED malformed statements/declarations (fn bodies became unimplemented stubs, whole fns vanished); every drop site now returns a hard parse error with fn name + line
Expand Down
9 changes: 7 additions & 2 deletions bootstrap/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4176,11 +4176,16 @@ impl Codegen {

fn gen_for_range_stmt(&mut self, node: &Node) {
self.write_indent();
self.write(&format!("for ({}..", node.name));
// children[0] is the range START expression; the old emitter wrote
// the LOOP VARIABLE there (`for (i..10) |i|`) -- an undeclared
// identifier in Zig for any range not starting at the variable name.
self.write("for (");
if node.children.len() >= 2 {
self.gen_expr(&node.children[0]);
self.write("..");
self.gen_expr(&node.children[1]);
self.write(") |");
self.write(&node.name);
self.write(&Self::zig_ident(&node.name));
self.write("|");
}
self.write_line(" {");
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/stage0/FROZEN_HASH
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4d10feb127277a49d610a3f22fd8350466dd7460a6ee4a831b872b6f60e5da25
d61af1df5f2b75cc5fb3ff91e4e0289c093b4c1fd1b46f7483c082c7393760b2
6 changes: 6 additions & 0 deletions docs/NOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Last updated: 2026-08-08

## gen-zig: for-range start expression, not the loop variable (Closes #1942)

- `for i in 0..10` emitted `for (i..10) |i|` -- gen_for_range_stmt wrote the loop VARIABLE where the range start belongs; now emits children[0]
- Surfaced by the tri-net testbench transcription (first real for-range uses in the zig corpus)
- FROZEN_HASH resealed

## parser: silent statement drop is DEAD -- malformed input hard-errors (Closes #1940)

- Statement-level and module-level "recovery" silently DROPPED malformed statements/declarations (fn bodies became unimplemented stubs, whole fns vanished); every drop site now returns a hard parse error with fn name + line
Expand Down
Loading