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

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

Issue 8662019: Support for parsing returning qualified type. Issue 513. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak write spaces Created 9 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/java/com/google/dart/compiler/resolver/ResolutionContext.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 d671a99e674995f55b18c2437ae332aedec1b878..d003a246519cda6e252fdfc8b8610a6aaa41ad40 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -888,9 +888,23 @@ public class DartParser extends CompletionHooksParserBase {
case VOID:
case IDENTIFIER: {
- // Check to see if it's a method/ctor.
+ // Check to see if it's a qualified ctor.
+ {
+ // Skip (PERIOD IDENTIFIER)* sequence.
+ // Actually only one is valid, but it is OK for parser.
+ int k = 1;
+ while (peek(k) == Token.PERIOD && peek(k + 1) == Token.IDENTIFIER) {
+ k += 2;
+ }
+ // If next token is LPAREN, then this is constructor.
+ if (peek(k) == Token.LPAREN) {
+ member = parseMethodOrAccessor(modifiers, null);
+ break;
+ }
+ }
+
+ // Check to see if it's a method.
if (peek(1) == Token.LPAREN
- || peek(1) == Token.PERIOD
|| peekPseudoKeyword(0, OPERATOR_KEYWORD)
|| peekPseudoKeyword(0, GETTER_KEYWORD)
|| peekPseudoKeyword(0, SETTER_KEYWORD)) {
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolutionContext.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698