while loops

This commit is contained in:
2026-06-21 23:26:11 +02:00
parent f4194492cc
commit 380b5943b3
12 changed files with 548 additions and 16 deletions
+4
View File
@@ -141,6 +141,7 @@ Stmt_Kind :: enum u8 {
Sink,
Trap,
If,
While,
}
Stmt :: struct {
@@ -151,8 +152,11 @@ Stmt :: struct {
expr: Expr_Id,
// `If` statements use `expr` as the condition and `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.
then_body: []Stmt_Id,
else_body: []Stmt_Id,
update: Stmt_Id,
diagnostic: source.Diagnostic_Id,
}