aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/compat.ml41
-rw-r--r--toplevel/cerrors.ml1
2 files changed, 2 insertions, 0 deletions
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) ->