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

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

Issue 10578051: Back out support for try-on; too early (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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/javatests/com/google/dart/compiler/parser/SyntaxTest.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 8938)
+++ compiler/java/com/google/dart/compiler/parser/DartParser.java (working copy)
@@ -141,7 +141,7 @@
private static final String INTERFACE_KEYWORD = "interface";
private static final String NATIVE_KEYWORD = "native";
private static final String NEGATE_KEYWORD = "negate";
- private static final String ON_KEYWORD = "on";
+ //private static final String ON_KEYWORD = "on";
private static final String OPERATOR_KEYWORD = "operator";
private static final String PREFIX_KEYWORD = "prefix";
private static final String SETTER_KEYWORD = "set";
@@ -4155,52 +4155,52 @@
DartBlock tryBlock = parseBlock();
List<DartCatchBlock> catches = new ArrayList<DartCatchBlock>();
- while (peekPseudoKeyword(0, ON_KEYWORD) || match(Token.CATCH)) {
+ while (/*peekPseudoKeyword(0, ON_KEYWORD) ||*/ match(Token.CATCH)) {
// TODO(zundel): It would be nice here to setup 'FINALLY' as token for recovery
- if (peekPseudoKeyword(0, ON_KEYWORD)) {
+// if (peekPseudoKeyword(0, ON_KEYWORD)) {
+// beginCatchClause();
+// next();
+// DartTypeNode exceptionType = new DartTypeNode(parseQualified());
+// DartParameter exception = null;
+// DartParameter stackTrace = null;
+// if (optional(Token.CATCH)) {
+// expect(Token.LPAREN);
+// beginCatchParameter();
+// DartIdentifier exceptionName = parseIdentifier();
+// exception = done(new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE));
+// if (optional(Token.COMMA)) {
+// beginCatchParameter();
+// DartIdentifier stackName = parseIdentifier();
+// stackTrace = done(new DartParameter(stackName, null, null, null, Modifiers.NONE));
+// }
+// expectCloseParen();
+// } else {
+// // Create a dummy identifier that the user cannot reliably reference.
+// DartIdentifier exceptionName = new DartIdentifier("e" + Long.toHexString(System.currentTimeMillis()));
+// exception = new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE);
+// }
+// DartBlock block = parseBlock();
+// catches.add(done(new DartCatchBlock(block, exception, stackTrace)));
+// } else {
beginCatchClause();
next();
- DartTypeNode exceptionType = new DartTypeNode(parseQualified());
- DartParameter exception = null;
- DartParameter stackTrace = null;
- if (optional(Token.CATCH)) {
- expect(Token.LPAREN);
- beginCatchParameter();
- DartIdentifier exceptionName = parseIdentifier();
- exception = done(new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE));
- if (optional(Token.COMMA)) {
- beginCatchParameter();
- DartIdentifier stackName = parseIdentifier();
- stackTrace = done(new DartParameter(stackName, null, null, null, Modifiers.NONE));
- }
- expectCloseParen();
- } else {
- // Create a dummy identifier that the user cannot reliably reference.
- DartIdentifier exceptionName = new DartIdentifier("e" + Long.toHexString(System.currentTimeMillis()));
- exception = new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE);
- }
- DartBlock block = parseBlock();
- catches.add(done(new DartCatchBlock(block, exception, stackTrace)));
- } else {
- beginCatchClause();
- next();
expect(Token.LPAREN);
- if (match(Token.IDENTIFIER) && (peek(1) == Token.COMMA || peek(1) == Token.RPAREN)) {
- beginCatchParameter();
- DartIdentifier exceptionName = parseIdentifier();
- // Create a dummy type with the right semantics.
- DartTypeNode exceptionType = new DartTypeNode(new DartIdentifier("Object"));
- DartParameter exception = done(new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE));
- DartParameter stackTrace = null;
- if (optional(Token.COMMA)) {
- beginCatchParameter();
- DartIdentifier stackName = parseIdentifier();
- stackTrace = done(new DartParameter(stackName, null, null, null, Modifiers.NONE));
- }
- expectCloseParen();
- DartBlock block = parseBlock();
- catches.add(done(new DartCatchBlock(block, exception, stackTrace)));
- } else {
+// if (match(Token.IDENTIFIER) && (peek(1) == Token.COMMA || peek(1) == Token.RPAREN)) {
+// beginCatchParameter();
+// DartIdentifier exceptionName = parseIdentifier();
+// // Create a dummy type with the right semantics.
+// DartTypeNode exceptionType = new DartTypeNode(new DartIdentifier("Object"));
+// DartParameter exception = done(new DartParameter(exceptionName, exceptionType, null, null, Modifiers.NONE));
+// DartParameter stackTrace = null;
+// if (optional(Token.COMMA)) {
+// beginCatchParameter();
+// DartIdentifier stackName = parseIdentifier();
+// stackTrace = done(new DartParameter(stackName, null, null, null, Modifiers.NONE));
+// }
+// expectCloseParen();
+// DartBlock block = parseBlock();
+// catches.add(done(new DartCatchBlock(block, exception, stackTrace)));
+// } else {
DartParameter exception = parseCatchParameter();
DartParameter stackTrace = null;
if (optional(Token.COMMA)) {
@@ -4210,8 +4210,8 @@
DartBlock block = parseBlock();
catches.add(done(new DartCatchBlock(block, exception, stackTrace)));
}
- }
- }
+// }
+// }
// Finally.
DartBlock finallyBlock = null;
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698