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

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
module LabelSet = SortedList.Make(LabelPool)
23
24
25
module LabelMap = LabelSet.Map

type label = LabelPool.t
26
type 'a label_map = 'a LabelMap.map