From de26e97cf37cafd37b83377d2df062a6e82676e7 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Sun, 12 May 2013 15:33:40 +0000 Subject: Use the Hook module here and there. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16510 85f007b7-540e-0410-9357-904b9bb8a0f7 --- proofs/tactic_debug.ml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'proofs/tactic_debug.ml') diff --git a/proofs/tactic_debug.ml b/proofs/tactic_debug.ml index 8ad92910f..d73561f37 100644 --- a/proofs/tactic_debug.ml +++ b/proofs/tactic_debug.ml @@ -12,12 +12,9 @@ open Pp open Tacexpr open Termops -let prtac = ref (fun _ -> assert false) -let set_tactic_printer f = prtac := f -let prmatchpatt = ref (fun _ _ -> assert false) -let set_match_pattern_printer f = prmatchpatt := f -let prmatchrl = ref (fun _ -> assert false) -let set_match_rule_printer f = prmatchrl := f +let (prtac, tactic_printer) = Hook.make () +let (prmatchpatt, match_pattern_printer) = Hook.make () +let (prmatchrl, match_rule_printer) = Hook.make () (* This module intends to be a beginning of debugger for tactic expressions. Currently, it is quite simple and we can hope to have, in the future, a more @@ -62,7 +59,7 @@ let help () = let goal_com g tac = begin db_pr_goal g; - msg_tac_debug (str "Going to execute:" ++ fnl () ++ !prtac tac) + msg_tac_debug (str "Going to execute:" ++ fnl () ++ Hook.get prtac tac) end let skipped = ref 0 @@ -164,7 +161,7 @@ let db_pattern_rule debug num r = if is_debug debug then begin msg_tac_debug (str "Pattern rule " ++ int num ++ str ":" ++ fnl () ++ - str "|" ++ spc () ++ !prmatchrl r) + str "|" ++ spc () ++ Hook.get prmatchrl r) end (* Prints the hypothesis pattern identifier if it exists *) @@ -195,7 +192,7 @@ let db_hyp_pattern_failure debug env (na,hyp) = if is_debug debug then msg_tac_debug (str ("The pattern hypothesis"^(hyp_bound na)^ " cannot match: ") ++ - !prmatchpatt env hyp) + Hook.get prmatchpatt env hyp) (* Prints a matching failure message for a rule *) let db_matching_failure debug = -- cgit v1.2.3