diff options
author | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-09-17 20:46:20 +0000 |
---|---|---|
committer | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-09-17 20:46:20 +0000 |
commit | 7208928de37565a9e38f9540f2bfb1e7a3b877e6 (patch) | |
tree | 7d51cd24c406d349f4b7410c81ee66c210df49cd /interp/reserve.ml | |
parent | a6dac9962929d724c08c9a74a8e05de06469a1a0 (diff) |
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
Diffstat (limited to 'interp/reserve.ml')
-rw-r--r-- | interp/reserve.ml | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/interp/reserve.ml b/interp/reserve.ml index 914a85fe8..23fce79c1 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 |