aboutsummaryrefslogtreecommitdiff
path: root/lib/util.ml
diff options
context:
space:
mode:
authorfilliatr1999-08-16 14:01:48 +0000
committerfilliatr1999-08-16 14:01:48 +0000
commit3bb8e20dcabb74363315db5f85f9f8ba4ceb768f (patch)
tree381e10b43f5a9c53815583bf93945046f6efefa6 /lib/util.ml
parentb4a932fad873357ebe50bf571858e9fca842b9e5 (diff)
ancien names decoupe en names + sign
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r--lib/util.ml18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml
index f04b2cf4b9..d28b0c25f3 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -3,6 +3,16 @@
open Pp
+(* Errors *)
+
+exception Anomaly of string * std_ppcmds (* System errors *)
+let anomaly string = raise (Anomaly(string,[< 'sTR string >]))
+let anomalylabstrm string pps = raise (Anomaly(string,pps))
+
+exception UserError of string * std_ppcmds (* User errors *)
+let error string = raise (UserError(string,[< 'sTR string >]))
+let errorlabstrm l pps = raise (UserError(l,pps))
+
(* Strings *)
let explode s =
@@ -51,6 +61,14 @@ let parse_section_path s =
let id,k = decoupe_kind n in
dirs,id,k
+(* Lists *)
+
+let intersect l1 l2 =
+ List.filter (fun x -> List.mem x l2) l1
+
+let subtract l1 l2 =
+ if l2 = [] then l1 else List.filter (fun x -> not (List.mem x l2)) l1
+
(* Pretty-printing *)
let pr_spc () = [< 'sPC >];;