summaryrefslogtreecommitdiff
path: root/src/Identifiers.ml
diff options
context:
space:
mode:
authorSon Ho2021-11-03 16:42:27 +0100
committerSon Ho2021-11-03 16:42:27 +0100
commit33a1999bf6128358c841862f6b27123413ea4483 (patch)
treecc46fe32c1e7404d5f89e09262b291eec73b1402 /src/Identifiers.ml
parentd7981190632dcac8e5579e41252ed47e2e5b0879 (diff)
Implement CfimAst.ml
Diffstat (limited to 'src/Identifiers.ml')
-rw-r--r--src/Identifiers.ml20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/Identifiers.ml b/src/Identifiers.ml
index b46b00ee..abbca35c 100644
--- a/src/Identifiers.ml
+++ b/src/Identifiers.ml
@@ -16,6 +16,9 @@ module type Id = sig
val incr : id -> id
val to_string : id -> string
+
+ (* TODO: remove *)
+ (* module Map : Map.S with type key = id *)
end
(** Generative functor for identifiers.
@@ -25,7 +28,7 @@ end
module IdGen () : Id = struct
type id = int
- type 'a vector = 'a list (* TODO: use a map *)
+ type 'a vector = 'a list
let zero = 0
@@ -36,6 +39,21 @@ module IdGen () : Id = struct
if x == max_int then raise (IntegerOverflow ()) else x + 1
let to_string = string_of_int
+
+ (* TODO: how to make this work? *)
+ (* (module Ord : Map.OrderedType = struct
+ type t = id
+
+ let compare t1 t2 = t2 - t1
+ end)
+
+ module IdMap = Map.Make (Ord) *)
+
+ (* module Map = Map.Make (struct
+ type t = id
+
+ let compare = Stdlib.compare
+ end) *)
end
type name = string list