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

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

Issue 2975823002: Remove all deprecated fasta message methods from analyzer. (Closed)
Patch Set: 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library fasta.problems;
6
7 import 'messages.dart'
8 show
9 Message,
10 deprecated_format,
11 templateUnexpected,
12 templateUnhandled,
13 templateUnimplemented,
14 templateUnsupported;
15
16 /// Used to report an internal error.
17 ///
18 /// Internal errors should be avoided as best as possible, but are preferred
19 /// over assertion failures. The message should contain a short description
20 /// that may help a developer debug the issue. This method should be called
21 /// instead of using `throw`, as this allows us to ensure that there are no
22 /// throws anywhere else in the codebase.
23 dynamic internalProblem(Message message, int charOffset, Uri uri) {
24 String text = "Internal problem: ${message.message}";
25 if (uri == null && charOffset == -1) {
26 throw text;
27 } else {
28 throw deprecated_format(uri, charOffset, text);
29 }
30 }
31
32 dynamic unimplemented(String what, int charOffset, Uri uri) {
33 return internalProblem(
34 templateUnimplemented.withArguments(what), charOffset, uri);
35 }
36
37 dynamic unhandled(String what, String where, int charOffset, Uri uri) {
38 return internalProblem(
39 templateUnhandled.withArguments(what, where), charOffset, uri);
40 }
41
42 dynamic unexpected(String expected, String actual, int charOffset, Uri uri) {
43 return internalProblem(
44 templateUnexpected.withArguments(expected, actual), charOffset, uri);
45 }
46
47 dynamic unsupported(String operation, int charOffset, Uri uri) {
48 return internalProblem(
49 templateUnsupported.withArguments(operation), charOffset, uri);
50 }
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