author | haftmann |
Thu, 16 Sep 2010 17:52:00 +0200 | |
changeset 39481 | f15514acc942 |
parent 39285 | 85728a4b5620 |
child 39439 | 1c294d150ded |
permissions | -rw-r--r-- |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
1 |
(* Title: Pure/Isar/runtime.ML |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
2 |
Author: Makarius |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
3 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
4 |
Isar toplevel runtime support. |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
5 |
*) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
6 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
7 |
signature RUNTIME = |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
8 |
sig |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
9 |
exception UNDEF |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
10 |
exception TERMINATE |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
11 |
exception EXCURSION_FAIL of exn * string |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
12 |
exception TOPLEVEL_ERROR |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
13 |
val exn_context: Proof.context option -> exn -> exn |
38874
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
14 |
val exn_messages: (exn -> Position.T) -> exn -> string list |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
15 |
val exn_message: (exn -> Position.T) -> exn -> string |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
16 |
val debugging: ('a -> 'b) -> 'a -> 'b |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
17 |
val controlled_execution: ('a -> 'b) -> 'a -> 'b |
33603
3713a5208671
generalized Runtime.toplevel_error wrt. output function;
wenzelm
parents:
32091
diff
changeset
|
18 |
val toplevel_error: (exn -> unit) -> ('a -> 'b) -> 'a -> 'b |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
19 |
end; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
20 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
21 |
structure Runtime: RUNTIME = |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
22 |
struct |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
23 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
24 |
(** exceptions **) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
25 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
26 |
exception UNDEF; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
27 |
exception TERMINATE; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
28 |
exception EXCURSION_FAIL of exn * string; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
29 |
exception TOPLEVEL_ERROR; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
30 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
31 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
32 |
(* exn_context *) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
33 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
34 |
exception CONTEXT of Proof.context * exn; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
35 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
36 |
fun exn_context NONE exn = exn |
39285 | 37 |
| exn_context (SOME ctxt) exn = if Exn.is_interrupt exn then exn else CONTEXT (ctxt, exn); |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
38 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
39 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
40 |
(* exn_message *) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
41 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
42 |
fun if_context NONE _ _ = [] |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
43 |
| if_context (SOME ctxt) f xs = map (f ctxt) xs; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
44 |
|
38874
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
45 |
fun exn_messages exn_position e = |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
46 |
let |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
47 |
fun raised exn name msgs = |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
48 |
let val pos = Position.str_of (exn_position exn) in |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
49 |
(case msgs of |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
50 |
[] => "exception " ^ name ^ " raised" ^ pos |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
51 |
| [msg] => "exception " ^ name ^ " raised" ^ pos ^ ": " ^ msg |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
52 |
| _ => cat_lines (("exception " ^ name ^ " raised" ^ pos ^ ":") :: msgs)) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
53 |
end; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
54 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
55 |
val detailed = ! Output.debugging; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
56 |
|
39232
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
57 |
fun exn_msgs context exn = |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
58 |
if Exn.is_interrupt exn then [] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
59 |
else |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
60 |
(case exn of |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
61 |
Exn.EXCEPTIONS exns => maps (exn_msgs context) exns |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
62 |
| CONTEXT (ctxt, exn) => exn_msgs (SOME ctxt) exn |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
63 |
| EXCURSION_FAIL (exn, loc) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
64 |
map (fn msg => msg ^ Markup.markup Markup.location ("\n" ^ loc)) (exn_msgs context exn) |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
65 |
| TERMINATE => ["Exit"] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
66 |
| TimeLimit.TimeOut => ["Timeout"] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
67 |
| TOPLEVEL_ERROR => ["Error"] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
68 |
| SYS_ERROR msg => ["## SYSTEM ERROR ##\n" ^ msg] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
69 |
| ERROR msg => [msg] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
70 |
| Fail msg => [raised exn "Fail" [msg]] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
71 |
| THEORY (msg, thys) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
72 |
[raised exn "THEORY" (msg :: (if detailed then map Context.str_of_thy thys else []))] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
73 |
| Syntax.AST (msg, asts) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
74 |
[raised exn "AST" (msg :: |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
75 |
(if detailed then map (Pretty.string_of o Syntax.pretty_ast) asts else []))] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
76 |
| TYPE (msg, Ts, ts) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
77 |
[raised exn "TYPE" (msg :: |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
78 |
(if detailed then |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
79 |
if_context context Syntax.string_of_typ Ts @ |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
80 |
if_context context Syntax.string_of_term ts |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
81 |
else []))] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
82 |
| TERM (msg, ts) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
83 |
[raised exn "TERM" (msg :: |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
84 |
(if detailed then if_context context Syntax.string_of_term ts else []))] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
85 |
| THM (msg, i, thms) => |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
86 |
[raised exn ("THM " ^ string_of_int i) (msg :: |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
87 |
(if detailed then if_context context Display.string_of_thm thms else []))] |
69c6d3e87660
more abstract treatment of interrupts in structure Exn -- hardly ever need to mention Interrupt literally;
wenzelm
parents:
38875
diff
changeset
|
88 |
| _ => [raised exn (General.exnMessage exn) []]); |
38874
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
89 |
in exn_msgs NONE e end; |
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
90 |
|
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
91 |
fun exn_message exn_position exn = |
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
92 |
(case exn_messages exn_position exn of |
38875
c7a66b584147
tuned messages: discontinued spurious full-stops (messages are occasionally composed unexpectedly);
wenzelm
parents:
38874
diff
changeset
|
93 |
[] => "Interrupt" |
38874
4a4d34d2f97b
more careful treatment of nested multi-exceptions, collapsing cumulatively empty list to Interrupt;
wenzelm
parents:
37370
diff
changeset
|
94 |
| msgs => cat_lines msgs); |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
95 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
96 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
97 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
98 |
(** controlled execution **) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
99 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
100 |
fun debugging f x = |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
101 |
if ! Output.debugging then |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
102 |
Exn.release (exception_trace (fn () => |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
103 |
Exn.Result (f x) handle |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
104 |
exn as UNDEF => Exn.Exn exn |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
105 |
| exn as EXCURSION_FAIL _ => Exn.Exn exn)) |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
106 |
else f x; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
107 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
108 |
fun controlled_execution f = |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
109 |
f |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
110 |
|> debugging |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
111 |
|> Future.interruptible_task; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
112 |
|
39238
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
113 |
fun toplevel_error output_exn f x = f x |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
114 |
handle exn => |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
115 |
if Exn.is_interrupt exn then reraise exn |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
116 |
else |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
117 |
let |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
118 |
val ctxt = Option.map Context.proof_of (Context.thread_data ()); |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
119 |
val _ = output_exn (exn_context ctxt exn); |
7189a138dd6c
refined Runtime.toplevel_error/Document.run_command: let interrupts pass unhindered;
wenzelm
parents:
39232
diff
changeset
|
120 |
in raise TOPLEVEL_ERROR end; |
31476
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
121 |
|
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
122 |
end; |
c5d2899b6de9
moved Isar toplevel runtime support to runtime.ML, which is loaded early (before ml_compiler.ML);
wenzelm
parents:
diff
changeset
|
123 |