diff --git a/lib/ppast.ml b/lib/ppast.ml index 98ef33c9..3ed558ad 100644 --- a/lib/ppast.ml +++ b/lib/ppast.ml @@ -67,6 +67,13 @@ and pp_cases_pattern_expr_r printer = function (pp_cases_pattern_expr printer) exprs; write printer suffix + | Constrexpr.CPatPrim token -> pp_prim_token printer token + | Constrexpr.CPatOr xs -> + parens printer (fun () -> + with_seps + ~sep:(fun () -> write printer " | ") + (pp_cases_pattern_expr printer) + xs) | _ -> raise (NotImplemented (contents printer)) let rec pp_constr_expr printer CAst.{ v; loc = _ } = pp_constr_expr_r printer v diff --git a/test/coq_files/match/or-pattern/inside_tuple/in.v b/test/coq_files/match/or-pattern/inside_tuple/in.v new file mode 100644 index 00000000..fe01b249 --- /dev/null +++ b/test/coq_files/match/or-pattern/inside_tuple/in.v @@ -0,0 +1 @@ +Definition foo(x y:nat):bool:=match x,y with 0,(0|1|2)=>true|_,_=>false end. diff --git a/test/coq_files/match/or-pattern/inside_tuple/out.v b/test/coq_files/match/or-pattern/inside_tuple/out.v new file mode 100644 index 00000000..af38c20f --- /dev/null +++ b/test/coq_files/match/or-pattern/inside_tuple/out.v @@ -0,0 +1,5 @@ +Definition foo (x y : nat) : bool := + match x, y with + | 0, (0 | 1 | 2) => true + | _, _ => false + end. diff --git a/test/coq_files/match/or-pattern/in.v b/test/coq_files/match/or-pattern/whole_branch/in.v similarity index 100% rename from test/coq_files/match/or-pattern/in.v rename to test/coq_files/match/or-pattern/whole_branch/in.v diff --git a/test/coq_files/match/or-pattern/out.v b/test/coq_files/match/or-pattern/whole_branch/out.v similarity index 100% rename from test/coq_files/match/or-pattern/out.v rename to test/coq_files/match/or-pattern/whole_branch/out.v