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

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

Issue 15289002: Implement rethrow in dart-analyzer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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/Token.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 22843)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -212,6 +212,7 @@
"new",
"null",
"return",
+ "rethrow",
"super",
"switch",
"this",
@@ -4435,8 +4436,8 @@
// TODO(zundel): Possibly we could use Token.IDENTIFIER too, but it is used
// in so many places, it might make recovery worse rather than better.
@Terminals(tokens={Token.IF, Token.SWITCH, Token.WHILE, Token.DO, Token.FOR,
- Token.VAR, Token.FINAL, Token.CONTINUE, Token.BREAK, Token.RETURN, Token.THROW,
- Token.TRY, Token.SEMICOLON })
+ Token.VAR, Token.FINAL, Token.CONTINUE, Token.BREAK, Token.RETHROW,
+ Token.RETURN, Token.THROW, Token.TRY, Token.SEMICOLON })
private DartStatement parseNonLabelledStatement() {
// Try to parse as function declaration.
if (looksLikeFunctionDeclarationOrExpression()) {
@@ -4524,6 +4525,11 @@
case THROW:
return parseExpressionStatement();
+ case RETHROW:
+ consume(Token.RETHROW);
+ beginExpressionStatement();
+ return done(new DartExprStmt(new DartThrowExpression(null)));
+
case TRY:
return parseTryStatement();
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/parser/Token.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698