| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 library fasta.problems; | 5 library fasta.problems; |
| 6 | 6 |
| 7 import 'messages.dart' | 7 import 'messages.dart' |
| 8 show | 8 show |
| 9 Message, | 9 Message, |
| 10 deprecated_format, | 10 deprecated_format, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 if (message.tip != null) { | 27 if (message.tip != null) { |
| 28 text += "\n${message.tip}"; | 28 text += "\n${message.tip}"; |
| 29 } | 29 } |
| 30 if (uri == null && charOffset == -1) { | 30 if (uri == null && charOffset == -1) { |
| 31 throw text; | 31 throw text; |
| 32 } else { | 32 } else { |
| 33 throw deprecated_format(uri, charOffset, text); | 33 throw deprecated_format(uri, charOffset, text); |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 dynamic unimplemented(String what, int charOffset, Uri uri) { | 37 dynamic unimplemented(String what, [int charOffset = -1, Uri uri = null]) { |
| 38 return internalProblem( | 38 return internalProblem( |
| 39 templateInternalProblemUnimplemented.withArguments(what), | 39 templateInternalProblemUnimplemented.withArguments(what), |
| 40 charOffset, | 40 charOffset, |
| 41 uri); | 41 uri); |
| 42 } | 42 } |
| 43 | 43 |
| 44 dynamic unhandled(String what, String where, int charOffset, Uri uri) { | 44 dynamic unhandled(String what, String where, int charOffset, Uri uri) { |
| 45 return internalProblem( | 45 return internalProblem( |
| 46 templateInternalProblemUnhandled.withArguments(what, where), | 46 templateInternalProblemUnhandled.withArguments(what, where), |
| 47 charOffset, | 47 charOffset, |
| 48 uri); | 48 uri); |
| 49 } | 49 } |
| 50 | 50 |
| 51 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) { | 51 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) { |
| 52 return internalProblem( | 52 return internalProblem( |
| 53 templateInternalProblemUnexpected.withArguments(expected, actual), | 53 templateInternalProblemUnexpected.withArguments(expected, actual), |
| 54 charOffset, | 54 charOffset, |
| 55 uri); | 55 uri); |
| 56 } | 56 } |
| 57 | 57 |
| 58 dynamic unsupported(String operation, int charOffset, Uri uri) { | 58 dynamic unsupported(String operation, int charOffset, Uri uri) { |
| 59 return internalProblem( | 59 return internalProblem( |
| 60 templateInternalProblemUnsupported.withArguments(operation), | 60 templateInternalProblemUnsupported.withArguments(operation), |
| 61 charOffset, | 61 charOffset, |
| 62 uri); | 62 uri); |
| 63 } | 63 } |
| OLD | NEW |