1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Objective Caml *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
|
|
|
|
(* *)
|
1996-04-30 07:53:58 -07:00
|
|
|
(* Copyright 1996 Institut National de Recherche en Informatique et *)
|
1999-11-17 10:59:06 -08:00
|
|
|
(* en Automatique. All rights reserved. This file is distributed *)
|
|
|
|
(* under the terms of the Q Public License version 1.0. *)
|
1995-08-09 08:06:35 -07:00
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
|
|
|
(* $Id$ *)
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
(* Error report *)
|
|
|
|
|
1999-11-08 09:06:33 -08:00
|
|
|
open Formatmsg
|
1995-05-04 03:15:53 -07:00
|
|
|
open Location
|
|
|
|
|
|
|
|
(* Report an error *)
|
|
|
|
|
|
|
|
let report_error exn =
|
1996-08-13 08:07:44 -07:00
|
|
|
open_box 0;
|
1995-05-04 03:15:53 -07:00
|
|
|
begin match exn with
|
|
|
|
Lexer.Error(err, start, stop) ->
|
1999-09-08 10:42:13 -07:00
|
|
|
Location.print {loc_start = start; loc_end = stop; loc_ghost = false};
|
1995-05-04 03:15:53 -07:00
|
|
|
Lexer.report_error err
|
1997-08-22 01:55:41 -07:00
|
|
|
| Syntaxerr.Error err ->
|
|
|
|
Syntaxerr.report_error err
|
1995-05-04 03:15:53 -07:00
|
|
|
| Env.Error err ->
|
|
|
|
Env.report_error err
|
1999-11-30 08:07:38 -08:00
|
|
|
| Ctype.Tags(l, l') ->
|
|
|
|
printf "In this program,@ variant constructors@ `%s and `%s@ have same hash value." l l'
|
1995-05-04 03:15:53 -07:00
|
|
|
| Typecore.Error(loc, err) ->
|
|
|
|
Location.print loc; Typecore.report_error err
|
|
|
|
| Typetexp.Error(loc, err) ->
|
|
|
|
Location.print loc; Typetexp.report_error err
|
|
|
|
| Typedecl.Error(loc, err) ->
|
|
|
|
Location.print loc; Typedecl.report_error err
|
|
|
|
| Includemod.Error err ->
|
|
|
|
Includemod.report_error err
|
|
|
|
| Typemod.Error(loc, err) ->
|
|
|
|
Location.print loc; Typemod.report_error err
|
|
|
|
| Translcore.Error(loc, err) ->
|
|
|
|
Location.print loc; Translcore.report_error err
|
|
|
|
| Symtable.Error code ->
|
|
|
|
Symtable.report_error code
|
1995-07-02 09:45:41 -07:00
|
|
|
| Bytelink.Error code ->
|
|
|
|
Bytelink.report_error code
|
1995-07-11 11:07:53 -07:00
|
|
|
| Bytelibrarian.Error code ->
|
|
|
|
Bytelibrarian.report_error code
|
1995-05-04 03:15:53 -07:00
|
|
|
| Sys_error msg ->
|
|
|
|
print_string "I/O error: "; print_string msg
|
1996-04-22 04:15:41 -07:00
|
|
|
| Typeclass.Error(loc, err) ->
|
|
|
|
Location.print loc; Typeclass.report_error err
|
1998-11-30 10:25:12 -08:00
|
|
|
| Translclass.Error(loc, err) ->
|
|
|
|
Location.print loc; Translclass.report_error err
|
1995-05-04 03:15:53 -07:00
|
|
|
| x ->
|
|
|
|
close_box(); raise x
|
|
|
|
end;
|
|
|
|
close_box(); print_newline()
|