| 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 | 5 |
| 6 /** | 6 /** |
| 7 * The messages in this file should meet the following guide lines: | 7 * The messages in this file should meet the following guide lines: |
| 8 * | 8 * |
| 9 * 1. The message should be a complete sentence starting with an uppercase | 9 * 1. The message should be a complete sentence starting with an uppercase |
| 10 * letter, and ending with a period. | 10 * letter, and ending with a period. |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // The key type is a union of MessageKind and SharedMessageKind. | 511 // The key type is a union of MessageKind and SharedMessageKind. |
| 512 static final Map<dynamic, MessageTemplate> TEMPLATES = | 512 static final Map<dynamic, MessageTemplate> TEMPLATES = |
| 513 <dynamic, MessageTemplate>{} | 513 <dynamic, MessageTemplate>{} |
| 514 ..addAll(shared_messages.TEMPLATES) | 514 ..addAll(shared_messages.TEMPLATES) |
| 515 ..addAll(const<MessageKind, MessageTemplate>{ | 515 ..addAll(const<MessageKind, MessageTemplate>{ |
| 516 /// Do not use this. It is here for legacy and debugging. It violates item | 516 /// Do not use this. It is here for legacy and debugging. It violates item |
| 517 /// 4 of the guide lines for error messages in the beginning of the file. | 517 /// 4 of the guide lines for error messages in the beginning of the file. |
| 518 MessageKind.GENERIC: | 518 MessageKind.GENERIC: |
| 519 const MessageTemplate(MessageKind.GENERIC, '#{text}'), | 519 const MessageTemplate(MessageKind.GENERIC, '#{text}'), |
| 520 | 520 |
| 521 MessageKind.NOT_ASSIGNABLE: | |
| 522 const MessageTemplate(MessageKind.NOT_ASSIGNABLE, | |
| 523 "'#{fromType}' is not assignable to '#{toType}'."), | |
| 524 | |
| 525 MessageKind.FORIN_NOT_ASSIGNABLE: | |
| 526 const MessageTemplate(MessageKind.FORIN_NOT_ASSIGNABLE, | |
| 527 "The element type '#{currentType}' of '#{expressionType}' " | |
| 528 "is not assignable to '#{elementType}'."), | |
| 529 | |
| 530 MessageKind.VOID_EXPRESSION: | 521 MessageKind.VOID_EXPRESSION: |
| 531 const MessageTemplate(MessageKind.VOID_EXPRESSION, | 522 const MessageTemplate(MessageKind.VOID_EXPRESSION, |
| 532 "Expression does not yield a value."), | 523 "Expression does not yield a value."), |
| 533 | 524 |
| 534 MessageKind.VOID_VARIABLE: | 525 MessageKind.VOID_VARIABLE: |
| 535 const MessageTemplate(MessageKind.VOID_VARIABLE, | 526 const MessageTemplate(MessageKind.VOID_VARIABLE, |
| 536 "Variable cannot be of type void."), | 527 "Variable cannot be of type void."), |
| 537 | 528 |
| 538 MessageKind.RETURN_VALUE_IN_VOID: | 529 MessageKind.RETURN_VALUE_IN_VOID: |
| 539 const MessageTemplate(MessageKind.RETURN_VALUE_IN_VOID, | 530 const MessageTemplate(MessageKind.RETURN_VALUE_IN_VOID, |
| (...skipping 3124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3664 static String convertToString(value) { | 3655 static String convertToString(value) { |
| 3665 if (value is ErrorToken) { | 3656 if (value is ErrorToken) { |
| 3666 // Shouldn't happen. | 3657 // Shouldn't happen. |
| 3667 return value.assertionMessage; | 3658 return value.assertionMessage; |
| 3668 } else if (value is Token) { | 3659 } else if (value is Token) { |
| 3669 value = value.value; | 3660 value = value.value; |
| 3670 } | 3661 } |
| 3671 return '$value'; | 3662 return '$value'; |
| 3672 } | 3663 } |
| 3673 } | 3664 } |
| OLD | NEW |