ident.ml 716 Bytes
Newer Older
1
2
module U = Encodings.Utf8
module Id = Pool.Make(U)
3
4
module IdSet = SortedList.Make(SortedList.Lift(Id))
module IdMap = IdSet.Map
5
module Env = Map.Make(Id)
6
7
8
9
10
type id = Id.t
type 'a id_map = (unit,'a) IdMap.map
type fv = unit IdSet.t

let ident = Id.mk
11
12


13
14
15
16
module Label = struct
  type t = Ns.qname
  let equal (ns1,l1) (ns2,l2) = (Ns.equal ns1 ns2) && (U.equal l1 l2)
  let hash (ns,l) = Ns.hash ns + 17 * U.hash l
17
18
  let to_string x = Ns.InternalPrinter.attr x
  let print ppf x = Format.fprintf ppf "%s" (to_string x)
19
20
21
end

module LabelPool = Pool.Make(Label)
22
23
24
25
26
module LabelSet = SortedList.Make(SortedList.Lift(LabelPool))
module LabelMap = LabelSet.Map

type label = LabelPool.t
type 'a label_map = (unit,'a) LabelMap.map