Add value-returning match expressions

This commit is contained in:
pavel 2026-08-27 17:56:13 +02:00
commit ab783c33ed
12 changed files with 384 additions and 14 deletions

View file

@ -217,6 +217,19 @@ type MatchCase struct {
Body []Stmt
}
type MatchExpr struct {
Value Expr
Cases []MatchExprCase
}
func (MatchExpr) exprNode() {}
type MatchExprCase struct {
EnumName, VariantName string
Bindings []string
Value Expr
}
type SelectCase struct {
Source Expr
Body []Stmt