diff options
author | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-12-14 11:05:35 +0000 |
---|---|---|
committer | ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-12-14 11:05:35 +0000 |
commit | d9f9673d90371ead668863221c1202de49ab1782 (patch) | |
tree | 3fca5420ce4404972f87ea05d2000e3fd8e89017 /lib | |
parent | 9a0c61b81a2d9c0024b20a6c7ad8af01026739b0 (diff) |
Moved Stringset and Stringmap to String namespace.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16068 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cString.ml | 11 | ||||
-rw-r--r-- | lib/cString.mli | 7 | ||||
-rw-r--r-- | lib/envars.ml | 8 | ||||
-rw-r--r-- | lib/util.ml | 3 | ||||
-rw-r--r-- | lib/util.mli | 3 |
5 files changed, 23 insertions, 9 deletions
diff --git a/lib/cString.ml b/lib/cString.ml index fd375c5c3..b34b21957 100644 --- a/lib/cString.ml +++ b/lib/cString.ml @@ -58,6 +58,8 @@ sig val ordinal : int -> string val split : char -> string -> string list val is_sub : string -> string -> int -> bool + module Set : Set.S with type elt = t + module Map : Map.S with type key = t end include String @@ -167,3 +169,12 @@ let split c s = | Not_found -> [String.sub s n (len-n)] in if Int.equal len 0 then [] else split 0 + +module Self = +struct + type t = string + let compare = compare +end + +module Set = Set.Make(Self) +module Map = Map.Make(Self) diff --git a/lib/cString.mli b/lib/cString.mli index 9f4a47f19..18679d310 100644 --- a/lib/cString.mli +++ b/lib/cString.mli @@ -87,6 +87,13 @@ sig val is_sub : string -> string -> int -> bool (** [is_sub p s off] tests whether [s] contains [p] at offset [off]. *) + + module Set : Set.S with type elt = t + (** Finite sets on [string] *) + + module Map : Map.S with type key = t + (** Finite maps on [string] *) + end include ExtS diff --git a/lib/envars.ml b/lib/envars.ml index a4629e50d..097ffe08e 100644 --- a/lib/envars.ml +++ b/lib/envars.ml @@ -6,6 +6,8 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) +open Util + (** {1 Helper functions} *) let getenv_else s dft = try Sys.getenv s with Not_found -> dft () @@ -31,7 +33,7 @@ let home ~warn = let path_to_list p = let sep = if Sys.os_type = "Win32" then ';' else ':' in - Util.String.split sep p + String.split sep p let user_path () = let path = try Sys.getenv "PATH" with _ -> raise Not_found in @@ -161,7 +163,7 @@ let camllib () = else let com = ocamlc () ^ " -where" in let _, res = CUnix.run_command (fun x -> x) (fun _ -> ()) com in - Util.String.strip res + String.strip res (** {2 Camlp4 paths} *) @@ -187,7 +189,7 @@ let camlp4lib () = let com = camlp4 () ^ " -where" in let ex, res = CUnix.run_command (fun x -> x) (fun _ -> ()) com in match ex with - | Unix.WEXITED 0 -> Util.String.strip res + | Unix.WEXITED 0 -> String.strip res | _ -> "/dev/null" (** {1 XDG utilities} *) diff --git a/lib/util.ml b/lib/util.ml index 91497f370..c2d290714 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -55,9 +55,6 @@ let subst_command_placeholder s t = done; Buffer.contents buff -module Stringset = Set.Make(String) -module Stringmap = Map.Make(String) - (* Lists *) module List : CList.ExtS = CList diff --git a/lib/util.mli b/lib/util.mli index e6cb7fe9d..33812c200 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -42,9 +42,6 @@ module String : CString.ExtS val subst_command_placeholder : string -> string -> string val parse_loadpath : string -> string list -module Stringset : Set.S with type elt = string -module Stringmap : Map.S with type key = string - (** {6 Lists. } *) module List : CList.ExtS |