Merge branch 'handle-stdout'
[SXSI/xpathcomp.git] / src / state.ml
1 open Format
2
3 type t = int
4 let make =
5   let id = ref ~-1 in
6     fun () -> incr id; !id
7
8 let compare = (-)
9
10 let equal = (==)
11
12 external hash : t -> int =  "%identity"
13
14 let print fmt x = fprintf fmt "q%a" Pretty.pp_subscript x
15
16 let dump fmt x = print fmt x
17
18 let check x =
19   if x < 0 then failwith (Printf.sprintf "State: Assertion %i < 0 failed" x)
20
21 let dummy = max_int