summaryrefslogtreecommitdiff
path: root/toplevel/cerrors.ml
diff options
context:
space:
mode:
authorGravatar Stephane Glondu <steph@glondu.net>2010-12-24 12:51:11 +0100
committerGravatar Stephane Glondu <steph@glondu.net>2010-12-24 12:51:11 +0100
commit20d03a28285c430740d0b675583fe5c4d13ffecc (patch)
tree36bd87c5c42d948291605fc35b4b7cf573fc8113 /toplevel/cerrors.ml
parentc0a92523eaa76afabcbaf06ac4a7e8f7930ee4a3 (diff)
parent50dc9067e98ca001ad2e875011abab5da6fdb621 (diff)
Merge commit 'upstream/8.3.pl1+dfsg' into experimental/master
Diffstat (limited to 'toplevel/cerrors.ml')
-rw-r--r--toplevel/cerrors.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/toplevel/cerrors.ml b/toplevel/cerrors.ml
index db2f9ae9..3bba0605 100644
--- a/toplevel/cerrors.ml
+++ b/toplevel/cerrors.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: cerrors.ml 13431 2010-09-18 08:15:29Z herbelin $ *)
+(* $Id: cerrors.ml 13639 2010-11-16 15:36:01Z glondu $ *)
open Pp
open Util
@@ -81,6 +81,10 @@ let rec explain_exn_default_aux anomaly_string report_fn = function
hov 0 (str "Syntax error: Undefined token.")
| Lexer.Error (Bad_token s) ->
hov 0 (str "Syntax error: Bad token" ++ spc () ++ str s ++ str ".")
+ | Stdpp.Exc_located (loc,exc) ->
+ hov 0 ((if loc = dummy_loc then (mt ())
+ else (str"At location " ++ print_loc loc ++ str":" ++ fnl ()))
+ ++ explain_exn_default_aux anomaly_string report_fn exc)
| Assert_failure (s,b,e) ->
hov 0 (anomaly_string () ++ str "assert failure" ++ spc () ++
(if s <> "" then
@@ -167,10 +171,13 @@ let explain_exn_default =
let raise_if_debug e =
if !Flags.debug then raise e
-let _ = Tactic_debug.explain_logic_error := explain_exn_default
+let _ = Tactic_debug.explain_logic_error :=
+ (fun e -> explain_exn_default (process_vernac_interp_error e))
let _ = Tactic_debug.explain_logic_error_no_anomaly :=
- explain_exn_default_aux (fun () -> mt()) (fun () -> str ".")
+ (fun e ->
+ explain_exn_default_aux (fun () -> mt()) (fun () -> str ".")
+ (process_vernac_interp_error e))
let explain_exn_function = ref explain_exn_default