diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2014-10-15 13:34:58 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2014-10-15 13:34:58 +0000 |
commit | 031cffd1554cde5e9d78b78e4959708a2d8c9201 (patch) | |
tree | 38aec36ff5282a62a704f7a925ddac41aae51db6 /parsing/location.ml | |
parent | e3ad818fb5f8ddc7b477779a6da69ccac0f00f4f (diff) | |
parent | 6ca707d0665b2015a5690de8c560e27f6371e443 (diff) | |
download | ocaml-031cffd1554cde5e9d78b78e4959708a2d8c9201.tar.gz |
merge branch 4.02 from release 4.02.0 to release 4.02.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15558 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing/location.ml')
-rw-r--r-- | parsing/location.ml | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/parsing/location.ml b/parsing/location.ml index c6d1704f15..174377eecb 100644 --- a/parsing/location.ml +++ b/parsing/location.ml @@ -363,10 +363,15 @@ let () = ) -let report_exception ppf exn = - match error_of_exn exn with - | Some err -> fprintf ppf "@[%a@]@." report_error err +let rec report_exception_rec n ppf exn = + try match error_of_exn exn with + | Some err -> + fprintf ppf "@[%a@]@." report_error err | None -> raise exn + with exn when n > 0 -> + report_exception_rec (n-1) ppf exn + +let report_exception ppf exn = report_exception_rec 5 ppf exn exception Error of error |