fallible ergonomics

This commit is contained in:
2026-06-30 20:32:13 +02:00
parent 07c560b750
commit 7ca7e33033
8 changed files with 289 additions and 25 deletions
+4
View File
@@ -129,6 +129,9 @@ Expr :: struct {
type: types.Type,
integer: i64,
args: []Expr_Id,
// `Catch` block handlers use `body` for the handler statements and `target`
// for the optional captured error local.
body: []Stmt_Id,
target: Ref,
left: Expr_Id,
right: Expr_Id,
@@ -269,6 +272,7 @@ init_module :: proc(selected := target.DEFAULT, allocator := context.allocator)
destroy_module :: proc(module: ^Module) {
for expr in module.exprs {
delete(expr.args, module.allocator)
delete(expr.body, module.allocator)
}
for statement in module.statements {
delete(statement.unwraps, module.allocator)