X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tag.ml;h=c500dab730c4d94b795468cc88f61aa92da6a8b7;hb=479afaf5e67e28ef73c0126e95ca8badec3392aa;hp=057f09dad9ee0c8e0bfee12e7a34b1e1f6e17b96;hpb=eebef30070a951d852ce5811b289d8131a5300eb;p=SXSI%2Fxpathcomp.git diff --git a/tag.ml b/tag.ml index 057f09d..c500dab 100644 --- a/tag.ml +++ b/tag.ml @@ -35,10 +35,22 @@ let tag s = match s with let compare = (-) let equal = (==) + +let hash x = x + + let to_string t = - if t = pcdata then "<$>" - else if t = attribute then "<@>" + if t == pcdata then "<$>" + else if t == attribute then "<@>" + else if t == nullt then "" else tag_name (get_pool()) t let print ppf t = Format.fprintf ppf "%s" (to_string t) +(* Check internal invariants *) +let check t = + if (t != tag (to_string t)) + then failwith "module Tag: internal check failed" + +let dump = print +