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

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

Issue 10068008: Adds parser recovery at the statement level for unterminated statements (no semicolon) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 431a057ff19b68af71286f4c8fe9abb2a408a361..cc915adf61d02f0f301eeaa6de2895e35de3f3f8 100644
--- a/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/AbstractParser.java
@@ -99,6 +99,14 @@ abstract class AbstractParser {
return TerminalAnnotationsCache.terminalsForStack(stackTrace);
}
+ /**
+ * If the expectedToken is encountered it is consumed and <code>true</code> is returned.
+ * If the expectedToken is not found, an error is reported.
+ * The token will only be consumed if it is not among the set of tokens that can be handled
+ * by a method currently on the stack. See the {@link Terminals annotation}
+ *
+ * @param expectedToken The token to expect next in the stream.
+ */
protected boolean expect(Token expectedToken) {
if (!optional(expectedToken)) {

Powered by Google App Engine
This is Rietveld 408576698