| Index: compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| diff --git a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| index 5eba5c863163c115d1374c1c67a922a7e4b40457..7b2b1738cd91fc2308cf7729e00232c5b017574e 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java
|
| @@ -27,10 +27,6 @@ import com.google.dart.compiler.ast.DartTryStatement;
|
| import com.google.dart.compiler.ast.DartTypeNode;
|
| import com.google.dart.compiler.ast.DartUnit;
|
| import com.google.dart.compiler.ast.DartVariableStatement;
|
| -import com.google.dart.compiler.parser.ParserErrorCode;
|
| -import com.google.dart.compiler.resolver.ResolverErrorCode;
|
| -
|
| -import static com.google.dart.compiler.common.ErrorExpectation.errEx;
|
|
|
| import java.util.List;
|
|
|
| @@ -342,13 +338,13 @@ public class SyntaxTest extends AbstractParserTest {
|
| "class A { ",
|
| " int get;",
|
| " var set;",
|
| - " final operator;",
|
| + " final operator;",
|
| "}",
|
| "class B {",
|
| " var get = 1;",
|
| " int set = 1;",
|
| " final int operator = 1;",
|
| - "}",
|
| + "}",
|
| "class C {",
|
| " var get = 1;",
|
| " int set = 1;",
|
| @@ -358,7 +354,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| " int get = 1;",
|
| " final int set = 1;",
|
| " var operator = 1;",
|
| - "}",
|
| + "}",
|
| "class E {",
|
| " int get() { }",
|
| " void set() { }",
|
| @@ -369,7 +365,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| " operator + (arg) { }",
|
| " operator [] (arg) { }",
|
| " operator []= (arg, arg){ }",
|
| - "}"));
|
| + "}"));
|
|
|
| DartClass A = (DartClass)unit.getTopLevelNodes().get(0);
|
| DartFieldDefinition A_get = (DartFieldDefinition)A.getMembers().get(0);
|
| @@ -391,7 +387,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| DartFieldDefinition C_set = (DartFieldDefinition)C.getMembers().get(1);
|
| assertEquals("set", C_set.getFields().get(0).getName().getName());
|
| DartFieldDefinition C_operator = (DartFieldDefinition)C.getMembers().get(2);
|
| - assertEquals("operator", C_operator.getFields().get(0).getName().getName());
|
| + assertEquals("operator", C_operator.getFields().get(0).getName().getName());
|
| DartClass D = (DartClass)unit.getTopLevelNodes().get(3);
|
| DartFieldDefinition D_get = (DartFieldDefinition)D.getMembers().get(0);
|
| assertEquals("get", D_get.getFields().get(0).getName().getName());
|
| @@ -410,16 +406,16 @@ public class SyntaxTest extends AbstractParserTest {
|
| DartMethodDefinition F_negate = (DartMethodDefinition)F.getMembers().get(0);
|
| assertEquals("negate", ((DartIdentifier)F_negate.getName()).getName());
|
| DartMethodDefinition F_plus = (DartMethodDefinition)F.getMembers().get(1);
|
| - assertEquals("+", ((DartIdentifier)F_plus.getName()).getName());
|
| + assertEquals("+", ((DartIdentifier)F_plus.getName()).getName());
|
| DartMethodDefinition F_access = (DartMethodDefinition)F.getMembers().get(2);
|
| - assertEquals("[]", ((DartIdentifier)F_access.getName()).getName());
|
| + assertEquals("[]", ((DartIdentifier)F_access.getName()).getName());
|
| DartMethodDefinition F_access_assign = (DartMethodDefinition)F.getMembers().get(3);
|
| - assertEquals("[]=", ((DartIdentifier)F_access_assign.getName()).getName());
|
| + assertEquals("[]=", ((DartIdentifier)F_access_assign.getName()).getName());
|
| }
|
| -
|
| +
|
| /**
|
| * Typedef and interface are top level keywords that are also valid as identifiers.
|
| - *
|
| + *
|
| * This test helps insure that the error recovery logic in the parser that detects
|
| * top level keywords out of place doesn't break this functionality.
|
| */
|
| @@ -437,7 +433,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| "final typedef;",
|
| "typedef() { }",
|
| "String typedef() { }",
|
| - "typedef();",
|
| + "typedef();",
|
| "class A { ",
|
| " var interface;",
|
| " bool interface;",
|
| @@ -467,7 +463,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| " typedef();",
|
| "}"));
|
| }
|
| -
|
| +
|
| /**
|
| * The token 'super' is valid by itself (not as a qualifier or assignment selector) in only some
|
| * cases.
|
| @@ -492,7 +488,7 @@ public class SyntaxTest extends AbstractParserTest {
|
| ParserErrorCode.SUPER_IS_NOT_VALID_AS_A_BOOLEAN_OPERAND, 7, 9,
|
| ParserErrorCode.SUPER_IS_NOT_VALID_AS_A_BOOLEAN_OPERAND, 8, 9);
|
| }
|
| -
|
| +
|
| public void testLoneSuperExpression2() throws Exception {
|
| parseUnit("phony_lone_super_expression1.dart",
|
| Joiner.on("\n").join(
|
| @@ -503,15 +499,15 @@ public class SyntaxTest extends AbstractParserTest {
|
| " if (1 + super) { }", // error
|
| " if (super + 1) { }", // ok
|
| " if (1 == super) { }", // error
|
| - " if (super == 1) { }", // ok
|
| + " if (super == 1) { }", // ok
|
| " if (1 | super) { }", // error
|
| - " if (super | 1) { }", // ok
|
| + " if (super | 1) { }", // ok
|
| " if (1 < super) { }", // error
|
| - " if (super < 1) { }", // ok
|
| + " if (super < 1) { }", // ok
|
| " if (1 << super) { }", // error
|
| - " if (super << 1) { }", // ok
|
| + " if (super << 1) { }", // ok
|
| " if (1 * super) { }", // error
|
| - " if (super * 1) { }", // ok
|
| + " if (super * 1) { }", // ok
|
| " var f = -super;", // ok
|
| " }",
|
| "}"),
|
| @@ -521,5 +517,5 @@ public class SyntaxTest extends AbstractParserTest {
|
| ParserErrorCode.SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND, 11, 13,
|
| ParserErrorCode.SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND, 13, 14,
|
| ParserErrorCode.SUPER_CANNOT_BE_USED_AS_THE_SECOND_OPERAND, 15, 13);
|
| - }
|
| + }
|
| }
|
|
|