From 659ca3902a144259ec449473e95df1b3eda1b6de Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Mon, 17 Nov 2014 10:22:31 +0100 Subject: Setting error tag on generic errors returned by Coqtop. --- printing/ppstyle.mli | 11 +++++++++++ toplevel/cerrors.ml | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/printing/ppstyle.mli b/printing/ppstyle.mli index 5fd9e074d8..700ec4314e 100644 --- a/printing/ppstyle.mli +++ b/printing/ppstyle.mli @@ -51,3 +51,14 @@ val init_color_output : unit -> unit {!Pp_control.std_ft} and {!Pp_control.err_ft} to display those messages, with additional syle information provided by this module. Be careful this is not compatible with the Emacs mode! *) + +(** {5 Tags} *) + +val error_tag : t +(** Tag used by the {!Pp.msg_error} function. *) + +val warning_tag : t +(** Tag used by the {!Pp.msg_warning} function. *) + +val debug_tag : t +(** Tag used by the {!Pp.msg_debug} function. *) diff --git a/toplevel/cerrors.ml b/toplevel/cerrors.ml index 09ec5ce18d..8c98c813a1 100644 --- a/toplevel/cerrors.ml +++ b/toplevel/cerrors.ml @@ -54,7 +54,8 @@ let _ = Errors.register_handler explain_exn_default (** Pre-explain a vernac interpretation error *) let wrap_vernac_error exn strm = - let e = EvaluatedError (hov 0 (str "Error:" ++ spc () ++ strm), None) in + let header = Pp.tag (Pp.Tag.inj Ppstyle.error_tag Ppstyle.tag) (str "Error:") in + let e = EvaluatedError (hov 0 (header ++ spc () ++ strm), None) in Exninfo.copy exn e let process_vernac_interp_error exn = match exn with -- cgit v1.2.3