@@ -71158,10 +71158,17 @@ class virtual fold =
7115871158 {[ goto : label option ; ]}
7115971159 *)
7116071160 '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
7116271167 } ->
7116371168 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
7116571172 method block : block -> 'self_type = (* true means break *)
7116671173 (* TODO: For efficency: block should not be a list, it should be able to
7116771174 be concatenated in both ways
@@ -123058,10 +123065,14 @@ let fprintf = Format.fprintf
123058123065
123059123066
123060123067
123061- let print_if ppf flag printer arg =
123068+ let print_if_pipe ppf flag printer arg =
123062123069 if !flag then fprintf ppf "%a@." printer arg;
123063123070 arg
123064123071
123072+ let print_if ppf flag printer arg =
123073+ if !flag then fprintf ppf "%a@." printer arg
123074+
123075+
123065123076
123066123077let process_with_gentype filename =
123067123078 match !Clflags.bs_gentype with
@@ -123132,15 +123143,15 @@ let interface ppf fname outputprefix =
123132123143 Compmisc.init_path false;
123133123144 Pparse.parse_interface ~tool_name:Js_config.tool_name ppf fname
123134123145 |> 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
123137123148 |> after_parsing_sig ppf outputprefix
123138123149
123139123150let interface_mliast ppf fname outputprefix =
123140123151 Compmisc.init_path false;
123141123152 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
123144123155 |> after_parsing_sig ppf outputprefix
123145123156
123146123157
@@ -123167,43 +123178,41 @@ let after_parsing_impl ppf outputprefix ast =
123167123178 Lam_compile_env.reset () ;
123168123179 let env = Compmisc.initial_env() in
123169123180 Env.set_unit_name modulename;
123170-
123171123181 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 ;
123177123188 if !Clflags.print_types || !Js_config.cmi_only then begin
123178123189 Warnings.check_fatal ();
123179123190 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+ ;
123191123200 end;
123192123201 process_with_gentype (outputprefix ^ ".cmt")
123193123202 end
123194123203let implementation ppf fname outputprefix =
123195123204 Compmisc.init_path false;
123196123205 Pparse.parse_implementation ~tool_name:Js_config.tool_name ppf fname
123197123206 |> 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
123200123209 |> after_parsing_impl ppf outputprefix
123201123210
123202123211let implementation_mlast ppf fname outputprefix =
123203123212 Compmisc.init_path false;
123204123213 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
123207123216 |> after_parsing_impl ppf outputprefix
123208123217
123209123218
@@ -123239,8 +123248,8 @@ let implementation_map ppf sourcefile outputprefix =
123239123248 ) in
123240123249 Compmisc.init_path false;
123241123250 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
123244123253 |> after_parsing_impl ppf outputprefix
123245123254
123246123255
0 commit comments