add defer

This commit is contained in:
2026-06-27 03:36:47 +02:00
parent 81ae939bf0
commit b4ce2c2117
8 changed files with 375 additions and 13 deletions
+5
View File
@@ -131,6 +131,8 @@ Stmt_Kind :: enum u8 {
For,
Break,
Continue,
Block,
Defer,
}
Assignment_Op :: enum u8 {
@@ -165,6 +167,9 @@ Stmt :: struct {
// `For` statements use `expr` as the iterable, `name` as the item capture,
// `index_name` as the optional index capture, and `pointer_capture` to
// distinguish `|@item|` from copy capture.
// `Block` statements (a bare `{ ... }` scope) use `body` as their statements.
// `Defer` statements use `update` as the deferred statement (which may itself
// be a `Block`).
captures: []symbol.Id,
guard: Expr_Id,
body: []Stmt_Id,