From fb78828587a7ff9e39b3f1eaa1cf0786c7adf81e Mon Sep 17 00:00:00 2001 From: letouzey Date: Tue, 1 Jun 2010 14:28:53 +0000 Subject: restore handling of lexer errors git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13044 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/compat.ml4 | 1 + toplevel/cerrors.ml | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/compat.ml4 b/lib/compat.ml4 index aba2720456..312860a63e 100644 --- a/lib/compat.ml4 +++ b/lib/compat.ml4 @@ -80,6 +80,7 @@ module type LexerSig = sig module Error : sig type t exception E of t + val to_string : t -> string end end diff --git a/toplevel/cerrors.ml b/toplevel/cerrors.ml index 1f5bbc5210..24e770d10b 100644 --- a/toplevel/cerrors.ml +++ b/toplevel/cerrors.ml @@ -35,6 +35,7 @@ let rec explain_exn_default_aux anomaly_string report_fn = function hov 0 (str "Syntax error: " ++ str txt ++ str ".") | Token.Error txt -> hov 0 (str "Syntax error: " ++ str txt ++ str ".") + | Lexer.Error.E err -> hov 0 (str (Lexer.Error.to_string err)) | Sys_error msg -> hov 0 (anomaly_string () ++ str "uncaught exception Sys_error " ++ str (guill msg) ++ report_fn ()) | UserError(s,pps) -> -- cgit v1.2.3