Commit bc8567a9 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-06-18 07:09:46 by afrisch] Empty log message

Original author: afrisch
Date: 2005-06-18 07:09:46+00:00
parent ec9eb3bd
...@@ -22,11 +22,8 @@ let split_qname s = ...@@ -22,11 +22,8 @@ let split_qname s =
module P = Upool.Make(U) module P = Upool.Make(U)
(* module P = Pool.Make(U) *)
include P include P
let value = get
let empty = mk empty_str let empty = mk empty_str
let xml_ns = mk (U.mk "http://www.w3.org/XML/1998/namespace") let xml_ns = mk (U.mk "http://www.w3.org/XML/1998/namespace")
let xsd_ns = mk (U.mk "http://www.w3.org/2001/XMLSchema") let xsd_ns = mk (U.mk "http://www.w3.org/2001/XMLSchema")
......
...@@ -9,10 +9,12 @@ module type S = sig ...@@ -9,10 +9,12 @@ module type S = sig
val dummy: t val dummy: t
val mk: value -> t val mk: value -> t
val get: t -> value val value: t -> value
val extract: unit -> value list val extract: unit -> value list
val intract: value list -> unit val intract: value list -> unit
val from_int: int -> t
end end
module HInt = Hashtbl.Make(struct type t = int module HInt = Hashtbl.Make(struct type t = int
...@@ -41,16 +43,18 @@ module Make(X : Custom.T) = struct ...@@ -41,16 +43,18 @@ module Make(X : Custom.T) = struct
with Not_found -> HInt.add pool h v); with Not_found -> HInt.add pool h v);
h h
let get h = let value h =
assert (h != dummy); assert (h != dummy);
HInt.find pool h HInt.find pool h
let extract () = HInt.fold (fun _ v accu -> v::accu) pool [] let extract () = HInt.fold (fun _ v accu -> v::accu) pool []
let intract = List.iter (fun v -> ignore (mk v)) let intract = List.iter (fun v -> ignore (mk v))
let serialize s h = X.serialize s (get h) let serialize s h = X.serialize s (value h)
let deserialize s = mk (X.deserialize s) let deserialize s = mk (X.deserialize s)
let check _ = () let check _ = ()
let dump ppf _ = () let dump ppf _ = ()
let from_int i = i
end end
...@@ -9,10 +9,12 @@ module type S = sig ...@@ -9,10 +9,12 @@ module type S = sig
val dummy: t val dummy: t
val mk: value -> t val mk: value -> t
val get: t -> value val value: t -> value
val extract: unit -> value list val extract: unit -> value list
val intract: value list -> unit val intract: value list -> unit
val from_int: int -> t
end end
module Make(X : Custom.T) : S with type value = X.t module Make(X : Custom.T) : S with type value = X.t
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment