Use output_file to print to this file instead to stdout

This commit is contained in:
Benjamin Loison 2022-12-18 16:04:57 +01:00
parent fa052f70e2
commit ade62ba678

View File

@ -133,7 +133,14 @@ let _ =
else (
if !nopopt
then (fun _ -> ())
else Format.printf "%a" Ast_to_c.ast_to_c)
else
(
let oc = open_out !output_file in
let fmt = Format.make_formatter
(Stdlib.output_substring oc)
(fun () -> Stdlib.flush oc) in
Format.fprintf fmt "%a" Ast_to_c.ast_to_c);
)
end
end