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

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

Issue 11293165: Issue 6598. Fix for hanging during parsing incomplete 'switch'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | no next file » | 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 055b5b0f89536b7635356fa61d5195e1bf0f1eb5..1ec8358b65765a60f0eddf1a1002fd8d179a3f93 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -4931,7 +4931,7 @@ public class DartParser extends CompletionHooksParserBase {
while (!done) {
List<DartLabel> labels = new ArrayList<DartLabel>();
beginSwitchMember(); // switch member
- while (peek(0) == Token.IDENTIFIER) {
+ while (peek(0) == Token.IDENTIFIER && peek(1) == Token.COLON) {
beginLabel();
DartIdentifier identifier = parseIdentifier();
expect(Token.COLON);
@@ -4951,7 +4951,7 @@ public class DartParser extends CompletionHooksParserBase {
done = true;
done(null);
} else {
- if (peek(0) != Token.EOS) {
+ if (peek(0) == Token.DEFAULT) {
members.add(parseDefaultMember(labels));
}
expectCloseBrace(foundOpenBrace);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698