X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tag.ml;fp=tag.ml;h=82c42b5757db837779aecd0cbacb5380d07de142;hb=d64e3a3a9ef6329caafdba848ef78427fce0d689;hp=057f09dad9ee0c8e0bfee12e7a34b1e1f6e17b96;hpb=c74aa5a224a41d3ab9d1a7ae4ebb4e58083a578c;p=SXSI%2Fxpathcomp.git diff --git a/tag.ml b/tag.ml index 057f09d..82c42b5 100644 --- a/tag.ml +++ b/tag.ml @@ -35,6 +35,10 @@ 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 "<@>" @@ -42,3 +46,10 @@ let to_string 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 +