diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2023-02-21 22:56:59 +0100 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2023-02-23 22:20:08 +0100 |
commit | fd525c8dc977f63dfd1613b24ba3f011665151a1 (patch) | |
tree | c587fad6de234bc14f26f7b37d71c5e8e83f4164 /toplevel | |
parent | db913818a6a96688e501835f11f0a4d00c37b91b (diff) | |
download | ocaml-fd525c8dc977f63dfd1613b24ba3f011665151a1.tar.gz |
toplevel: also separate the toplevel phrase with a blank line
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/byte/topeval.ml | 8 | ||||
-rw-r--r-- | toplevel/native/topeval.ml | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/toplevel/byte/topeval.ml b/toplevel/byte/topeval.ml index 77e945c05f..038c7fc064 100644 --- a/toplevel/byte/topeval.ml +++ b/toplevel/byte/topeval.ml @@ -157,12 +157,18 @@ let execute_phrase print_outcome ppf phr = in Ophr_exception (exn, outv) in - !print_out_phrase ppf out_phr; + begin match out_phr with + | Ophr_signature [] -> () + | _ -> + Location.separate_new_message ppf; + !print_out_phrase ppf out_phr; + end; if Printexc.backtrace_status () then begin match !backtrace with | None -> () | Some b -> + Location.separate_new_message ppf; pp_print_string ppf b; pp_print_flush ppf (); backtrace := None; diff --git a/toplevel/native/topeval.ml b/toplevel/native/topeval.ml index ff56c27953..1ea01f4c8b 100644 --- a/toplevel/native/topeval.ml +++ b/toplevel/native/topeval.ml @@ -243,7 +243,12 @@ let execute_phrase print_outcome ppf phr = in Ophr_exception (exn, outv) in - !print_out_phrase ppf out_phr; + begin match out_phr with + | Ophr_signature [] -> () + | _ -> + Location.separate_new_message ppf; + !print_out_phrase ppf out_phr; + end; begin match out_phr with | Ophr_eval (_, _) | Ophr_signature _ -> true | Ophr_exception _ -> false |