X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tag.ml;h=8c7769107e400eaee858205d0bfee9b7a613959c;hb=95367aa932a9e179976e59ea326542c50905f5b3;hp=b692df74b6d5deb77df3282bfbb4fdd03c1552b7;hpb=705a37f90b2161deaae7d99cc6c95700613e2cb2;p=SXSI%2Fxpathcomp.git diff --git a/tag.ml b/tag.ml index b692df7..8c77691 100644 --- a/tag.ml +++ b/tag.ml @@ -29,13 +29,16 @@ struct 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 @@ -45,10 +48,11 @@ let clear_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 @@ -82,6 +86,7 @@ struct 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 @@ -90,4 +95,3 @@ struct end include STag -let _ = Callback.register "caml_hash_tag" tag