Chromium Code Reviews| 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..b2bce8316d42945b9941782be5914e8bf1de1868 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) { |
| @@ -112,14 +133,16 @@ class PartialParser extends Parser { |
| } |
| listener.handleNoFunctionBody(token); |
| } else { |
| - if (identical(value, '=>')) { |
| - token = parseExpression(token.next); |
| - expectSemicolon(token); |
| - } else if (value == '=') { |
| + if (value == '=') { |
| token = parseRedirectingFactoryBody(token); |
| expectSemicolon(token); |
| } else { |
| - token = skipBlock(token); |
| + if (identical(value, '=>')) { |
|
floitsch
2014/11/03 17:55:54
I prefer the 'else if' indentation.
Why this chan
Johnni Winther
2014/11/04 12:24:33
Done.
|
| + token = parseExpression(token.next); |
| + expectSemicolon(token); |
| + } else { |
| + token = skipBlock(token); |
| + } |
| } |
| listener.skippedFunctionBody(token); |
| } |