File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
let () =
2
2
let content = {|
3
3
let () = print_endline " hello" ;;
4
+ 1 + 1 ;;
4
5
1 + ;;
5
6
Missing_module. f;;
6
7
| } in
@@ -12,10 +13,10 @@ Missing_module.f;;
12
13
try
13
14
Location. reset () ;
14
15
let phr = ! Toploop. parse_toplevel_phrase lexbuf in
15
- if not (Toploop. execute_phrase true Format. std_formatter phr) then raise Exit
16
+ let res = Toploop. execute_phrase true Format. std_formatter phr in
17
+ flush_all () ;
18
+ if not res then raise Exit
16
19
with
17
- | End_of_file ->
18
- flush_all () ;
19
- exit 0
20
+ | End_of_file -> exit 0
20
21
| x -> Location. report_exception Format. std_formatter x
21
22
done
Original file line number Diff line number Diff line change 1
1
hello
2
- Line 3 , characters 2-4:
2
+ Line 4 , characters 2-4:
3
3
Error: Syntax error
4
- Line 4 , characters 0-16:
4
+ Line 5 , characters 0-16:
5
5
Error: Unbound module Missing_module
You can’t perform that action at this time.
0 commit comments