~ubuntu-branches/debian/sid/ocaml/sid

« back to all changes in this revision

Viewing changes to driver/opterrors.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2009-02-22 08:49:13 UTC
  • mfrom: (12.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090222084913-3i0uw2bhd0lgw0ok
* Uploading to unstable
* debian/control: bump dh-ocaml to (>= 0.4) to avoid buggy ocamlinit.mk

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
(*                                                                     *)
11
11
(***********************************************************************)
12
12
 
13
 
(* $Id: opterrors.ml,v 1.19 2006/04/16 23:28:21 doligez Exp $ *)
 
13
(* $Id: opterrors.ml,v 1.20 2007/12/04 13:38:58 doligez Exp $ *)
14
14
 
15
15
(* WARNING: if you change something in this file, you must look at
16
16
   errors.ml to see if you need to make the same changes there.
23
23
let report_error ppf exn =
24
24
  let report ppf = function
25
25
  | Lexer.Error(err, l) ->
26
 
      Location.print ppf l;
 
26
      Location.print_error ppf l;
27
27
      Lexer.report_error ppf err
28
28
  | Syntaxerr.Error err ->
29
29
      Syntaxerr.report_error ppf err
30
30
  | Pparse.Error ->
 
31
      Location.print_error_cur_file ppf;
31
32
      fprintf ppf "Preprocessor error"
32
33
  | Env.Error err ->
 
34
      Location.print_error_cur_file ppf;
33
35
      Env.report_error ppf err
34
 
  | Ctype.Tags(l, l') -> fprintf ppf
 
36
  | Ctype.Tags(l, l') ->
 
37
      Location.print_error_cur_file ppf;
 
38
      fprintf ppf
35
39
      "In this program,@ variant constructors@ `%s and `%s@ \
36
40
       have the same hash value.@ Change one of them." l l'
37
41
  | Typecore.Error(loc, err) ->
38
 
      Location.print ppf loc; Typecore.report_error ppf err
 
42
      Location.print_error ppf loc; Typecore.report_error ppf err
39
43
  | Typetexp.Error(loc, err) ->
40
 
      Location.print ppf loc; Typetexp.report_error ppf err
 
44
      Location.print_error ppf loc; Typetexp.report_error ppf err
41
45
  | Typedecl.Error(loc, err) ->
42
 
      Location.print ppf loc; Typedecl.report_error ppf err
 
46
      Location.print_error ppf loc; Typedecl.report_error ppf err
43
47
  | Typeclass.Error(loc, err) ->
44
 
      Location.print ppf loc; Typeclass.report_error ppf err
 
48
      Location.print_error ppf loc; Typeclass.report_error ppf err
45
49
  | Includemod.Error err ->
 
50
      Location.print_error_cur_file ppf;
46
51
      Includemod.report_error ppf err
47
52
  | Typemod.Error(loc, err) ->
48
 
      Location.print ppf loc; Typemod.report_error ppf err
 
53
      Location.print_error ppf loc; Typemod.report_error ppf err
49
54
  | Translcore.Error(loc, err) ->
50
 
      Location.print ppf loc; Translcore.report_error ppf err
 
55
      Location.print_error ppf loc; Translcore.report_error ppf err
51
56
  | Translclass.Error(loc, err) ->
52
 
      Location.print ppf loc; Translclass.report_error ppf err
 
57
      Location.print_error ppf loc; Translclass.report_error ppf err
53
58
  | Translmod.Error(loc, err) ->
54
 
      Location.print ppf loc; Translmod.report_error ppf err
 
59
      Location.print_error ppf loc; Translmod.report_error ppf err
55
60
  | Compilenv.Error code ->
 
61
      Location.print_error_cur_file ppf;
56
62
      Compilenv.report_error ppf code
57
63
  | Asmgen.Error code ->
 
64
      Location.print_error_cur_file ppf;
58
65
      Asmgen.report_error ppf code
59
66
  | Asmlink.Error code ->
 
67
      Location.print_error_cur_file ppf;
60
68
      Asmlink.report_error ppf code
61
69
  | Asmlibrarian.Error code ->
 
70
      Location.print_error_cur_file ppf;
62
71
      Asmlibrarian.report_error ppf code
63
72
  | Asmpackager.Error code ->
 
73
      Location.print_error_cur_file ppf;
64
74
      Asmpackager.report_error ppf code
65
75
  | Sys_error msg ->
 
76
      Location.print_error_cur_file ppf;
66
77
      fprintf ppf "I/O error: %s" msg
67
78
  | Warnings.Errors (n) ->
68
 
      fprintf ppf "@.Error: error-enabled warnings (%d occurrences)" n
 
79
      Location.print_error_cur_file ppf;
 
80
      fprintf ppf "Error-enabled warnings (%d occurrences)" n
69
81
  | x -> fprintf ppf "@]"; raise x in
70
82
 
71
83
  fprintf ppf "@[%a@]@." report exn