comptime expandable match statements

This commit is contained in:
2026-07-17 14:29:50 +02:00
parent 1f25e6cd1d
commit 97f1c06057
22 changed files with 120821 additions and 119318 deletions
+3 -2
View File
@@ -180,7 +180,7 @@ Stmt :: struct {
immutable: bool,
value_control_flow: bool,
pointer_capture: bool,
inline: bool,
expand: bool,
error_only: bool,
// Assignments store the lvalue in `target`, the right-hand side in `expr`,
// and the source operator in `assignment_op`. `Set` is ordinary `=`;
@@ -207,7 +207,8 @@ Stmt :: struct {
// list (empty marks the `else` arm; more than one is a multi-pattern arm),
// `captures` for the optional payload capture (0 or 1 name, tagged-union variants
// only) with `pointer_capture` distinguishing `|@cap|` from `|cap|`, and `body`
// as the arm body.
// as the arm body. An expanded arm has `expand` set, no patterns, and one or two
// captures for its specialized value/payload and optional tagged-union tag.
captures: []symbol.Id,
// `Match_Arm` pattern list; empty ⇒ the `else` arm.
patterns: []Expr_Id,