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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 11280155: Issue 6908. Fix parsing look for receiver.() in switch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698