aboutsummaryrefslogtreecommitdiffhomepage
path: root/vernac/lemmas.ml
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-03-15 20:48:10 +0100
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2017-05-27 22:35:10 +0200
commit8a807b2ffc27b84c9ea0ffe9f22b164ade24badb (patch)
tree78c30edd51e65c8e7014ac360c5027da77ff20b2 /vernac/lemmas.ml
parent2eb27e56ea4764fa2f2acec6f951eef2642ff1be (diff)
[cleanup] Unify all calls to the error function.
This is the continuation of #244, we now deprecate `CErrors.error`, the single entry point in Coq is `user_err`. The rationale is to allow for easier grepping, and to ease a future cleanup of error messages. In particular, we would like to systematically classify all error messages raised by Coq and be sure they are properly documented. We restore the two functions removed in #244 to improve compatibility, but mark them deprecated.
Diffstat (limited to 'vernac/lemmas.ml')
-rw-r--r--vernac/lemmas.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/vernac/lemmas.ml b/vernac/lemmas.ml
index c67a3302f..d6ae0ea86 100644
--- a/vernac/lemmas.ml
+++ b/vernac/lemmas.ml
@@ -153,9 +153,9 @@ let find_mutually_recursive_statements thms =
(* assume the largest indices as possible *)
List.last common_same_indhyp, false, possible_guards
| _, [] ->
- error
+ user_err Pp.(str
("Cannot find common (mutual) inductive premises or coinductive" ^
- " conclusions in the statements.")
+ " conclusions in the statements."))
in
(finite,guard,None), ordered_inds
@@ -273,7 +273,7 @@ let save_named ?export_seff proof =
let check_anonymity id save_ident =
if not (String.equal (atompart_of_id id) (Id.to_string (default_thm_id))) then
- error "This command can only be used for unnamed theorem."
+ user_err Pp.(str "This command can only be used for unnamed theorem.")
let save_anonymous ?export_seff proof save_ident =
let id,const,(cstrs,pl),do_guard,persistence,hook = proof in
@@ -478,10 +478,10 @@ let save_proof ?proof = function
match proof with
| Some ({ id; entries; persistence = k; universes }, _) ->
if List.length entries <> 1 then
- error "Admitted does not support multiple statements";
+ user_err Pp.(str "Admitted does not support multiple statements");
let { const_entry_secctx; const_entry_type } = List.hd entries in
if const_entry_type = None then
- error "Admitted requires an explicit statement";
+ user_err Pp.(str "Admitted requires an explicit statement");
let typ = Option.get const_entry_type in
let ctx = Evd.evar_context_universe_context (fst universes) in
let sec_vars = if !keep_admitted_vars then const_entry_secctx else None in