aboutsummaryrefslogtreecommitdiff
path: root/engine/proofview.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-02-25 10:26:02 +0100
committerPierre-Marie Pédrot2020-02-25 10:26:02 +0100
commitff3755c88f813f1a0e40e08128521cce81e38273 (patch)
tree7a43b69d3c3fd4dc66c79cd743858ac4bbcab1fc /engine/proofview.ml
parenta9deb354d00b9a402a63648d1cadf4c2c36bbdd1 (diff)
parent6e5f8099d1877197e6ecda3fd4edac8d48228661 (diff)
Merge PR #11498: [exn] Forbid raising in exn printers, make them return Pp.t option
Reviewed-by: ppedrot
Diffstat (limited to 'engine/proofview.ml')
-rw-r--r--engine/proofview.ml19
1 files changed, 10 insertions, 9 deletions
diff --git a/engine/proofview.ml b/engine/proofview.ml
index 690b1620b9..a26ce71141 100644
--- a/engine/proofview.ml
+++ b/engine/proofview.ml
@@ -303,8 +303,8 @@ let tclONCE = Proof.once
exception MoreThanOneSuccess
let _ = CErrors.register_handler begin function
| MoreThanOneSuccess ->
- Pp.str "This tactic has more than one success."
- | _ -> raise CErrors.Unhandled
+ Some (Pp.str "This tactic has more than one success.")
+ | _ -> None
end
(** [tclEXACTLY_ONCE e t] succeeds as [t] if [t] has exactly one
@@ -348,8 +348,8 @@ exception NoSuchGoals of int
let _ = CErrors.register_handler begin function
| NoSuchGoals n ->
- str "No such " ++ str (String.plural n "goal") ++ str "."
- | _ -> raise CErrors.Unhandled
+ Some (str "No such " ++ str (String.plural n "goal") ++ str ".")
+ | _ -> None
end
(** [tclFOCUS ?nosuchgoal i j t] applies [t] in a context where
@@ -421,9 +421,10 @@ exception SizeMismatch of int*int
let _ = CErrors.register_handler begin function
| SizeMismatch (i,j) ->
let open Pp in
- str"Incorrect number of goals" ++ spc() ++
- str"(expected "++int i++str(String.plural i " tactic") ++ str", was given "++ int j++str")."
- | _ -> raise CErrors.Unhandled
+ Some (
+ str"Incorrect number of goals" ++ spc() ++
+ str"(expected "++int i++str(String.plural i " tactic") ++ str", was given "++ int j++str").")
+ | _ -> None
end
(** A variant of [Monad.List.iter] where we iter over the focused list
@@ -908,8 +909,8 @@ let tclPROGRESS t =
let _ = CErrors.register_handler begin function
| Logic_monad.Tac_Timeout ->
- Pp.str "[Proofview.tclTIMEOUT] Tactic timeout!"
- | _ -> raise CErrors.Unhandled
+ Some (Pp.str "[Proofview.tclTIMEOUT] Tactic timeout!")
+ | _ -> None
end
let tclTIMEOUT n t =