From 3bb8e20dcabb74363315db5f85f9f8ba4ceb768f Mon Sep 17 00:00:00 2001 From: filliatr Date: Mon, 16 Aug 1999 14:01:48 +0000 Subject: ancien names decoupe en names + sign git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@6 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/util.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/util.ml') 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 >];; -- cgit v1.2.3