File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1
1
type 'v map_as_object =
2
2
(string * 'v) list <json repr="object">
3
3
wrap <ocaml module="Common.StringMap" t="'v Common.StringMap.t">
4
+
5
+ type 'v table_as_object =
6
+ (string * 'v) list <json repr="object">
7
+ wrap <ocaml module="Common.Table" t="'v Common.Table.t">
Original file line number Diff line number Diff line change @@ -15,6 +15,20 @@ module StringMap = struct
15
15
let unwrap = to_list
16
16
end
17
17
18
+ module Table = struct
19
+ type 'a t = (string , 'a ) Hashtbl .t
20
+
21
+ let empty () = Hashtbl. create (module String )
22
+
23
+ let to_list (l : 'a t ) : (string * 'a) list = Hashtbl. to_alist l
24
+
25
+ let of_list (m : (string * 'a) list ) : 'a t = Hashtbl. of_alist_exn (module String ) m
26
+
27
+ let wrap = of_list
28
+
29
+ let unwrap = to_list
30
+ end
31
+
18
32
let fmt_error fmt = Printf. ksprintf (fun s -> Error s) fmt
19
33
20
34
let first_line s =
You can’t perform that action at this time.
0 commit comments