@@ -71158,10 +71158,17 @@ class virtual fold =
71158
71158
{[ goto : label option ; ]}
71159
71159
*)
71160
71160
'a. ('self_type -> 'a -> 'self_type) -> 'a case_clause -> 'self_type =
71161
- fun _f_a { switch_case = _x; switch_body = _x_i1; should_break = _x_i2
71161
+ fun _f_a
71162
+ {
71163
+ switch_case = _x;
71164
+ switch_body = _x_i1;
71165
+ should_break = _x_i2;
71166
+ comment = _x_i3
71162
71167
} ->
71163
71168
let o = _f_a o _x in
71164
- let o = o#block _x_i1 in let o = o#bool _x_i2 in o
71169
+ let o = o#block _x_i1 in
71170
+ let o = o#bool _x_i2 in
71171
+ let o = o#option (fun o -> o#string) _x_i3 in o
71165
71172
method block : block -> 'self_type = (* true means break *)
71166
71173
(* TODO: For efficency: block should not be a list, it should be able to
71167
71174
be concatenated in both ways
@@ -123058,10 +123065,14 @@ let fprintf = Format.fprintf
123058
123065
123059
123066
123060
123067
123061
- let print_if ppf flag printer arg =
123068
+ let print_if_pipe ppf flag printer arg =
123062
123069
if !flag then fprintf ppf "%a@." printer arg;
123063
123070
arg
123064
123071
123072
+ let print_if ppf flag printer arg =
123073
+ if !flag then fprintf ppf "%a@." printer arg
123074
+
123075
+
123065
123076
123066
123077
let process_with_gentype filename =
123067
123078
match !Clflags.bs_gentype with
@@ -123132,15 +123143,15 @@ let interface ppf fname outputprefix =
123132
123143
Compmisc.init_path false;
123133
123144
Pparse.parse_interface ~tool_name:Js_config.tool_name ppf fname
123134
123145
|> Ppx_entry.rewrite_signature
123135
- |> print_if ppf Clflags.dump_parsetree Printast.interface
123136
- |> print_if ppf Clflags.dump_source Pprintast.signature
123146
+ |> print_if_pipe ppf Clflags.dump_parsetree Printast.interface
123147
+ |> print_if_pipe ppf Clflags.dump_source Pprintast.signature
123137
123148
|> after_parsing_sig ppf outputprefix
123138
123149
123139
123150
let interface_mliast ppf fname outputprefix =
123140
123151
Compmisc.init_path false;
123141
123152
Binary_ast.read_ast Mli fname
123142
- |> print_if ppf Clflags.dump_parsetree Printast.interface
123143
- |> print_if ppf Clflags.dump_source Pprintast.signature
123153
+ |> print_if_pipe ppf Clflags.dump_parsetree Printast.interface
123154
+ |> print_if_pipe ppf Clflags.dump_source Pprintast.signature
123144
123155
|> after_parsing_sig ppf outputprefix
123145
123156
123146
123157
@@ -123167,43 +123178,41 @@ let after_parsing_impl ppf outputprefix ast =
123167
123178
Lam_compile_env.reset () ;
123168
123179
let env = Compmisc.initial_env() in
123169
123180
Env.set_unit_name modulename;
123170
-
123171
123181
let (typedtree, coercion, _, _) =
123172
- ast
123173
- |> Typemod.type_implementation_more ?check_exists:(if !Js_config.force_cmi then None else Some ()) !Location.input_name outputprefix modulename env
123174
- |> print_if ppf Clflags.dump_typedtree
123175
- (fun fmt (ty,co,_,_) -> Printtyped.implementation_with_coercion fmt (ty,co))
123176
- in
123182
+ Typemod.type_implementation_more
123183
+ ?check_exists:(if !Js_config.force_cmi then None else Some ())
123184
+ !Location.input_name outputprefix modulename env ast in
123185
+ let typedtree_coercion = (typedtree, coercion) in
123186
+ print_if ppf Clflags.dump_typedtree
123187
+ Printtyped.implementation_with_coercion typedtree_coercion ;
123177
123188
if !Clflags.print_types || !Js_config.cmi_only then begin
123178
123189
Warnings.check_fatal ();
123179
123190
end else begin
123180
- (typedtree, coercion)
123181
- |> Translmod.transl_implementation modulename
123182
- |> (fun lambda ->
123183
- let js_program =
123184
- print_if ppf Clflags.dump_rawlambda Printlambda.lambda (get_lambda lambda)
123185
- |> Lam_compile_main.compile outputprefix in
123186
- if not !Js_config.cmj_only then
123187
- Lam_compile_main.lambda_as_module
123188
- js_program
123189
- outputprefix
123190
- );
123191
+ let lambda = Translmod.transl_implementation modulename typedtree_coercion in
123192
+ let js_program =
123193
+ print_if_pipe ppf Clflags.dump_rawlambda Printlambda.lambda (get_lambda lambda)
123194
+ |> Lam_compile_main.compile outputprefix in
123195
+ if not !Js_config.cmj_only then
123196
+ Lam_compile_main.lambda_as_module
123197
+ js_program
123198
+ outputprefix
123199
+ ;
123191
123200
end;
123192
123201
process_with_gentype (outputprefix ^ ".cmt")
123193
123202
end
123194
123203
let implementation ppf fname outputprefix =
123195
123204
Compmisc.init_path false;
123196
123205
Pparse.parse_implementation ~tool_name:Js_config.tool_name ppf fname
123197
123206
|> Ppx_entry.rewrite_implementation
123198
- |> print_if ppf Clflags.dump_parsetree Printast.implementation
123199
- |> print_if ppf Clflags.dump_source Pprintast.structure
123207
+ |> print_if_pipe ppf Clflags.dump_parsetree Printast.implementation
123208
+ |> print_if_pipe ppf Clflags.dump_source Pprintast.structure
123200
123209
|> after_parsing_impl ppf outputprefix
123201
123210
123202
123211
let implementation_mlast ppf fname outputprefix =
123203
123212
Compmisc.init_path false;
123204
123213
Binary_ast.read_ast Ml fname
123205
- |> print_if ppf Clflags.dump_parsetree Printast.implementation
123206
- |> print_if ppf Clflags.dump_source Pprintast.structure
123214
+ |> print_if_pipe ppf Clflags.dump_parsetree Printast.implementation
123215
+ |> print_if_pipe ppf Clflags.dump_source Pprintast.structure
123207
123216
|> after_parsing_impl ppf outputprefix
123208
123217
123209
123218
@@ -123239,8 +123248,8 @@ let implementation_map ppf sourcefile outputprefix =
123239
123248
) in
123240
123249
Compmisc.init_path false;
123241
123250
ml_ast
123242
- |> print_if ppf Clflags.dump_parsetree Printast.implementation
123243
- |> print_if ppf Clflags.dump_source Pprintast.structure
123251
+ |> print_if_pipe ppf Clflags.dump_parsetree Printast.implementation
123252
+ |> print_if_pipe ppf Clflags.dump_source Pprintast.structure
123244
123253
|> after_parsing_impl ppf outputprefix
123245
123254
123246
123255
0 commit comments