Chromium Code Reviews| 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 a79148c2fa09144518d66679bebd9128e61ff3b8..eabae9d84de725880df53cb3af19d6ec4c14542d 100644 |
| --- a/compiler/java/com/google/dart/compiler/parser/DartParser.java |
| +++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java |
| @@ -3842,6 +3842,21 @@ public class DartParser extends CompletionHooksParserBase { |
| DartIdentifier error = doneWithoutConsuming(new DartIdentifier("")); |
| return doneWithoutConsuming(new DartPropertyAccess(receiver, error)); |
| } |
| + // receiver.() = missing name |
| + if (peek(0) == Token.LPAREN) { |
| + reportUnexpectedToken(position(), Token.IDENTIFIER, peek(0)); |
| + DartIdentifier name; |
| + { |
| + beginIdentifier(); |
|
Brian Wilkerson
2012/11/26 15:47:58
nit: This would be cleaner code if it were not ins
|
| + name = done(new DartSyntheticErrorIdentifier()); |
| + } |
| + boolean save = setAllowFunctionExpression(true); |
| + DartMethodInvocation expr = doneWithoutConsuming(new DartMethodInvocation(receiver, |
| + false, name, parseArguments())); |
| + setAllowFunctionExpression(save); |
| + return expr; |
| + } |
| + // expect name |
| DartIdentifier name = parseIdentifier(); |
| if (peek(0) == Token.LPAREN) { |
| boolean save = setAllowFunctionExpression(true); |