Commit fab27296 authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2005-04-20 14:37:18 by afrisch] Empty log message

Original author: afrisch
Date: 2005-04-20 14:37:18+00:00
parent f8fad6db
......@@ -473,6 +473,23 @@ let rec compare x y =
| Integer _,_ -> -1 | _, Integer _ -> 1
| Abstract _, _ -> -1 | _, Abstract _ -> 1
let rec hash = function
| Pair (x1,x2) ->
hash x1 * 17 + hash x2
| (Xml (x1,x2,x3) | XmlNs (x1,x2,x3,_)) ->
hash x1 * 257 + hash x2 * 17 + hash x3
| Record rx -> LabelMap.hash hash rx
| Atom x -> Atoms.V.hash x
| Integer x -> Intervals.V.hash x
| Char x -> Chars.V.hash x
| Abstraction _
| Abstraction2 _ -> 1
| Abstract _ -> 2
| Absent -> assert false
| Concat _ as x -> eval_lazy_concat x; hash x
| String_latin1 (i,j,s,q) -> hash (normalize_string_latin1 i j s q)
| String_utf8 (i,j,s,q) ->hash (normalize_string_utf8 i j s q)
let iter_xml pcdata_callback other_callback =
let rec aux = function
| v when compare v nil = 0 -> ()
......
......@@ -98,6 +98,7 @@ val get_fields : t -> (Ns.qname * t) list
val get_pair : t -> t * t
val hash: t -> int
val compare : t -> t -> int
val equal : t -> t -> bool
val ( |<| ): t -> t -> bool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment