@@ -4561,7 +4561,7 @@ type kind = Js | Bytecode | Native
4561
4561
(* * [deps_of_channel ic]
4562
4562
given an input_channel dumps all modules it depend on, only used for debugging
4563
4563
*)
4564
- val deps_of_channel : in_channel -> string array
4564
+ val deps_of_channel : in_channel -> string list
4565
4565
4566
4566
(* *
4567
4567
[make compilation_kind filename index namespace]
@@ -4636,26 +4636,28 @@ let write_file name (buf : Ext_buffer.t) =
4636
4636
(* Make sure it is the same as {!Binary_ast.magic_sep_char}*)
4637
4637
let magic_sep_char = '\n'
4638
4638
4639
- let deps_of_channel (ic : in_channel ) : string array =
4639
+ let deps_of_channel (ic : in_channel ) : string list =
4640
4640
let size = input_binary_int ic in
4641
- let s = really_input_string ic size in
4642
- let first_tab = String. index s magic_sep_char in
4643
- let return_arr = Array. make (int_of_string (String. sub s 0 first_tab)) " " in
4644
- let rec aux s ith (offset : int ) : unit =
4641
+ let s = really_input_string ic size in
4642
+ let rec aux (s : string ) acc (offset : int ) size : string list =
4645
4643
if offset < size then
4646
- let next_tab = String. index_from s offset magic_sep_char in
4647
- return_arr.(ith) < - String. sub s offset (next_tab - offset) ;
4648
- aux s (ith + 1 ) (next_tab + 1 )
4644
+ let next_tab = String. index_from s offset magic_sep_char in
4645
+ aux s
4646
+ (String. sub s offset (next_tab - offset)::acc) (next_tab + 1 )
4647
+ size
4648
+ else acc
4649
4649
in
4650
- aux s 0 (first_tab + 1 ) ;
4650
+ aux s [] 1 size
4651
+
4652
+
4653
+
4651
4654
4652
- return_arr
4653
4655
4654
4656
(* * Please refer to {!Binary_ast} for encoding format, we move it here
4655
4657
mostly for cutting the dependency so that [bsb_helper.exe] does
4656
4658
not depend on compler-libs
4657
4659
*)
4658
- let read_deps (fn : string ) : string array =
4660
+ let read_deps (fn : string ) : string list =
4659
4661
let ic = open_in_bin fn in
4660
4662
let v = deps_of_channel ic in
4661
4663
close_in ic;
@@ -4708,7 +4710,7 @@ let find_module db dependent_module is_not_lib_dir (index : Bsb_dir_index.t) =
4708
4710
Bsb_db_decode. find_opt db (index :> int ) dependent_module
4709
4711
else None
4710
4712
let oc_impl
4711
- (dependent_module_set : string array )
4713
+ (dependent_module_set : string list )
4712
4714
(input_file : string )
4713
4715
(index : Bsb_dir_index.t )
4714
4716
(db : Bsb_db_decode.t )
@@ -4730,7 +4732,7 @@ let oc_impl
4730
4732
Ext_buffer. add_string buf Literals. suffix_cmi;
4731
4733
) ; (* TODO: moved into static files*)
4732
4734
let is_not_lib_dir = not (Bsb_dir_index. is_lib_dir index) in
4733
- Ext_array . iter dependent_module_set (fun dependent_module ->
4735
+ Ext_list . iter dependent_module_set (fun dependent_module ->
4734
4736
match
4735
4737
find_module db dependent_module is_not_lib_dir index
4736
4738
with
@@ -4750,7 +4752,7 @@ let oc_impl
4750
4752
[.cmi] file
4751
4753
*)
4752
4754
let oc_intf
4753
- (dependent_module_set : string array )
4755
+ (dependent_module_set : string list )
4754
4756
input_file
4755
4757
(index : Bsb_dir_index.t )
4756
4758
(db : Bsb_db_decode.t )
@@ -4768,7 +4770,7 @@ let oc_intf
4768
4770
Ext_buffer. add_string buf Literals. suffix_cmi;
4769
4771
) ;
4770
4772
let is_not_lib_dir = not (Bsb_dir_index. is_lib_dir index) in
4771
- Ext_array . iter dependent_module_set begin fun dependent_module ->
4773
+ Ext_list . iter dependent_module_set begin fun dependent_module ->
4772
4774
match find_module db dependent_module is_not_lib_dir index
4773
4775
with
4774
4776
| None -> ()
0 commit comments