aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-04-09 16:30:48 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-04-09 18:26:00 +0200
commit41af4c3e36af15d9cc235cb5effedeed40478d2e (patch)
tree899e0ca0e02752d6ff37228a7b5123305a47bff1
parentfa2fa0b2e6ca0fbfb9a9278af211d4ef533b6791 (diff)
Re-add printer for tacdef_body so that Ltac definitions are printed by pr_vernac.
-rw-r--r--ltac/g_ltac.ml419
1 files changed, 19 insertions, 0 deletions
diff --git a/ltac/g_ltac.ml4 b/ltac/g_ltac.ml4
index b55ac9ad0..c264b1906 100644
--- a/ltac/g_ltac.ml4
+++ b/ltac/g_ltac.ml4
@@ -413,7 +413,26 @@ VERNAC COMMAND EXTEND VernacPrintLtac CLASSIFIED AS QUERY
[ msg_notice (Tacintern.print_ltac (snd (Libnames.qualid_of_reference r))) ]
END
+let pr_ltac_ref = Libnames.pr_reference
+
+let pr_tacdef_body tacdef_body =
+ let id, redef, body =
+ match tacdef_body with
+ | TacticDefinition ((_,id), body) -> Nameops.pr_id id, false, body
+ | TacticRedefinition (id, body) -> pr_ltac_ref id, true, body
+ in
+ let idl, body =
+ match body with
+ | Tacexpr.TacFun (idl,b) -> idl,b
+ | _ -> [], body in
+ id ++
+ prlist (function None -> str " _"
+ | Some id -> spc () ++ Nameops.pr_id id) idl
+ ++ (if redef then str" ::=" else str" :=") ++ brk(1,1)
+ ++ Pptactic.pr_raw_tactic body
+
VERNAC ARGUMENT EXTEND ltac_tacdef_body
+PRINTED BY pr_tacdef_body
| [ tacdef_body(t) ] -> [ t ]
END