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

Unified Diff: sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart

Issue 675113002: Support async/await in the dart2js frontend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 6 years, 1 month 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: sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
diff --git a/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart b/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
index 98fc1ab3bf7344b2aece1bf2f08e7c0692f959b5..c6ccbf47c195864ec9bac83bfb4869b78336b903 100644
--- a/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
+++ b/sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart
@@ -103,8 +103,29 @@ class PartialParser extends Parser {
return endGroup;
}
+ Token skipAsyncModifier(Token token) {
+ String value = token.stringValue;
+ if (identical(value, 'async')) {
+ token = token.next;
+ value = token.stringValue;
+
+ if (identical(value, '*')) {
+ token = token.next;
+ }
+ } else if (identical(value, 'sync')) {
+ token = token.next;
+ value = token.stringValue;
+
+ if (identical(value, '*')) {
+ token = token.next;
+ }
+ }
+ return token;
+ }
+
Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
assert(!isExpression);
+ token = skipAsyncModifier(token);
String value = token.stringValue;
if (identical(value, ';')) {
if (!allowAbstract) {

Powered by Google App Engine
This is Rietveld 408576698