end
module HMap = Map.Make (struct type t = int let compare x y = x - y end)
+
module HTag =
struct
type t = int
let attribute = T.hash T.attribute
let pcdata = T.hash T.pcdata
+
let pool = ref HMap.empty
+
let add_pool s =
let hash = T.hash s in
pool := HMap.add hash s !pool
add_pool "";
add_pool T.attribute;
add_pool T.pcdata
-
let _ = clear_pool ()
+let init l =
+ clear_pool ()
let tag s =
let hash = T.hash s in
let pcdata = T.pcdata
external tag : string -> t = "%identity"
external clear_pool : unit -> unit = "%identity"
+ let init _ = ()
let compare = String.compare
let equal = (=)
let print fmt s = Format.fprintf fmt "%s" s
end
include STag
-let _ = Callback.register "caml_hash_tag" tag