diff options
Diffstat (limited to 'toplevel/errors.ml')
| -rw-r--r-- | toplevel/errors.ml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/toplevel/errors.ml b/toplevel/errors.ml index 3d1cbf1ae8..3c18bf619e 100644 --- a/toplevel/errors.ml +++ b/toplevel/errors.ml @@ -47,7 +47,7 @@ let rec explain_exn_default = function | Stack_overflow -> hOV 0 [< 'sTR "Stack overflow" >] | Ast.No_match s -> - hOV 0 [< 'sTR "Anomaly: Ast matching error: "; 'sTR s >] + hOV 0 [< 'sTR "Anomaly: Ast matching error: "; 'sTR s; report () >] | Anomaly (s,pps) -> hOV 1 [< 'sTR "Anomaly: "; where s; pps; report () >] | Match_failure(filename,pos1,pos2) -> @@ -98,6 +98,14 @@ let rec explain_exn_default = function hOV 0 [< 'sTR "Syntax error: Undefined token." >] | Lexer.Error (Bad_token s) -> hOV 0 [< 'sTR "Syntax error: Bad token"; 'sPC; 'sTR s; 'sTR "." >] + | Assert_failure (s,b,e) -> + hOV 0 [< 'sTR "Anomaly: assert failure"; 'sPC; + if s <> "" then + [< 'sTR ("(file \"" ^ s ^ "\", characters "); + 'iNT b; 'sTR "-"; 'iNT e; 'sTR ")" >] + else + [< >]; + report () >] | reraise -> hOV 0 [< 'sTR "Anomaly: Uncaught exception "; 'sTR (Printexc.to_string reraise); report () >] |
