Flatten the sources, only leave the XPath module packed.
[tatoo.git] / src / state.ml
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Universit√© Paris-Sud & CNRS                       *)
7 (*                                                                     *)
8 (*  Copyright 2010-2012 Universit√© Paris-Sud and Centre National de la *)
9 (*  Recherche Scientifique. All rights reserved.  This file is         *)
10 (*  distributed under the terms of the GNU Lesser General Public       *)
11 (*  License, with the special exception on linking described in file   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 (*
17   Time-stamp: <Last modified on 2013-04-04 18:45:59 CEST by Kim Nguyen>
18 *)
19
20 open Format
21
22 type t = int
23 let make =
24   let id = ref ~-1 in
25     fun () -> incr id; !id
26
27 let compare = (-)
28
29 let equal = (==)
30
31 external hash : t -> int =  "%identity"
32
33 let print fmt x = fprintf fmt "q%a" Pretty.pp_subscript x
34
35 let dump fmt x = print fmt x
36
37 let check x =
38   if x < 0 then failwith (Printf.sprintf "State: Assertion %i < 0 failed" x)
39
40 let dummy = max_int