diff options
Diffstat (limited to 'printing')
| -rw-r--r-- | printing/printer.ml | 9 | ||||
| -rw-r--r-- | printing/printmod.ml | 10 |
2 files changed, 16 insertions, 3 deletions
diff --git a/printing/printer.ml b/printing/printer.ml index 7938b7bb0b..7971e0aaa9 100644 --- a/printing/printer.ml +++ b/printing/printer.ml @@ -780,8 +780,15 @@ let print_one_inductive env mib ((_,i) as ind) = let print_mutual_inductive env mind mib = let inds = List.init (Array.length mib.mind_packets) (fun x -> (mind, x)) in + let keyword = + let open Decl_kinds in + match mib.mind_finite with + | Finite -> "Inductive " + | BiFinite -> "Variant " + | CoFinite -> "CoInductive " + in hov 0 (pr_polymorphic mib.mind_polymorphic ++ - str (if mib.mind_finite then "Inductive " else "CoInductive ") ++ + str keyword ++ prlist_with_sep (fun () -> fnl () ++ str" with ") (print_one_inductive env mib) inds ++ pr_universe_ctx (Univ.instantiate_univ_context mib.mind_universes)) diff --git a/printing/printmod.ml b/printing/printmod.ml index 7dd59cf05a..ffee2e244b 100644 --- a/printing/printmod.ml +++ b/printing/printmod.ml @@ -160,8 +160,14 @@ let print_body is_impl env mp (l,body) = let env = Option.get env in Printer.pr_mutual_inductive_body env (MutInd.make2 mp l) mib with e when Errors.noncritical e -> - (if mib.mind_finite then str "Inductive " else str "CoInductive") - ++ name) + let keyword = + let open Decl_kinds in + match mib.mind_finite with + | Finite -> "Inductive " + | BiFinite -> "Variant " + | CoFinite -> "CoInductive " + in + str keyword ++ name) let print_struct is_impl env mp struc = prlist_with_sep spc (print_body is_impl env mp) struc |
