File tree Expand file tree Collapse file tree 4 files changed +24
-28
lines changed Expand file tree Collapse file tree 4 files changed +24
-28
lines changed Original file line number Diff line number Diff line change @@ -89,26 +89,25 @@ let translate ?output_prefix loc (cxt : Lam_compile_context.t)
89
89
let output_dir = Filename. dirname output_prefix in
90
90
91
91
(* TODO: pull this function out to top-level *)
92
- let rec module_names_of_expression = function
93
- | J. Var (J. Qualified ({ id = { name } } , _ )) -> [ name ]
92
+ let rec module_id_of_expression = function
93
+ | J. Var (J. Qualified (module_id , _ )) -> [ module_id ]
94
94
| J. Caml_block (exprs , _ , _ , _ ) ->
95
95
exprs
96
96
|> List. map (fun (e : J.expression ) ->
97
- module_names_of_expression e.expression_desc)
97
+ module_id_of_expression e.expression_desc)
98
98
|> List. concat
99
99
| _ -> []
100
100
in
101
101
102
- let module_name =
103
- match module_names_of_expression e.expression_desc with
102
+ let module_id =
103
+ match module_id_of_expression e.expression_desc with
104
104
| [ module_name ] -> module_name
105
105
| _ -> assert false
106
106
(* TODO: graceful error message here *)
107
107
in
108
108
109
109
let path =
110
- Js_name_of_module_id. string_of_module_id
111
- { id = Ident. create module_name; kind = Js_op. Ml }
110
+ Js_name_of_module_id. string_of_module_id module_id
112
111
~output_dir
113
112
(* TODO: where is Js_package_info.module_system ? *)
114
113
Js_packages_info. NodeJS
Original file line number Diff line number Diff line change @@ -96701,26 +96701,25 @@ let translate ?output_prefix loc (cxt : Lam_compile_context.t)
96701
96701
let output_dir = Filename.dirname output_prefix in
96702
96702
96703
96703
(* TODO: pull this function out to top-level *)
96704
- let rec module_names_of_expression = function
96705
- | J.Var (J.Qualified ({ id = { name } } , _)) -> [ name ]
96704
+ let rec module_id_of_expression = function
96705
+ | J.Var (J.Qualified (module_id , _)) -> [ module_id ]
96706
96706
| J.Caml_block (exprs, _, _, _) ->
96707
96707
exprs
96708
96708
|> List.map (fun (e : J.expression) ->
96709
- module_names_of_expression e.expression_desc)
96709
+ module_id_of_expression e.expression_desc)
96710
96710
|> List.concat
96711
96711
| _ -> []
96712
96712
in
96713
96713
96714
- let module_name =
96715
- match module_names_of_expression e.expression_desc with
96714
+ let module_id =
96715
+ match module_id_of_expression e.expression_desc with
96716
96716
| [ module_name ] -> module_name
96717
96717
| _ -> assert false
96718
96718
(* TODO: graceful error message here *)
96719
96719
in
96720
96720
96721
96721
let path =
96722
- Js_name_of_module_id.string_of_module_id
96723
- { id = Ident.create module_name; kind = Js_op.Ml }
96722
+ Js_name_of_module_id.string_of_module_id module_id
96724
96723
~output_dir
96725
96724
(* TODO: where is Js_package_info.module_system ? *)
96726
96725
Js_packages_info.NodeJS
Original file line number Diff line number Diff line change @@ -96701,26 +96701,25 @@ let translate ?output_prefix loc (cxt : Lam_compile_context.t)
96701
96701
let output_dir = Filename.dirname output_prefix in
96702
96702
96703
96703
(* TODO: pull this function out to top-level *)
96704
- let rec module_names_of_expression = function
96705
- | J.Var (J.Qualified ({ id = { name } } , _)) -> [ name ]
96704
+ let rec module_id_of_expression = function
96705
+ | J.Var (J.Qualified (module_id , _)) -> [ module_id ]
96706
96706
| J.Caml_block (exprs, _, _, _) ->
96707
96707
exprs
96708
96708
|> List.map (fun (e : J.expression) ->
96709
- module_names_of_expression e.expression_desc)
96709
+ module_id_of_expression e.expression_desc)
96710
96710
|> List.concat
96711
96711
| _ -> []
96712
96712
in
96713
96713
96714
- let module_name =
96715
- match module_names_of_expression e.expression_desc with
96714
+ let module_id =
96715
+ match module_id_of_expression e.expression_desc with
96716
96716
| [ module_name ] -> module_name
96717
96717
| _ -> assert false
96718
96718
(* TODO: graceful error message here *)
96719
96719
in
96720
96720
96721
96721
let path =
96722
- Js_name_of_module_id.string_of_module_id
96723
- { id = Ident.create module_name; kind = Js_op.Ml }
96722
+ Js_name_of_module_id.string_of_module_id module_id
96724
96723
~output_dir
96725
96724
(* TODO: where is Js_package_info.module_system ? *)
96726
96725
Js_packages_info.NodeJS
Original file line number Diff line number Diff line change @@ -265895,26 +265895,25 @@ let translate ?output_prefix loc (cxt : Lam_compile_context.t)
265895
265895
let output_dir = Filename.dirname output_prefix in
265896
265896
265897
265897
(* TODO: pull this function out to top-level *)
265898
- let rec module_names_of_expression = function
265899
- | J.Var (J.Qualified ({ id = { name } } , _)) -> [ name ]
265898
+ let rec module_id_of_expression = function
265899
+ | J.Var (J.Qualified (module_id , _)) -> [ module_id ]
265900
265900
| J.Caml_block (exprs, _, _, _) ->
265901
265901
exprs
265902
265902
|> List.map (fun (e : J.expression) ->
265903
- module_names_of_expression e.expression_desc)
265903
+ module_id_of_expression e.expression_desc)
265904
265904
|> List.concat
265905
265905
| _ -> []
265906
265906
in
265907
265907
265908
- let module_name =
265909
- match module_names_of_expression e.expression_desc with
265908
+ let module_id =
265909
+ match module_id_of_expression e.expression_desc with
265910
265910
| [ module_name ] -> module_name
265911
265911
| _ -> assert false
265912
265912
(* TODO: graceful error message here *)
265913
265913
in
265914
265914
265915
265915
let path =
265916
- Js_name_of_module_id.string_of_module_id
265917
- { id = Ident.create module_name; kind = Js_op.Ml }
265916
+ Js_name_of_module_id.string_of_module_id module_id
265918
265917
~output_dir
265919
265918
(* TODO: where is Js_package_info.module_system ? *)
265920
265919
Js_packages_info.NodeJS
You can’t perform that action at this time.
0 commit comments