| 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 /// The messages in this file should follow the [Guide for Writing | 5 /// The messages in this file should follow the [Guide for Writing |
| 6 /// Diagnostics](../../../../front_end/lib/src/fasta/diagnostics.md). | 6 /// Diagnostics](../../../../front_end/lib/src/fasta/diagnostics.md). |
| 7 /// | 7 /// |
| 8 /// Other things to keep in mind: | 8 /// Other things to keep in mind: |
| 9 /// | 9 /// |
| 10 /// An INFO message should always be preceded by a non-INFO message, and the | 10 /// An INFO message should always be preceded by a non-INFO message, and the |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 WRONG_ARGUMENT_FOR_JS_FIRST, | 420 WRONG_ARGUMENT_FOR_JS_FIRST, |
| 421 WRONG_ARGUMENT_FOR_JS_SECOND, | 421 WRONG_ARGUMENT_FOR_JS_SECOND, |
| 422 WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, | 422 WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT, |
| 423 WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, | 423 WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT, |
| 424 YIELDING_MODIFIER_ON_ARROW_BODY, | 424 YIELDING_MODIFIER_ON_ARROW_BODY, |
| 425 } | 425 } |
| 426 | 426 |
| 427 /// A message template for an error, warning, hint or info message generated | 427 /// A message template for an error, warning, hint or info message generated |
| 428 /// by the compiler. Each template is associated with a [MessageKind] that | 428 /// by the compiler. Each template is associated with a [MessageKind] that |
| 429 /// uniquely identifies the message template. | 429 /// uniquely identifies the message template. |
| 430 // TODO(johnnniwinther): For Infos, consider adding a reference to the | 430 // TODO(johnniwinther): For Infos, consider adding a reference to the |
| 431 // error/warning/hint that they belong to. | 431 // error/warning/hint that they belong to. |
| 432 class MessageTemplate { | 432 class MessageTemplate { |
| 433 final MessageKind kind; | 433 final MessageKind kind; |
| 434 | 434 |
| 435 /// Should describe what is wrong and why. | 435 /// Should describe what is wrong and why. |
| 436 final String template; | 436 final String template; |
| 437 | 437 |
| 438 /// Should describe how to fix the problem. Elided when using --terse option. | 438 /// Should describe how to fix the problem. Elided when using --terse option. |
| 439 final String howToFix; | 439 final String howToFix; |
| 440 | 440 |
| (...skipping 3351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3792 static String convertToString(value) { | 3792 static String convertToString(value) { |
| 3793 if (value is ErrorToken) { | 3793 if (value is ErrorToken) { |
| 3794 // Shouldn't happen. | 3794 // Shouldn't happen. |
| 3795 return value.assertionMessage; | 3795 return value.assertionMessage; |
| 3796 } else if (value is Token) { | 3796 } else if (value is Token) { |
| 3797 value = value.lexeme; | 3797 value = value.lexeme; |
| 3798 } | 3798 } |
| 3799 return '$value'; | 3799 return '$value'; |
| 3800 } | 3800 } |
| 3801 } | 3801 } |
| OLD | NEW |