Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Side by Side Diff: pkg/front_end/lib/src/fasta/problems.dart

Issue 2980273002: Random improvements in error reporting. (Closed)
Patch Set: rebased Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta_codes_generated.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 'compiler_context.dart' show CompilerContext; 7 import 'compiler_context.dart' show CompilerContext;
8 8
9 import 'messages.dart' 9 import 'messages.dart'
10 show 10 show
(...skipping 12 matching lines...) Expand all
23 /// and contain a short description that may help a developer debug the issue. 23 /// and contain a short description that may help a developer debug the issue.
24 /// This method should be called instead of using `throw`, as this allows us to 24 /// This method should be called instead of using `throw`, as this allows us to
25 /// ensure that there are no throws anywhere else in the codebase. 25 /// ensure that there are no throws anywhere else in the codebase.
26 /// 26 ///
27 /// Before printing the message, the string `"Internal error: "` is prepended. 27 /// Before printing the message, the string `"Internal error: "` is prepended.
28 dynamic internalProblem(Message message, int charOffset, Uri uri) { 28 dynamic internalProblem(Message message, int charOffset, Uri uri) {
29 throw CompilerContext.current 29 throw CompilerContext.current
30 .format(message.withLocation(uri, charOffset), Severity.internalProblem); 30 .format(message.withLocation(uri, charOffset), Severity.internalProblem);
31 } 31 }
32 32
33 dynamic unimplemented(String what, [int charOffset = -1, Uri uri = null]) { 33 dynamic unimplemented(String what, int charOffset, Uri uri) {
34 return internalProblem( 34 return internalProblem(
35 templateInternalProblemUnimplemented.withArguments(what), 35 templateInternalProblemUnimplemented.withArguments(what),
36 charOffset, 36 charOffset,
37 uri); 37 uri);
38 } 38 }
39 39
40 dynamic unhandled(String what, String where, int charOffset, Uri uri) { 40 dynamic unhandled(String what, String where, int charOffset, Uri uri) {
41 return internalProblem( 41 return internalProblem(
42 templateInternalProblemUnhandled.withArguments(what, where), 42 templateInternalProblemUnhandled.withArguments(what, where),
43 charOffset, 43 charOffset,
44 uri); 44 uri);
45 } 45 }
46 46
47 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) { 47 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) {
48 return internalProblem( 48 return internalProblem(
49 templateInternalProblemUnexpected.withArguments(expected, actual), 49 templateInternalProblemUnexpected.withArguments(expected, actual),
50 charOffset, 50 charOffset,
51 uri); 51 uri);
52 } 52 }
53 53
54 dynamic unsupported(String operation, int charOffset, Uri uri) { 54 dynamic unsupported(String operation, int charOffset, Uri uri) {
55 return internalProblem( 55 return internalProblem(
56 templateInternalProblemUnsupported.withArguments(operation), 56 templateInternalProblemUnsupported.withArguments(operation),
57 charOffset, 57 charOffset,
58 uri); 58 uri);
59 } 59 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/fasta_codes_generated.dart ('k') | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698