equal
deleted
inserted
replaced
74 | flatten context exn = |
74 | flatten context exn = |
75 (case Par_Exn.dest exn of |
75 (case Par_Exn.dest exn of |
76 SOME exns => maps (flatten context) exns |
76 SOME exns => maps (flatten context) exns |
77 | NONE => [(context, identify exn)]); |
77 | NONE => [(context, identify exn)]); |
78 |
78 |
|
79 val print_thy = Pretty.unformatted_string_of o Context.pretty_abbrev_thy; |
|
80 |
79 in |
81 in |
80 |
82 |
81 fun exn_messages_ids e = |
83 fun exn_messages_ids e = |
82 let |
84 let |
83 fun raised exn name msgs = |
85 fun raised exn name msgs = |
102 TimeLimit.TimeOut => "Timeout" |
104 TimeLimit.TimeOut => "Timeout" |
103 | TOPLEVEL_ERROR => "Error" |
105 | TOPLEVEL_ERROR => "Error" |
104 | ERROR "" => "Error" |
106 | ERROR "" => "Error" |
105 | ERROR msg => msg |
107 | ERROR msg => msg |
106 | Fail msg => raised exn "Fail" [msg] |
108 | Fail msg => raised exn "Fail" [msg] |
107 | THEORY (msg, thys) => |
109 | THEORY (msg, thys) => raised exn "THEORY" (msg :: map (robust print_thy) thys) |
108 raised exn "THEORY" (msg :: map (robust Context.str_of_thy) thys) |
|
109 | Ast.AST (msg, asts) => |
110 | Ast.AST (msg, asts) => |
110 raised exn "AST" (msg :: map (robust (Pretty.string_of o Ast.pretty_ast)) asts) |
111 raised exn "AST" (msg :: map (robust (Pretty.string_of o Ast.pretty_ast)) asts) |
111 | TYPE (msg, Ts, ts) => |
112 | TYPE (msg, Ts, ts) => |
112 raised exn "TYPE" (msg :: |
113 raised exn "TYPE" (msg :: |
113 (robust_context context Syntax.string_of_typ Ts @ |
114 (robust_context context Syntax.string_of_typ Ts @ |