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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java

Issue 668083002: Better recovery for getters in functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months 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: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
index b91421977f260c09ee4a7f7fe734e50859ecc9b1..9fc016270664ecd2047541b02aba81efe28b2f7c 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
@@ -2082,6 +2082,13 @@ public class Parser {
}
return tokenMatches(afterName, TokenType.FUNCTION)
|| tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
+ } else if (tokenMatchesKeyword(afterReturnType, Keyword.GET)) {
scheglov 2014/10/21 21:11:10 Should we also add a branch for Keyword.SET ?
Brian Wilkerson 2014/10/21 21:17:09 Turns out we don't need to because 'set' gets take
+ Token afterName = skipSimpleIdentifier(afterReturnType.getNext());
+ if (afterName == null) {
+ return false;
+ }
+ return tokenMatches(afterName, TokenType.FUNCTION)
+ || tokenMatches(afterName, TokenType.OPEN_CURLY_BRACKET);
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698