summaryrefslogtreecommitdiff
path: root/parsing
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-09-12 14:45:03 +0000
committerAlain Frisch <alain@frisch.fr>2013-09-12 14:45:03 +0000
commit884ca00fdfc1fe5f6165fbb847c6744a47fb59d2 (patch)
treebd64e49f3c3a449e41120b0e3508e120986ceab0 /parsing
parent8660e346df9c4b9bb5db38d5c91689f8a6ad906c (diff)
downloadocaml-884ca00fdfc1fe5f6165fbb847c6744a47fb59d2.tar.gz
Continue cleanup. driver/errors.ml is no longer needed.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/exception_registration@14120 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing')
-rw-r--r--parsing/location.ml6
-rw-r--r--parsing/location.mli3
2 files changed, 9 insertions, 0 deletions
diff --git a/parsing/location.ml b/parsing/location.ml
index 579c1dbefb..132021f5b9 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -360,3 +360,9 @@ let () =
| _ ->
None
)
+
+
+let report_exception ppf exn =
+ match error_of_exn exn with
+ | Some err -> fprintf ppf "@[%a@]@." report_error err
+ | None -> raise exn
diff --git a/parsing/location.mli b/parsing/location.mli
index a2057442f9..e6df9d1f6c 100644
--- a/parsing/location.mli
+++ b/parsing/location.mli
@@ -106,3 +106,6 @@ val register_error_of_exn: (exn -> error option) -> unit
being located as well). *)
val report_error: formatter -> error -> unit
+
+val report_exception: formatter -> exn -> unit
+ (* Reraise the exception if it is unknown. *)