Community
Participate
Working Groups
Since a case expression does not support "fall through", it becomes difficult to write a switch statement where the same expression/sequence of expressions is shared among cases. The case statement should take a list of expressions. switch sExpr case expr1, expr2, ... : expr case ... endswitch Semantics are that sExpr is evaluated and comared against the case expressions, the case with the first matching expression result is used. If sExpr is missing - the default sExpr value is TRUE and the selection works the same way.
Multiple case expressions are now supported. Validation checks if an _ is used in a position other than the last and marks this as an error. A quick fix is offered to move the _ last in the list. Additional validation could be made - as it is quite meaningless to have additional expression if the last is ANY. (e.g. case 1, 2, _: ... - which is the same as just case _: ... ).