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
@@ -120,6 +120,7 @@ Stmt_Kind :: enum u8 {
Return,
Expression,
If,
While,
}
Stmt :: struct {
@@ -133,8 +134,11 @@ Stmt :: struct {
// `If` statements use `expr` as the condition, `body` as the then-block, and
// `else_body` as the else-block. An `else if` chain is represented as an
// `else_body` holding a single nested `If` statement.
// `While` statements use `expr` as the condition, `body` as the loop body,
// and `update` as the optional post-iteration statement.
body: []Stmt_Id,
else_body: []Stmt_Id,
update: Stmt_Id,
diagnostic: source.Diagnostic_Id,
}