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

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

Issue 8322010: DartC parser stress test (2) (Closed) Base URL: http://dart.googlecode.com/svn/trunk/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 | compiler/java/com/google/dart/compiler/parser/DartScanner.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
===================================================================
--- compiler/java/com/google/dart/compiler/parser/DartParser.java (revision 474)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -183,7 +183,7 @@
private DartParser(Source source, DartCompilerListener listener) throws IOException {
this(source, source.getSourceReader(), listener);
}
-
+
private DartParser(Source source,
Reader sourceReader,
DartCompilerListener listener) throws IOException {
@@ -274,7 +274,7 @@
/**
* A version of the parser which only parses the directives of a library.
- *
+ *
* TODO(jbrosenberg): consider parsing the whole file here, in order to avoid
* duplicate work. Probably requires removing use of LibraryUnit's, etc.
* Also, this minimal parse does have benefit in the incremental compilation
@@ -636,7 +636,7 @@
/**
* Parse a field or method, which may be inside a class or at the top level.
- *
+ *
* <pre>
* // This rule is organized in a way that may not be most readable, but
* // gives the best error messages.
@@ -726,7 +726,7 @@
* | NEGATE
* ;
* </pre>
- *
+ *
* @param allowStatic true if the static modifier is allowed
* @return a {@link DartNode} representing the grammar fragment above
*/
@@ -2761,6 +2761,10 @@
++parenCount;
break;
+ case EOS:
+ reportErrorWithoutAdvancing(DartCompilerErrorCode.UNEXPECTED_TOKEN);
+ return;
+
case LBRACE:
case SEMICOLON:
return;
@@ -2819,7 +2823,7 @@
* <p>
* Note that this is a crude heuristic that needs to be improved for better
* error recovery.
- *
+ *
* @return a {@link DartSyntheticErrorStatement}
*/
private DartStatement parseErrorStatement() {
@@ -2874,7 +2878,7 @@
break;
}
- while (true) {
+ while (true) {
switch (peek(0)) {
case EOS:
return;
@@ -2892,7 +2896,7 @@
return;
}
break;
-
+
case LBRACE:
++braceCount;
//$FALL-THROUGH$
@@ -2905,7 +2909,7 @@
/**
* Report an error without advancing past the next token.
- *
+ *
* @param errCode the error code to report, which may take a string parameter
* containing the actual token found
*/
@@ -3178,7 +3182,7 @@
done = true;
done(null);
} else {
- if (peek(0) != Token.EOS) {
+ if (peek(0) != Token.EOS) {
members.add(parseDefaultMember(label));
}
expectCloseBrace();
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/parser/DartScanner.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698