kphp
kphp copied to clipboard
Implementation of `match` expression
Issue: https://github.com/VKCOM/kphp/issues/290
RFC: https://wiki.php.net/rfc/match_expression_v2
Idea:
Convert match into switch but using eq3 instead of eq2.
- [x] New keyword
- [x] New AST nodes(
op_match_proxy, op_match_default, op_match_case) - [x] Change
op_switch - [x] Lexing\parsing
- [x] Informative error messages
- [x] Creating
switch-node frommatch-node - [x] eq3 instead of eq2 for
switch-nodes those are transformed frommatch - [x] Write regression tests