File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ type t = {
337337let toplevel_exec_phrase t ppf p =
338338 match Phrase. result p with
339339 | Error exn -> raise exn
340- | Ok phrase ->
340+ | Ok phrase -> (
341341 Warnings. reset_fatal () ;
342342 let mapper = Lexbuf. position_mapper (Phrase. start p) in
343343 let phrase =
@@ -356,7 +356,10 @@ let toplevel_exec_phrase t ppf p =
356356 if ! Clflags. dump_parsetree then Printast. top_phrase ppf phrase;
357357 if ! Clflags. dump_source then Pprintast. top_phrase ppf phrase;
358358 Env. reset_cache_toplevel () ;
359- Toploop. execute_phrase t.verbose ppf phrase
359+ try Toploop. execute_phrase t.verbose ppf phrase
360+ with Compenv. Exit_with_status code ->
361+ Format. fprintf ppf " [%d]@." code;
362+ false )
360363
361364type var_and_value = V : 'a ref * 'a -> var_and_value
362365
Original file line number Diff line number Diff line change 1+ Exits from the toplevel are reported correctly:
2+
3+ ``` ocaml
4+ # #use "idontexist.ml";;
5+ ```
Original file line number Diff line number Diff line change 1+ Exits from the toplevel are reported correctly:
2+
3+ ```ocaml
4+ # #use "idontexist.ml";;
5+ Cannot find file idontexist.ml.
6+ [125]
7+ ```
Original file line number Diff line number Diff line change 3535 (alias runtest)
3636 (action (diff code/test-case .md code.actual)))
3737
38+ (rule
39+ (target compenv-exit.actual)
40+ (deps (package mdx) (source_tree compenv-exit))
41+ (action
42+ (with -stdout-to %{ target}
43+ (chdir compenv-exit
44+ (run ocaml-mdx test -- output - test-case.md)))))
45+
46+ (rule
47+ (alias runtest)
48+ (action (diff compenv-exit/test-case .md.expected compenv-exit.actual)))
49+
3850(rule
3951 (target cram.actual)
4052 (deps (package mdx) (source_tree cram))
You can’t perform that action at this time.
0 commit comments