Add value-returning match expressions
This commit is contained in:
parent
b0a52de4ea
commit
ab783c33ed
12 changed files with 384 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue