diff options
Diffstat (limited to 'driver/errors.ml')
-rw-r--r-- | driver/errors.ml | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/driver/errors.ml b/driver/errors.ml index 56c4e2f3cb..22dd1fc6a0 100644 --- a/driver/errors.ml +++ b/driver/errors.ml @@ -13,7 +13,8 @@ (* $Id$ *) (* WARNING: if you change something in this file, you must look at - opterrors.ml to see if you need to make the same changes there. + opterrors.ml and ocamldoc/odoc_analyse.ml + to see if you need to make the same changes there. *) open Format @@ -23,47 +24,58 @@ open Format let report_error ppf exn = let report ppf = function | Lexer.Error(err, loc) -> - Location.print ppf loc; + Location.print_error ppf loc; Lexer.report_error ppf err | Syntaxerr.Error err -> Syntaxerr.report_error ppf err | Pparse.Error -> + Location.print_error_cur_file ppf; fprintf ppf "Preprocessor error" | Env.Error err -> + Location.print_error_cur_file ppf; Env.report_error ppf err - | Ctype.Tags(l, l') -> fprintf ppf + | Ctype.Tags(l, l') -> + Location.print_error_cur_file ppf; + fprintf ppf "In this program,@ variant constructors@ `%s and `%s@ \ have the same hash value.@ Change one of them." l l' | Typecore.Error(loc, err) -> - Location.print ppf loc; Typecore.report_error ppf err + Location.print_error ppf loc; Typecore.report_error ppf err | Typetexp.Error(loc, err) -> - Location.print ppf loc; Typetexp.report_error ppf err + Location.print_error ppf loc; Typetexp.report_error ppf err | Typedecl.Error(loc, err) -> - Location.print ppf loc; Typedecl.report_error ppf err + Location.print_error ppf loc; Typedecl.report_error ppf err | Typeclass.Error(loc, err) -> - Location.print ppf loc; Typeclass.report_error ppf err + Location.print_error ppf loc; Typeclass.report_error ppf err | Includemod.Error err -> + Location.print_error_cur_file ppf; Includemod.report_error ppf err | Typemod.Error(loc, err) -> - Location.print ppf loc; Typemod.report_error ppf err + Location.print_error ppf loc; Typemod.report_error ppf err | Translcore.Error(loc, err) -> - Location.print ppf loc; Translcore.report_error ppf err + Location.print_error ppf loc; Translcore.report_error ppf err | Translclass.Error(loc, err) -> - Location.print ppf loc; Translclass.report_error ppf err + Location.print_error ppf loc; Translclass.report_error ppf err | Translmod.Error(loc, err) -> - Location.print ppf loc; Translmod.report_error ppf err + Location.print_error ppf loc; Translmod.report_error ppf err | Symtable.Error code -> + Location.print_error_cur_file ppf; Symtable.report_error ppf code | Bytelink.Error code -> + Location.print_error_cur_file ppf; Bytelink.report_error ppf code | Bytelibrarian.Error code -> + Location.print_error_cur_file ppf; Bytelibrarian.report_error ppf code | Bytepackager.Error code -> + Location.print_error_cur_file ppf; Bytepackager.report_error ppf code | Sys_error msg -> + Location.print_error_cur_file ppf; fprintf ppf "I/O error: %s" msg | Warnings.Errors (n) -> - fprintf ppf "@.Error: error-enabled warnings (%d occurrences)" n + Location.print_error_cur_file ppf; + fprintf ppf "Error-enabled warnings (%d occurrences)" n | x -> fprintf ppf "@]"; raise x in fprintf ppf "@[%a@]@." report exn |