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

Unified Diff: pkg/compiler/lib/src/parser/element_listener.dart

Issue 2754793004: Update messages.yaml with asynchronous messages. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | pkg/front_end/messages.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/parser/element_listener.dart
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
index 181499da733a8e775c043b9006890643703f7675..d3d481a7d6b43e9daa1affac0046093b810b51a7 100644
--- a/pkg/compiler/lib/src/parser/element_listener.dart
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -742,35 +742,6 @@ class ElementListener extends Listener {
arguments = {"text": "Can't use '${token.lexeme}' as a name here."};
break;
- case ErrorKind.AbstractNotSync:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "Abstract methods can't use 'async', 'async*', or 'sync*'."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
- case ErrorKind.SetterNotSync:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "Setters can't use 'async', 'async*', or 'sync*'."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
- case ErrorKind.FactoryNotSync:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "Factories can't use 'async', 'async*', or 'sync*'."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
- case ErrorKind.AwaitForNotAsync:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "Asynchronous for-loop can only be used "
- "in 'async' or 'async*' methods."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
case ErrorKind.AsyncAsIdentifier:
errorCode = MessageKind.GENERIC;
arguments = {
@@ -779,39 +750,15 @@ class ElementListener extends Listener {
};
break;
+ case ErrorKind.AbstractNotSync:
+ case ErrorKind.SetterNotSync:
+ case ErrorKind.FactoryNotSync:
+ case ErrorKind.AwaitForNotAsync:
case ErrorKind.YieldNotGenerator:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "'yield' can only be used in 'sync*' or 'async*' methods."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
case ErrorKind.YieldAsIdentifier:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "'yield' can't be used as an identifier in "
- "'async', 'async*', or 'sync*' methods."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
case ErrorKind.GeneratorReturnsValue:
- errorCode = MessageKind.GENERIC;
- arguments = {"text": "'sync*' and 'async*' can't return a value."};
- return; // Ignored. This error is already implemented elsewhere.
-
case ErrorKind.AwaitNotAsync:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "'await' can only be used in 'async' or 'async*' methods."
- };
- return; // Ignored. This error is already implemented elsewhere.
-
case ErrorKind.AwaitAsIdentifier:
- errorCode = MessageKind.GENERIC;
- arguments = {
- "text": "'await' can't be used as an identifier in "
- "'async', 'async*', or 'sync*' methods."
- };
return; // Ignored. This error is already implemented elsewhere.
}
SourceSpan span = reporter.spanFromToken(token);
« no previous file with comments | « no previous file | pkg/front_end/messages.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698