/** | |
#### Pattern matching | |
See [When-expression](control-flow.html#when-expression) | |
*/ | |
when | |
: "when" ("(" expression ")")? "{" | |
whenEntry* | |
"}" | |
; | |
// TODO : consider empty after -> | |
whenEntry | |
: whenCondition{","} "->" expression SEMI | |
: "else" "->" expression SEMI | |
; | |
whenCondition | |
: expression | |
: ("in" | "!in") expression | |
: ("is" | "!is") isRHS | |
; |