more careful treatment of exception serial numbers, with propagation to message channel;
1 (* Title: Pure/ML/ml_compiler.ML
4 Runtime compilation -- generic version.
7 signature ML_COMPILER =
9 val exn_position: exn -> Position.T
10 val exn_messages: exn -> (serial * string) list
11 val exn_message: exn -> string
12 val eval: bool -> Position.T -> ML_Lex.token list -> unit
15 structure ML_Compiler: ML_COMPILER =
18 fun exn_position _ = Position.none;
19 val exn_messages = Runtime.exn_messages exn_position;
20 val exn_message = Runtime.exn_message exn_position;
22 fun eval verbose pos toks =
24 val line = the_default 1 (Position.line_of pos);
25 val file = the_default "ML" (Position.file_of pos);
26 val text = ML_Lex.flatten toks;
27 in Secure.use_text ML_Env.local_context (line, file) verbose text end;