From 7208928de37565a9e38f9540f2bfb1e7a3b877e6 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Mon, 17 Sep 2012 20:46:20 +0000 Subject: More cleaning on Utils and CList. Some parts of the code being peculiarly messy, I hope I did not introduce too many bugs. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15815 85f007b7-540e-0410-9357-904b9bb8a0f7 --- interp/reserve.ml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'interp') diff --git a/interp/reserve.ml b/interp/reserve.ml index 914a85fe8e..23fce79c1b 100644 --- a/interp/reserve.ml +++ b/interp/reserve.ml @@ -77,10 +77,14 @@ let revert_reserved_type t = try let l = Gmapl.find (constr_key t) !reserve_revtable in let t = Detyping.detype false [] [] t in - List.try_find - (fun (pat,id) -> - try let _ = Notation_ops.match_notation_constr false t ([], pat) in Name id - with Notation_ops.No_match -> failwith "") l + (* pedrot: if [Notation_ops.match_notation_constr] may raise [Failure _] + then I've introduced a bug... *) + let find (pat, id) = + try let _ = Notation_ops.match_notation_constr false t ([], pat) in true + with Notation_ops.No_match -> false + in + let (_, id) = List.find find l in + Name id with Not_found | Failure _ -> Anonymous let _ = Namegen.set_reserved_typed_name revert_reserved_type -- cgit v1.2.3