conditionally unwrapping while loops

This commit is contained in:
2026-08-11 18:33:54 +02:00
parent ba6052eef3
commit fa53ca2219
8 changed files with 486 additions and 307 deletions
+6 -6
View File
@@ -229,12 +229,12 @@ Stmt :: struct {
// by computing the target address once, loading its current value, applying
// the operation to `expr`, and storing through the original address.
assignment_op: Assignment_Op,
// Boolean `If` statements use `expr` as the condition. Conditional unwraps
// use `unwraps` for the ordered optional expressions and capture locals, and
// `guard` for the optional boolean checked after every unwrap succeeds.
// Both forms use `then_body`/`else_body` as the branch statement lists.
// `While` statements use `expr` as the condition, `then_body` as the loop
// body, and `update` as the optional post-iteration statement.
// Boolean `If` and `While` statements use `expr` as the condition.
// Conditional unwraps use `unwraps` for the ordered optional expressions
// and capture locals, and `guard` for the optional boolean checked after
// every unwrap succeeds. `If` uses `then_body`/`else_body` as its branches.
// `While` uses `then_body` as its loop body and `update` as the optional
// post-iteration statement.
// `For` statements use `expr` as the iterable, `local` as the item capture,
// `index_local` as the optional sequence index, and `iterator_type` as the
// normalized many-item pointer type for sequence iteration.