aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/ltac/taccoerce.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-11-03 10:57:46 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-11-03 10:57:46 +0100
commit87f3278ea3520ed2b2a4b355765392550488c1df (patch)
treeaaef8759f8f2755a4194c5de370ab3fc3325c25d /plugins/ltac/taccoerce.ml
parent97e82c1a520382ec34cfedcc55b5190126b05703 (diff)
parentd073a70d84aa6802a03d03a17d2246d607e85db1 (diff)
Merge PR #6047: A generic printer for ltac values
Diffstat (limited to 'plugins/ltac/taccoerce.ml')
-rw-r--r--plugins/ltac/taccoerce.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/ltac/taccoerce.ml b/plugins/ltac/taccoerce.ml
index a79a92a66..4d171ecbc 100644
--- a/plugins/ltac/taccoerce.ml
+++ b/plugins/ltac/taccoerce.ml
@@ -17,15 +17,23 @@ open Geninterp
exception CannotCoerceTo of string
+let base_val_typ wit =
+ match val_tag (topwit wit) with Val.Base t -> t | _ -> CErrors.anomaly (Pp.str "Not a base val.")
+
let (wit_constr_context : (Empty.t, Empty.t, EConstr.constr) Genarg.genarg_type) =
let wit = Genarg.create_arg "constr_context" in
let () = register_val0 wit None in
+ let () = Genprint.register_val_print0 (base_val_typ wit)
+ (Pptactic.make_constr_printer Printer.pr_econstr_n_env) in
wit
(* includes idents known to be bound and references *)
let (wit_constr_under_binders : (Empty.t, Empty.t, Ltac_pretype.constr_under_binders) Genarg.genarg_type) =
let wit = Genarg.create_arg "constr_under_binders" in
let () = register_val0 wit None in
+ let () = Genprint.register_val_print0 (base_val_typ wit)
+ (fun c ->
+ Genprint.PrinterNeedsContext (fun env sigma -> Printer.pr_constr_under_binders_env env sigma c)) in
wit
(** All the types considered here are base types *)