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

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

Issue 11364134: Merge libv1. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Reupload due to error Created 8 years, 1 month 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java
index e330b2356f2b10a6e57779e3332efad38dfa6407..48c24da5769c2923f1010e72df95cb2ff561d9c2 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/RecoveryParserTest.java
@@ -16,9 +16,13 @@ package com.google.dart.engine.parser;
import com.google.dart.engine.ast.ArgumentDefinitionTest;
import com.google.dart.engine.ast.AssignmentExpression;
import com.google.dart.engine.ast.BinaryExpression;
+import com.google.dart.engine.ast.CompilationUnit;
+import com.google.dart.engine.ast.CompilationUnitMember;
import com.google.dart.engine.ast.ConditionalExpression;
import com.google.dart.engine.ast.Expression;
+import com.google.dart.engine.ast.FunctionDeclaration;
import com.google.dart.engine.ast.IsExpression;
+import com.google.dart.engine.ast.NodeList;
import com.google.dart.engine.ast.PrefixExpression;
import com.google.dart.engine.ast.SimpleIdentifier;
import com.google.dart.engine.ast.TypeName;
@@ -31,7 +35,6 @@ import java.util.List;
* sequences to ensure that the correct recovery steps are taken in the parser.
*/
public class RecoveryParserTest extends ParserTestCase {
-
public void test_additiveExpression_missing_LHS() throws Exception {
BinaryExpression expression = parseExpression("+ y", ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
assertInstanceOf(SimpleIdentifier.class, expression.getLeftOperand());
@@ -473,12 +476,16 @@ public class RecoveryParserTest extends ParserTestCase {
}
public void test_shiftExpression_precedence_unary_left() throws Exception {
- BinaryExpression expression = parseExpression("+ <<", ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
+ BinaryExpression expression = parseExpression(
+ "+ <<",
+ ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
assertInstanceOf(BinaryExpression.class, expression.getLeftOperand());
}
public void test_shiftExpression_precedence_unary_right() throws Exception {
- BinaryExpression expression = parseExpression("<< +", ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
+ BinaryExpression expression = parseExpression(
+ "<< +",
+ ParserErrorCode.USE_OF_UNARY_PLUS_OPERATOR);
assertInstanceOf(BinaryExpression.class, expression.getRightOperand());
}
@@ -486,4 +493,14 @@ public class RecoveryParserTest extends ParserTestCase {
BinaryExpression expression = parseExpression("super << <<");
assertInstanceOf(BinaryExpression.class, expression.getLeftOperand());
}
+
+ public void test_topLevelExternalFunction_extraSemicolon() throws Exception {
+ CompilationUnit unit = parseCompilationUnit(
+ "external void f(A a);",
+ ParserErrorCode.UNEXPECTED_TOKEN);
+ NodeList<CompilationUnitMember> declarations = unit.getDeclarations();
+ assertSize(1, declarations);
+ FunctionDeclaration declaration = (FunctionDeclaration) declarations.get(0);
+ assertNotNull(declaration);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698