@@ -42,8 +42,6 @@ type effect = string option
42
42
43
43
44
44
let single_na = Single Lam_arity. na
45
- (* * we don't force people to use package *)
46
- type cmj_case = Ext_namespace .file_kind
47
45
48
46
type keyed_cmj_value = { name : string ; arity : arity ; persistent_closed_lambda : Lam .t option }
49
47
type keyed_cmj_values
@@ -52,20 +50,20 @@ type keyed_cmj_values
52
50
type t = {
53
51
values : keyed_cmj_values ;
54
52
pure : bool ;
55
- npm_package_path : Js_packages_info .t ;
56
- cmj_case : cmj_case ;
53
+ package_spec : Js_packages_info .t ;
54
+ js_file_kind : Ext_js_file_kind .t ;
57
55
}
58
56
59
- let make ~(values :cmj_value Map_string.t ) ~effect ~npm_package_path ~ cmj_case : t =
57
+ let make ~(values :cmj_value Map_string.t ) ~effect ~package_spec ~ js_file_kind : t =
60
58
{
61
59
values = Map_string. to_sorted_array_with_f values (fun k v -> {
62
60
name = k ;
63
61
arity = v.arity;
64
62
persistent_closed_lambda = v.persistent_closed_lambda
65
63
});
66
64
pure = effect = None ;
67
- npm_package_path ;
68
- cmj_case
65
+ package_spec ;
66
+ js_file_kind
69
67
}
70
68
71
69
@@ -178,70 +176,9 @@ let query_by_name (cmj_table : t ) name : keyed_cmj_value =
178
176
let values = cmj_table.values in
179
177
binarySearch values name
180
178
181
- let is_pure (cmj_table : t ) =
182
- cmj_table.pure
183
-
184
- let get_npm_package_path (cmj_table : t ) =
185
- cmj_table.npm_package_path
186
-
187
- let get_cmj_case (cmj_table : t ) =
188
- cmj_table.cmj_case
189
-
190
-
191
- (* start dumping *)
192
-
193
- let f fmt = Printf. fprintf stdout fmt
194
-
195
- let pp_cmj_case (cmj_case : cmj_case ) : unit =
196
- match cmj_case with
197
- | Little_js ->
198
- f " case : little, .js \n "
199
- | Little_bs ->
200
- f " case : little, .bs.js \n "
201
- | Upper_js ->
202
- f " case: upper, .js \n "
203
- | Upper_bs ->
204
- f " case: upper, .bs.js \n "
205
-
206
- let pp_cmj
207
- ({ values ; pure; npm_package_path ; cmj_case} : t ) =
208
- f " package info: %s\n "
209
- (Format. asprintf " %a" Js_packages_info. dump_packages_info npm_package_path)
210
- ;
211
- pp_cmj_case cmj_case;
212
-
213
- f " effect: %s\n "
214
- (if pure then " pure" else " not pure" );
215
- Ext_array. iter values
216
- (fun ({name = k ; arity; persistent_closed_lambda} ) ->
217
- match arity with
218
- | Single arity ->
219
- f " %s: %s\n " k (Format. asprintf " %a" Lam_arity. print arity);
220
- (match persistent_closed_lambda with
221
- | None ->
222
- f " %s: not saved\n " k
223
- | Some lam ->
224
- begin
225
- f " %s: ======[start]\n " k ;
226
- f " %s\n " (Lam_print. lambda_to_string lam);
227
- f " %s: ======[finish]\n " k
228
- end )
229
- | Submodule xs ->
230
- (match persistent_closed_lambda with
231
- | None -> f " %s: not saved\n " k
232
- | Some lam ->
233
- begin
234
- f " %s: ======[start]\n " k ;
235
- f " %s" (Lam_print. lambda_to_string lam);
236
- f " %s: ======[finish]\n " k
237
- end
238
- );
239
- Array. iteri
240
- (fun i arity -> f " %s[%i] : %s \n "
241
- k i
242
- (Format. asprintf " %a" Lam_arity. print arity ))
243
- xs
244
- )
179
+
180
+
181
+
245
182
246
183
type path = string
247
184
type cmj_load_info = {
0 commit comments