aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics/tacinterp.ml
diff options
context:
space:
mode:
authorGravatar sacerdot <sacerdot@85f007b7-540e-0410-9357-904b9bb8a0f7>2005-05-20 16:14:52 +0000
committerGravatar sacerdot <sacerdot@85f007b7-540e-0410-9357-904b9bb8a0f7>2005-05-20 16:14:52 +0000
commitd361ee5b960e1a54d451dc81557f19e504baa42a (patch)
tree417cf2b9bce2dcaf293cc9ab11ad5ebede7d2dc9 /tactics/tacinterp.ml
parentd0a324eef4d35a87e300a2b660b26fdbe2043d92 (diff)
New command: "Print Ltac qualid" to print user defined tactics.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@7053 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics/tacinterp.ml')
-rw-r--r--tactics/tacinterp.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/tactics/tacinterp.ml b/tactics/tacinterp.ml
index 1a9ae4b0f..8194a4cf7 100644
--- a/tactics/tacinterp.ml
+++ b/tactics/tacinterp.ml
@@ -2175,6 +2175,17 @@ let (inMD,outMD) =
classify_function = (fun (_,o) -> Substitute o);
export_function = (fun x -> Some x)}
+let print_ltac id =
+ try
+ let kn = Nametab.locate_tactic id in
+ let t = lookup kn in
+ str "Ltac" ++ spc() ++ pr_qualid id ++ str ":=" ++ spc() ++
+ Pptacticnew.pr_glob_tactic (Global.env ()) t
+ with
+ Not_found ->
+ errorlabstrm "print_ltac"
+ (pr_qualid id ++ spc() ++ str "is not a user defined tactic")
+
(* Adds a definition for tactics in the table *)
let make_absolute_name (loc,id) =
let kn = Lib.make_kn id in