| 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);
|
| + }
|
| }
|
|
|