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

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

Issue 9959054: More error recovery back to the top level for some cases (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Previous patch had problems when JUnit tests added Created 8 years, 9 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
Index: compiler/java/com/google/dart/compiler/parser/AbstractParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/AbstractParser.java b/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
index 4805bc76b935162bf09b9faa26c6ca5c23767bcd..fcfa8b2b0608b46029f565bf3f8bc7c600b1dbe0 100644
--- a/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
@@ -33,6 +33,12 @@ abstract class AbstractParser {
Token actualToken = peek(0);
ctx.advance();
reportUnexpectedToken(position(), expectedToken, actualToken);
+ // Recover from the middle of string interpolation
+ if (actualToken.equals(Token.STRING_EMBED_EXP_START)) {
+ while(!peek(0).equals(Token.STRING_EMBED_EXP_END) && !EOS()) {
+ next();
+ }
+ }
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698