X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tag.ml;fp=tag.ml;h=8c7769107e400eaee858205d0bfee9b7a613959c;hb=95367aa932a9e179976e59ea326542c50905f5b3;hp=f0d90622bc4cc03c90e7643c0ec5331f69a97378;hpb=b821684aac2e3114c2eb28188020d7a09b5de2a5;p=SXSI%2Fxpathcomp.git diff --git a/tag.ml b/tag.ml index f0d9062..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 @@ -91,4 +95,3 @@ struct end include STag -let _ = Callback.register "caml_hash_tag" tag