Replace handwritten ppf with Format.formatter_of_buffer call
- Behavior is identical - Makes utop forward compatible with merged PR 595 of ocaml trunk
This commit is contained in:
parent
e45dcbdf9f
commit
f64e9d2e78
|
@ -145,11 +145,10 @@ let collect_formatters buf pps f =
|
||||||
pps save
|
pps save
|
||||||
in
|
in
|
||||||
(* Output functions. *)
|
(* Output functions. *)
|
||||||
let out_string str ofs len = Buffer.add_substring buf str ofs len
|
let out_functions =
|
||||||
and out_flush = ignore
|
let ppb = Format.formatter_of_buffer buf in
|
||||||
and out_newline () = Buffer.add_char buf '\n'
|
Format.pp_get_formatter_out_functions ppb ()
|
||||||
and out_spaces n = for i = 1 to n do Buffer.add_char buf ' ' done in
|
in
|
||||||
let out_functions = { Format.out_string; out_flush; out_newline; out_spaces } in
|
|
||||||
(* Replace formatter functions. *)
|
(* Replace formatter functions. *)
|
||||||
List.iter
|
List.iter
|
||||||
(fun pp ->
|
(fun pp ->
|
||||||
|
|
Loading…
Reference in New Issue