1995-08-09 08:06:35 -07:00
|
|
|
(***********************************************************************)
|
|
|
|
(* *)
|
2011-07-27 07:17:02 -07:00
|
|
|
(* OCaml *)
|
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
|
|
|
(* *)
|
|
|
|
(***********************************************************************)
|
|
|
|
|
2001-06-15 12:09:45 -07:00
|
|
|
(* WARNING: if you change something in this file, you must look at
|
2007-12-04 05:38:58 -08:00
|
|
|
opterrors.ml and ocamldoc/odoc_analyse.ml
|
|
|
|
to see if you need to make the same changes there.
|
2001-06-15 12:09:45 -07:00
|
|
|
*)
|
2000-10-31 06:55:30 -08:00
|
|
|
|
2001-06-15 12:09:45 -07:00
|
|
|
open Format
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
(* Report an error *)
|
|
|
|
|
2000-03-06 14:12:09 -08:00
|
|
|
let report_error ppf exn =
|
2013-09-12 07:34:13 -07:00
|
|
|
let report ppf x =
|
|
|
|
match Location.error_of_exn x with
|
|
|
|
| Some err -> Location.report_error ppf err
|
|
|
|
| None -> fprintf ppf "@]"; raise x
|
2013-09-11 09:08:00 -07:00
|
|
|
in
|
2000-03-06 14:12:09 -08:00
|
|
|
fprintf ppf "@[%a@]@." report exn
|