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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java

Issue 14811004: Improve error recovery when using 'var' as a type (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java (revision 22253)
+++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java (working copy)
@@ -283,12 +283,12 @@
}
public void test_equalityExpression_precedence_relational_left() throws Exception {
- BinaryExpression expression = parseExpression("is ==", ParserErrorCode.MISSING_IDENTIFIER);
+ BinaryExpression expression = parseExpression("is ==", ParserErrorCode.EXPECTED_TYPE_NAME);
assertInstanceOf(IsExpression.class, expression.getLeftOperand());
}
public void test_equalityExpression_precedence_relational_right() throws Exception {
- BinaryExpression expression = parseExpression("== is", ParserErrorCode.MISSING_IDENTIFIER);
+ BinaryExpression expression = parseExpression("== is", ParserErrorCode.EXPECTED_TYPE_NAME);
assertInstanceOf(IsExpression.class, expression.getRightOperand());
}
@@ -324,8 +324,8 @@
public void test_isExpression_noType() throws Exception {
CompilationUnit unit = parseCompilationUnit(
"class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}",
- ParserErrorCode.MISSING_IDENTIFIER,
- ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
ParserErrorCode.MISSING_STATEMENT);
ClassDeclaration declaration = (ClassDeclaration) unit.getDeclarations().get(0);
MethodDeclaration method = (MethodDeclaration) declaration.getMembers().get(0);
@@ -456,7 +456,7 @@
}
public void test_relationalExpression_missing_LHS_RHS() throws Exception {
- IsExpression expression = parseExpression("is", ParserErrorCode.MISSING_IDENTIFIER);
+ IsExpression expression = parseExpression("is", ParserErrorCode.EXPECTED_TYPE_NAME);
assertInstanceOf(SimpleIdentifier.class, expression.getExpression());
assertTrue(expression.getExpression().isSynthetic());
assertInstanceOf(TypeName.class, expression.getType());
@@ -464,13 +464,13 @@
}
public void test_relationalExpression_missing_RHS() throws Exception {
- IsExpression expression = parseExpression("x is", ParserErrorCode.MISSING_IDENTIFIER);
+ IsExpression expression = parseExpression("x is", ParserErrorCode.EXPECTED_TYPE_NAME);
assertInstanceOf(TypeName.class, expression.getType());
assertTrue(expression.getType().isSynthetic());
}
public void test_relationalExpression_precedence_shift_right() throws Exception {
- IsExpression expression = parseExpression("<< is", ParserErrorCode.MISSING_IDENTIFIER);
+ IsExpression expression = parseExpression("<< is", ParserErrorCode.EXPECTED_TYPE_NAME);
assertInstanceOf(BinaryExpression.class, expression.getExpression());
}
« no previous file with comments | « editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698