let pp_print_endblock ?check_last_char fmt () =
match check_last_char with
| Some s ->
begin
if String.length s > 0 &&
s.[(String.length s) - 1] = '\n' then
begin
pp_print_newline fmt ()
end
else
begin
pp_print_newline fmt ();
pp_print_newline fmt ()
end
end
| None ->
begin
pp_print_newline fmt ();
pp_print_newline fmt ()
end