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

Unified Diff: pkg/front_end/lib/src/fasta/source/stack_listener.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/source/stack_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/stack_listener.dart b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
index f1bfcf53923aff07d5704f66fb244406b8a09f3a..18cfd42cea03f5112ac42b95364e052fc6245152 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -16,7 +16,8 @@ import '../../scanner/token.dart' show BeginToken;
import 'package:kernel/ast.dart' show AsyncMarker, Expression;
-import '../errors.dart' show inputError, internalError;
+import '../deprecated_problems.dart'
+ show deprecated_inputError, deprecated_internalProblem;
import '../quote.dart' show unescapeString;
@@ -64,21 +65,21 @@ abstract class StackListener extends Listener {
// and ast_builder.dart.
void finishFunction(List annotations, covariant formals,
AsyncMarker asyncModifier, covariant body) {
- return internalError("Unsupported operation");
+ return deprecated_internalProblem("Unsupported operation");
}
// TODO(ahe): This doesn't belong here. Only implemented by body_builder.dart
// and ast_builder.dart.
List<Expression> finishMetadata() {
- return internalError("Unsupported operation");
+ return deprecated_internalProblem("Unsupported operation");
}
// TODO(ahe): This doesn't belong here. Only implemented by body_builder.dart
// and ast_builder.dart.
- void exitLocalScope() => internalError("Unsupported operation");
+ void exitLocalScope() => deprecated_internalProblem("Unsupported operation");
void push(Object node) {
- if (node == null) internalError("null not allowed.");
+ if (node == null) deprecated_internalProblem("null not allowed.");
stack.push(node);
}
@@ -113,7 +114,7 @@ abstract class StackListener extends Listener {
@override
void logEvent(String name) {
- internalError("Unhandled event: $name in $runtimeType $uri:\n"
+ deprecated_internalProblem("Unhandled event: $name in $runtimeType $uri:\n"
" ${stack.values.join('\n ')}");
}
@@ -136,7 +137,7 @@ abstract class StackListener extends Listener {
void checkEmpty(int charOffset) {
if (stack.isNotEmpty) {
- internalError(
+ deprecated_internalProblem(
"${runtimeType}: Stack not empty:\n"
" ${stack.values.join('\n ')}",
uri,
@@ -144,7 +145,8 @@ abstract class StackListener extends Listener {
}
if (recoverableErrors.isNotEmpty) {
// TODO(ahe): Handle recoverable errors better.
- inputError(uri, recoverableErrors.first.beginOffset, recoverableErrors);
+ deprecated_inputError(
+ uri, recoverableErrors.first.beginOffset, recoverableErrors);
}
}
@@ -225,7 +227,7 @@ abstract class StackListener extends Listener {
Token token = pop();
push(unescapeString(token.lexeme));
} else {
- internalError("String interpolation not implemented.");
+ deprecated_internalProblem("String interpolation not implemented.");
}
}
@@ -265,15 +267,15 @@ abstract class StackListener extends Listener {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
- throw inputError(uri, token.charOffset, message.message);
+ throw deprecated_inputError(uri, token.charOffset, message.message);
}
- void nit(String message, [int charOffset = -1]) {
- messages.nit(uri, charOffset, message);
+ void deprecated_nit(String message, [int charOffset = -1]) {
+ messages.deprecated_nit(uri, charOffset, message);
}
- void warning(String message, [int charOffset = -1]) {
- messages.warning(uri, charOffset, message);
+ void deprecated_warning(String message, [int charOffset = -1]) {
+ messages.deprecated_warning(uri, charOffset, message);
}
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/source_loader.dart ('k') | pkg/front_end/lib/src/fasta/testing/environment_variable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698