# Zir: split up start and end of range in \`for_len\` · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b4da8eef2a393543e9520c544364689ab482b080)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b4da8eef2a393543e9520c544364689ab482b080

Requested commit: b4da8eef2a393543e9520c544364689ab482b080

Commit: b4da8eef2a393543e9520c544364689ab482b080

Tree: 3c21ba65a2bcb5eb3d970868d6d8b08e3757a073

Author: mlugg

Committer: Matthew Lugg

## Message

```
Zir: split up start and end of range in `for_len`

The old lowering was kind of neat, but it unintentionally allowed the
syntax `for (123) |_| { ... }`, and there wasn't really a way to fix
that. So, instead, we include both the start and the end of the range in
the `for_len` instruction (each operand to `for` now has *two* entries
in this multi-op instruction). This slightly increases the size of ZIR
for loops of predominantly indexables, but the difference is small
enough that it's not worth complicating ZIR to try and fix it.

```

## Parents

- [252c2031011f80b35d01d5ba5a2a2577c870f90c](https://git.cafe/gitcafe/zig/commit/252c2031011f80b35d01d5ba5a2a2577c870f90c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b4da8eef2a393543e9520c544364689ab482b080?format=markdown)
