@@ -103,30 +103,10 @@ let implementation ~use_super_errors impl str : Js.Unsafe.obj =
103
103
let compile impl ~use_super_errors =
104
104
implementation ~use_super_errors impl
105
105
106
-
107
-
108
-
109
- (* let load_module cmi_path cmi_content cmj_name cmj_content =
110
- Js.create_file cmi_path cmi_content;
111
- Js_cmj_datasets.data_sets :=
112
- Map_string.add !Js_cmj_datasets.data_sets
113
- cmj_name (lazy (Js_cmj_format.from_string cmj_content))
114
- *)
115
-
116
-
117
106
let export (field : string ) v =
118
107
Js.Unsafe. set (Js.Unsafe. global) field v
119
108
;;
120
109
121
- (* To add a directory to the load path *)
122
-
123
- let dir_directory d =
124
- Config. load_path := d :: ! Config. load_path
125
-
126
-
127
- let () =
128
- dir_directory " /static/cmis"
129
-
130
110
let make_compiler name impl =
131
111
export name
132
112
(Js.Unsafe. (obj
@@ -141,15 +121,12 @@ let make_compiler name impl =
141
121
(fun _ code ->
142
122
(compile impl ~use_super_errors: true (Js. to_string code)));
143
123
" version" , Js.Unsafe. inject (Js. string (Bs_version. version));
144
- (* "load_module",
124
+ " load_module" ,
145
125
inject @@
146
126
Js. wrap_meth_callback
147
- (fun _ cmi_path cmi_content cmj_name cmj_content ->
148
- let cmj_bytestring = Js.to_bytestring cmj_content in
149
- (* HACK: force string tag to ASCII (9) to avoid
150
- * UTF-8 encoding *)
151
- Js.Unsafe.set cmj_bytestring "t" 9;
152
- load_module cmi_path cmi_content (Js.to_string cmj_name) cmj_bytestring); *)
127
+ (fun _ cmi_path cmi_content cmj_path cmj_content ->
128
+ Js. create_file cmi_path cmi_content;
129
+ Js. create_file cmj_path cmj_content);
153
130
|]))
154
131
let () = make_compiler " ocaml" Parse. implementation
155
132
0 commit comments