aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/funind/glob_term_to_relation.ml
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-03-13 00:00:25 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2013-03-13 00:00:25 +0000
commit6d378686e7986a391130b98019c7c52de27c42e7 (patch)
tree335e6fbbf484c8e19b3a1e1461b93c5632256315 /plugins/funind/glob_term_to_relation.ml
parent9aecb4427f0f8ca3cb4c26bc7f73bb74164a93d9 (diff)
Restrict (try...with...) to avoid catching critical exn (part 9)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16285 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/funind/glob_term_to_relation.ml')
-rw-r--r--plugins/funind/glob_term_to_relation.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/funind/glob_term_to_relation.ml b/plugins/funind/glob_term_to_relation.ml
index 9ec935cfd..fe48cbd88 100644
--- a/plugins/funind/glob_term_to_relation.ml
+++ b/plugins/funind/glob_term_to_relation.ml
@@ -912,7 +912,8 @@ let rec rebuild_cons env nb_args relname args crossed_types depth rt =
try
observe (str "computing new type for eq : " ++ pr_glob_constr rt);
let t' =
- try Pretyping.understand Evd.empty env t with _ -> raise Continue
+ try Pretyping.understand Evd.empty env t
+ with e when Errors.noncritical e -> raise Continue
in
let is_in_b = is_free_in id b in
let _keep_eq =
@@ -1211,7 +1212,7 @@ let compute_params_name relnames (args : (Name.t * Glob_term.glob_constr * bool)
l := param::!l
)
rels_params.(0)
- with _ ->
+ with e when Errors.noncritical e ->
()
in
List.rev !l
@@ -1417,7 +1418,7 @@ let do_build_inductive
in
observe (msg);
raise e
- | e ->
+ | reraise ->
let _time3 = System.get_time () in
(* Pp.msgnl (str "error : "++ str (string_of_float (System.time_difference time2 time3))); *)
let repacked_rel_inds =
@@ -1428,16 +1429,16 @@ let do_build_inductive
str "while trying to define"++ spc () ++
Ppvernac.pr_vernac (Vernacexpr.VernacInductive(Decl_kinds.Finite,false,repacked_rel_inds))
++ fnl () ++
- Errors.print e
+ Errors.print reraise
in
observe msg;
- raise e
+ raise reraise
let build_inductive funnames funsargs returned_types rtl =
try
do_build_inductive funnames funsargs returned_types rtl
- with e -> raise (Building_graph e)
+ with e when Errors.noncritical e -> raise (Building_graph e)