| Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| index dffb6799ac861dbd73aee0e5806071fd3085aa55..01b83a98f6fe31d52d2ad921598b931647fbd3e5 100644
|
| --- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| +++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| @@ -166,8 +166,8 @@ public class DartParser extends CompletionHooksParserBase {
|
| this(ctx, false);
|
| }
|
|
|
| - public DartParser(ParserContext ctx, Set<String> prefixes) {
|
| - this(ctx, false, prefixes);
|
| + public DartParser(ParserContext ctx, Set<String> prefixes, boolean isDietParse) {
|
| + this(ctx, isDietParse, prefixes);
|
| }
|
|
|
| public DartParser(ParserContext ctx, boolean isDietParse) {
|
| @@ -2715,20 +2715,29 @@ public class DartParser extends CompletionHooksParserBase {
|
| */
|
| private DartBlock parseFunctionStatementBody(boolean requireSemicolonForArrow) {
|
| if (isDietParse) {
|
| - expect(Token.LBRACE);
|
| DartBlock emptyBlock = new DartBlock(new ArrayList<DartStatement>());
|
| - int nesting = 1;
|
| - while (nesting > 0) {
|
| - Token token = next();
|
| - switch (token) {
|
| - case LBRACE:
|
| - ++nesting;
|
| - break;
|
| - case RBRACE:
|
| - --nesting;
|
| + if (optional(Token.ARROW)) {
|
| + while (true) {
|
| + Token token = next();
|
| + if (token == Token.SEMICOLON) {
|
| break;
|
| - case EOS:
|
| - return emptyBlock;
|
| + }
|
| + }
|
| + } else {
|
| + expect(Token.LBRACE);
|
| + int nesting = 1;
|
| + while (nesting > 0) {
|
| + Token token = next();
|
| + switch (token) {
|
| + case LBRACE:
|
| + ++nesting;
|
| + break;
|
| + case RBRACE:
|
| + --nesting;
|
| + break;
|
| + case EOS:
|
| + return emptyBlock;
|
| + }
|
| }
|
| }
|
| // Return an empty block so we don't generate unparseable code.
|
|
|