| 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 class MessageKind { | 5 class MessageKind { |
| 6 final String template; | 6 final String template; |
| 7 const MessageKind(this.template); | 7 const MessageKind(this.template); |
| 8 | 8 |
| 9 static final GENERIC = const MessageKind('#{1}'); | 9 static final GENERIC = const MessageKind('#{1}'); |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 static final NO_CONTINUE_TARGET = const MessageKind( | 109 static final NO_CONTINUE_TARGET = const MessageKind( |
| 110 'continue statement not inside loop'); | 110 'continue statement not inside loop'); |
| 111 static final EXISTING_LABEL = const MessageKind( | 111 static final EXISTING_LABEL = const MessageKind( |
| 112 'original declaration of duplicate label #{1}'); | 112 'original declaration of duplicate label #{1}'); |
| 113 static final DUPLICATE_LABEL = const MessageKind( | 113 static final DUPLICATE_LABEL = const MessageKind( |
| 114 'duplicate declaration of label #{1}'); | 114 'duplicate declaration of label #{1}'); |
| 115 static final UNUSED_LABEL = const MessageKind( | 115 static final UNUSED_LABEL = const MessageKind( |
| 116 'unused label #{1}'); | 116 'unused label #{1}'); |
| 117 static final INVALID_CONTINUE = const MessageKind( | 117 static final INVALID_CONTINUE = const MessageKind( |
| 118 'target of continue is not a loop or switch case'); | 118 'target of continue is not a loop or switch case'); |
| 119 static final INVALID_BREAK = const MessageKind( |
| 120 'target of break is not a statement'); |
| 119 static final INVALID_USE_OF_SUPER = const MessageKind( | 121 static final INVALID_USE_OF_SUPER = const MessageKind( |
| 120 'super not allowed here'); | 122 'super not allowed here'); |
| 123 static final INVALID_CASE_DEFAULT = const MessageKind( |
| 124 'default only allowed on last case of a switch'); |
| 121 | 125 |
| 122 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( | 126 static final NOT_A_COMPILE_TIME_CONSTANT = const MessageKind( |
| 123 'not a compile-time constant'); | 127 'not a compile-time constant'); |
| 124 | 128 |
| 125 static final KEY_NOT_A_STRING_LITERAL = const MessageKind( | 129 static final KEY_NOT_A_STRING_LITERAL = const MessageKind( |
| 126 'map-literal key not a string literal'); | 130 'map-literal key not a string literal'); |
| 127 | 131 |
| 128 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( | 132 static final NO_SUCH_LIBRARY_MEMBER = const MessageKind( |
| 129 '#{1} has no member named #{2}'); | 133 '#{1} has no member named #{2}'); |
| 130 | 134 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 String toString() => message.toString(); | 201 String toString() => message.toString(); |
| 198 } | 202 } |
| 199 | 203 |
| 200 class CompileTimeConstantError { | 204 class CompileTimeConstantError { |
| 201 final Message message; | 205 final Message message; |
| 202 CompileTimeConstantError.message(this.message); | 206 CompileTimeConstantError.message(this.message); |
| 203 CompileTimeConstantError(MessageKind kind, List<Type> arguments) | 207 CompileTimeConstantError(MessageKind kind, List<Type> arguments) |
| 204 : message = new Message(kind, arguments); | 208 : message = new Message(kind, arguments); |
| 205 String toString() => message.toString(); | 209 String toString() => message.toString(); |
| 206 } | 210 } |
| OLD | NEW |