OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
6 | 6 |
7 /** | 7 /** |
8 * Valid error codes for the errors produced by the Dart compiler. | 8 * Valid error codes for the errors produced by the Dart compiler. |
9 */ | 9 */ |
10 public enum DartCompilerErrorCode implements ErrorCode { | 10 public enum DartCompilerErrorCode implements ErrorCode { |
| 11 COULD_NOT_PARSE_IMPORT("Could not parse import: %s"), |
11 ENTRY_POINT_METHOD_CANNOT_HAVE_PARAMETERS("Main entry point method cannot have
parameters"), | 12 ENTRY_POINT_METHOD_CANNOT_HAVE_PARAMETERS("Main entry point method cannot have
parameters"), |
12 ENTRY_POINT_METHOD_MAY_NOT_BE_GETTER("Entry point \"%s\" may not be a getter")
, | 13 ENTRY_POINT_METHOD_MAY_NOT_BE_GETTER("Entry point \"%s\" may not be a getter")
, |
13 ENTRY_POINT_METHOD_MAY_NOT_BE_SETTER("Entry point \"%s\" may not be a setter")
, | 14 ENTRY_POINT_METHOD_MAY_NOT_BE_SETTER("Entry point \"%s\" may not be a setter")
, |
14 ILLEGAL_DIRECTIVES_IN_SOURCED_UNIT("A source which was included by another sou
rce via a " | 15 ILLEGAL_DIRECTIVES_IN_SOURCED_UNIT("A source which was included by another sou
rce via a " |
15 + "#source directive cannot itself contain directives: %s"), | 16 + "#source directive cannot itself contain directives: %s"), |
16 IO("Input/Output error: %s"), | 17 IO("Input/Output error: %s"), |
17 MISSING_LIBRARY_DIRECTIVE("a library which is imported is missing a #library d
irective: %s"), | 18 MISSING_LIBRARY_DIRECTIVE("a library which is imported is missing a #library d
irective: %s"), |
18 MISSING_SOURCE("Cannot find referenced source: %s"), | 19 MISSING_SOURCE("Cannot find referenced source: %s"), |
19 NO_ENTRY_POINT("No entrypoint specified for app"); | 20 NO_ENTRY_POINT("No entrypoint specified for app"); |
20 private final ErrorSeverity severity; | 21 private final ErrorSeverity severity; |
21 private final String message; | 22 private final String message; |
22 | 23 |
23 /** | 24 /** |
24 * Initialize a newly created error code to have the given message and ERROR s
everity. | 25 * Initialize a newly created error code to have the given message and ERROR s
everity. |
25 */ | 26 */ |
26 private DartCompilerErrorCode(String message) { | 27 private DartCompilerErrorCode(String message) { |
27 this(ErrorSeverity.ERROR, message); | 28 this(ErrorSeverity.ERROR, message); |
28 } | 29 } |
29 | 30 |
30 /** | 31 /** |
31 * Initialize a newly created error code to have the given severity and messag
e. | 32 * Initialize a newly created error code to have the given severity and messag
e. |
32 */ | 33 */ |
33 private DartCompilerErrorCode(ErrorSeverity severity, String message) { | 34 private DartCompilerErrorCode(ErrorSeverity severity, String message) { |
34 this.severity = severity; | 35 this.severity = severity; |
35 this.message = message; | 36 this.message = message; |
36 } | 37 } |
37 | 38 |
| 39 @Override |
38 public String getMessage() { | 40 public String getMessage() { |
39 return message; | 41 return message; |
40 } | 42 } |
41 | 43 |
| 44 @Override |
42 public ErrorSeverity getErrorSeverity() { | 45 public ErrorSeverity getErrorSeverity() { |
43 return severity; | 46 return severity; |
44 } | 47 } |
45 | 48 |
| 49 @Override |
46 public SubSystem getSubSystem() { | 50 public SubSystem getSubSystem() { |
47 return SubSystem.COMPILER; | 51 return SubSystem.COMPILER; |
48 } | 52 } |
49 } | 53 } |
OLD | NEW |