Commit 2e3cc23c authored by Andrei Paskevich's avatar Andrei Paskevich

match statements on tuples (parsing and typing)

parent e5379d09
......@@ -417,7 +417,7 @@ lexpr:
{ mk_pp (PPnamed ($1, $2)) }
| LET lident EQUAL lexpr IN lexpr
{ mk_pp (PPlet ($2, $4, $6)) }
| MATCH lexpr WITH bar_ match_cases END
| MATCH list1_lexpr_sep_comma WITH bar_ match_cases END
{ mk_pp (PPmatch ($2, $5)) }
| lexpr COLON primitive_type
{ mk_pp (PPcast ($1, $3)) }
......@@ -436,7 +436,7 @@ match_cases:
;
match_case:
| pattern ARROW lexpr { ($1,$3) }
| list1_pat_sep_comma ARROW lexpr { ($1,$3) }
;
list1_pat_sep_comma:
......
......@@ -73,7 +73,7 @@ and pp_desc =
| PPnamed of string * lexpr
| PPlet of ident * lexpr * lexpr
(* | PPeps of ident * lexpr *)
| PPmatch of lexpr * (pattern * lexpr) list
| PPmatch of lexpr list * (pattern list * lexpr) list
| PPcast of lexpr * pty
(*s Declarations. *)
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment