aboutsummaryrefslogtreecommitdiff
path: root/lib/util.ml
diff options
context:
space:
mode:
authorfilliatr1999-12-02 16:43:08 +0000
committerfilliatr1999-12-02 16:43:08 +0000
commit162fc39bcc36953402d668b5d7ac7b88c9966461 (patch)
tree764403e3752e1c183ecf6831ba71e430a4b3799b /lib/util.ml
parent33019e47a55caf3923d08acd66077f0a52947b47 (diff)
modifs pour premiere edition de liens
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@189 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index 0cab4540e2..e1e524cf4a 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -13,6 +13,12 @@ exception UserError of string * std_ppcmds (* User errors *)
let error string = raise (UserError(string,[< 'sTR string >]))
let errorlabstrm l pps = raise (UserError(l,pps))
+(* raising located exceptions *)
+type loc = int * int
+let anomaly_loc (loc,s,strm) = Stdpp.raise_with_loc loc (Anomaly (s,strm))
+let user_err_loc (loc,s,strm) = Stdpp.raise_with_loc loc (UserError (s,strm))
+let invalid_arg_loc (loc,s) = Stdpp.raise_with_loc loc (Invalid_argument s)
+
(* Strings *)
let explode s =
@@ -214,6 +220,14 @@ let list_share_tails l1 l2 =
in
shr_rev [] (List.rev l1, List.rev l2)
+let list_except_assoc e =
+ let rec except_e = function
+ | [] -> []
+ | (x,_ as y)::l -> if x=e then l else y::except_e l
+ in
+ except_e
+
+
(* Arrays *)
let array_exists f v =