From 62522def7409a233f5316546cd6bee91e812a039 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Tue, 20 Jul 2010 13:55:56 -0700 Subject: Tidy up handling of unimplemented features. These are expected (if undesirable) sorts of error, we should handle better than "backtrace and exit 2". --- src/boot/driver/session.ml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/boot/driver/session.ml') diff --git a/src/boot/driver/session.ml b/src/boot/driver/session.ml index 80253f44..210dd7be 100644 --- a/src/boot/driver/session.ml +++ b/src/boot/driver/session.ml @@ -101,6 +101,19 @@ let filename_of (fo:filename option) : filename = | Some f -> f ;; +let report_err sess ido str = + let spano = match ido with + None -> None + | Some id -> get_span sess id + in + match spano with + None -> + fail sess "Error: %s\n%!" str + | Some span -> + fail sess "%s:E:Error: %s\n%!" + (string_of_span span) str +;; + (* * Local Variables: * fill-column: 78; -- cgit v1.2.3