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

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

Issue 57383007: Issue 14452. Fix for skipping 'final' modifier in function expression parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 29a42ec4be4308a45df26d4f229809b629637f4b..5afbc59ccd7f3b09ab982429ee1447f2a27adbf6 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
@@ -5692,9 +5692,15 @@ public class Parser {
private Token skipFinalConstVarOrType(Token startToken) {
if (matches(startToken, Keyword.FINAL) || matches(startToken, Keyword.CONST)) {
Token next = startToken.getNext();
- if (matchesIdentifier(next.getNext()) || matches(next.getNext(), TokenType.LT)
- || matches(next.getNext(), Keyword.THIS)) {
- return skipTypeName(next);
+ if (matchesIdentifier(next)) {
+ Token next2 = next.getNext();
+ // "Type parameter" or "Type<" or "prefix.Type"
+ if (matchesIdentifier(next2) || matches(next2, TokenType.LT)
+ || matches(next2, TokenType.PERIOD)) {
+ return skipTypeName(next);
+ }
+ // "parameter"
+ return next;
}
} else if (matches(startToken, Keyword.VAR)) {
return startToken.getNext();
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/SimpleParserTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698