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

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

Issue 8774024: Parse method names that include type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Feedback from mmedendez Created 9 years 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/resolver/ResolverTest.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 52fc45067e17a5d50203226d17950380ab68bff8..b93b69428df19ab01a8bd07cfc432d6136b1a7a7 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -961,24 +961,20 @@ public class DartParser extends CompletionHooksParserBase {
consume(Token.IDENTIFIER);
if (peek(0).equals(Token.PERIOD) && peek(1).equals(Token.IDENTIFIER)) {
- // Case 1 a constructor of the form class.id
- if (peek(0).equals(Token.LPAREN)) {
- return true;
- }
-
// Case 2, a constructor of the form library.class.<typearguments?>.id
codefu 2011/12/02 13:51:21 There's no more case 1 prior to this comment.
consume(Token.PERIOD);
consume(Token.IDENTIFIER);
- parseTypeArgumentsOpt();
- if (peek(0).equals(Token.PERIOD) && peek(1).equals(Token.IDENTIFIER) && peek(2).equals(Token.LPAREN)) {
+ parseTypeArgumentsOpt();
codefu 2011/12/02 13:51:21 ws
+ if (peek(0).equals(Token.PERIOD) && peek(1).equals(Token.IDENTIFIER)
+ && peek(2).equals(Token.LPAREN)) {
return true;
}
+ } else {
+ // Case 1 class.id<typearguments>
+ // Case 3, id<typearguments?>
+ parseTypeArgumentsOpt();
}
- // Case 1 class.id<typearguments>
- // Case 3, id<typearguments?>
- parseTypeArgumentsOpt();
-
if (peek(0).equals(Token.PERIOD) && peek(1).equals(Token.IDENTIFIER)) {
// Case 1, a constructor of the form class<typearguments>.id
consume(Token.PERIOD);
@@ -1089,9 +1085,8 @@ public class DartParser extends CompletionHooksParserBase {
} else {
// Normal method or property.
name = parseIdentifier();
-
// TODO(zundel): something constructive with the type arguments
- parseTypeArgumentsOpt();
+ parseTypeArgumentsOpt();
}
// Check for named constructor.
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698