error handling kickoff

This commit is contained in:
2026-06-29 22:55:56 +02:00
parent 98c303d22c
commit ae5af37b85
14 changed files with 1229 additions and 173 deletions
+5
View File
@@ -99,6 +99,8 @@ Expr_Kind :: enum u8 {
Or,
Range,
Call,
Try,
Catch,
}
Expr :: struct {
@@ -109,6 +111,7 @@ Expr :: struct {
name: symbol.Id,
left: Expr_Id,
right: Expr_Id,
body: []Stmt_Id,
diagnostic: source.Diagnostic_Id,
parenthesized: bool,
kind: Expr_Kind,
@@ -204,6 +207,7 @@ Function :: struct {
variadic: bool,
params: []Param,
result: Type_Syntax,
error: Type_Syntax,
body: []Stmt_Id,
link_name: string,
unsupported_reason: string,
@@ -304,6 +308,7 @@ init_module :: proc(allocator := context.allocator) -> Module {
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.captures, module.allocator)