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

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

Issue 8428006: Fix prefix variable parse errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 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
« no previous file with comments | « no previous file | tests/language/src/Prefix17Test.dart » ('j') | tests/language/src/Prefix17Test.dart » ('J')
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 7e19eaba68b3c1ad9ce2ff119f0bdb1d2b9c4aa5..af8e08991aea5d2af543e64ca05cea47e4beb894 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -2625,10 +2625,11 @@ public class DartParser extends CompletionHooksParserBase {
case IDENTIFIER:
// we have already eliminated function declarations earlier, so just need to check for
// variable declarations here.
- if (peek(1) == Token.LT || peek(1) == Token.IDENTIFIER) {
+ if (peek(1) == Token.LT || peek(1) == Token.IDENTIFIER
+ || (peek(1) == Token.PERIOD && peek(2) == Token.IDENTIFIER)) {
beginTypeFunctionOrVariable();
DartTypeNode type = tryTypeAnnotation();
- if (type != null) {
+ if (type != null && peek(0) == Token.IDENTIFIER) {
List<DartVariable> vars = parseInitializedVariableList();
expect(Token.SEMICOLON);
return done(new DartVariableStatement(vars, type));
« no previous file with comments | « no previous file | tests/language/src/Prefix17Test.dart » ('j') | tests/language/src/Prefix17Test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698