blob: 4849d4b98291565498a4fd65b867ac4186af954c [file] [log] [blame] [edit]
/**
#### 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
;