| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine.parser_test; | 3 library engine.parser_test; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'package:analyzer_experimental/src/generated/java_core.dart'; | 5 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; | 6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; |
| 7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 8 import 'package:analyzer_experimental/src/generated/source.dart'; | 8 import 'package:analyzer_experimental/src/generated/source.dart'; |
| 9 import 'package:analyzer_experimental/src/generated/error.dart'; | 9 import 'package:analyzer_experimental/src/generated/error.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 10 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 JUnitTestCase.assertEquals("text", computeStringValue("r'''text'''")); | 76 JUnitTestCase.assertEquals("text", computeStringValue("r'''text'''")); |
| 77 } | 77 } |
| 78 void test_computeStringValue_raw_withEscape() { | 78 void test_computeStringValue_raw_withEscape() { |
| 79 JUnitTestCase.assertEquals("two\\nlines", computeStringValue("r'two\\nlines'
")); | 79 JUnitTestCase.assertEquals("two\\nlines", computeStringValue("r'two\\nlines'
")); |
| 80 } | 80 } |
| 81 void test_constFactory() { | 81 void test_constFactory() { |
| 82 ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C()
= A;"); | 82 ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C()
= A;"); |
| 83 } | 83 } |
| 84 void test_createSyntheticIdentifier() { | 84 void test_createSyntheticIdentifier() { |
| 85 SimpleIdentifier identifier = createSyntheticIdentifier(); | 85 SimpleIdentifier identifier = createSyntheticIdentifier(); |
| 86 JUnitTestCase.assertTrue(identifier.isSynthetic()); | 86 JUnitTestCase.assertTrue(identifier.isSynthetic); |
| 87 } | 87 } |
| 88 void test_createSyntheticStringLiteral() { | 88 void test_createSyntheticStringLiteral() { |
| 89 SimpleStringLiteral literal = createSyntheticStringLiteral(); | 89 SimpleStringLiteral literal = createSyntheticStringLiteral(); |
| 90 JUnitTestCase.assertTrue(literal.isSynthetic()); | 90 JUnitTestCase.assertTrue(literal.isSynthetic); |
| 91 } | 91 } |
| 92 void test_isFunctionDeclaration_nameButNoReturn_block() { | 92 void test_isFunctionDeclaration_nameButNoReturn_block() { |
| 93 JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}")); | 93 JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}")); |
| 94 } | 94 } |
| 95 void test_isFunctionDeclaration_nameButNoReturn_expression() { | 95 void test_isFunctionDeclaration_nameButNoReturn_expression() { |
| 96 JUnitTestCase.assertTrue(isFunctionDeclaration("f() => e")); | 96 JUnitTestCase.assertTrue(isFunctionDeclaration("f() => e")); |
| 97 } | 97 } |
| 98 void test_isFunctionDeclaration_normalReturn_block() { | 98 void test_isFunctionDeclaration_normalReturn_block() { |
| 99 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() {}")); | 99 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() {}")); |
| 100 } | 100 } |
| (...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 } | 1501 } |
| 1502 void test_parseDirective_partOf() { | 1502 void test_parseDirective_partOf() { |
| 1503 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); | 1503 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); |
| 1504 JUnitTestCase.assertNotNull(directive.partToken); | 1504 JUnitTestCase.assertNotNull(directive.partToken); |
| 1505 JUnitTestCase.assertNotNull(directive.ofToken); | 1505 JUnitTestCase.assertNotNull(directive.ofToken); |
| 1506 JUnitTestCase.assertNotNull(directive.libraryName); | 1506 JUnitTestCase.assertNotNull(directive.libraryName); |
| 1507 JUnitTestCase.assertNotNull(directive.semicolon); | 1507 JUnitTestCase.assertNotNull(directive.semicolon); |
| 1508 } | 1508 } |
| 1509 void test_parseDocumentationComment_block() { | 1509 void test_parseDocumentationComment_block() { |
| 1510 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */
class", []); | 1510 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */
class", []); |
| 1511 JUnitTestCase.assertFalse(comment.isBlock()); | 1511 JUnitTestCase.assertFalse(comment.isBlock); |
| 1512 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1512 JUnitTestCase.assertTrue(comment.isDocumentation); |
| 1513 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1513 JUnitTestCase.assertFalse(comment.isEndOfLine); |
| 1514 } | 1514 } |
| 1515 void test_parseDocumentationComment_block_withReference() { | 1515 void test_parseDocumentationComment_block_withReference() { |
| 1516 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a
] */ class", []); | 1516 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a
] */ class", []); |
| 1517 JUnitTestCase.assertFalse(comment.isBlock()); | 1517 JUnitTestCase.assertFalse(comment.isBlock); |
| 1518 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1518 JUnitTestCase.assertTrue(comment.isDocumentation); |
| 1519 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1519 JUnitTestCase.assertFalse(comment.isEndOfLine); |
| 1520 NodeList<CommentReference> references = comment.references; | 1520 NodeList<CommentReference> references = comment.references; |
| 1521 EngineTestCase.assertSize(1, references); | 1521 EngineTestCase.assertSize(1, references); |
| 1522 CommentReference reference = references[0]; | 1522 CommentReference reference = references[0]; |
| 1523 JUnitTestCase.assertNotNull(reference); | 1523 JUnitTestCase.assertNotNull(reference); |
| 1524 JUnitTestCase.assertEquals(5, reference.offset); | 1524 JUnitTestCase.assertEquals(5, reference.offset); |
| 1525 } | 1525 } |
| 1526 void test_parseDocumentationComment_endOfLine() { | 1526 void test_parseDocumentationComment_endOfLine() { |
| 1527 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n
/// \n class", []); | 1527 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n
/// \n class", []); |
| 1528 JUnitTestCase.assertFalse(comment.isBlock()); | 1528 JUnitTestCase.assertFalse(comment.isBlock); |
| 1529 JUnitTestCase.assertTrue(comment.isDocumentation()); | 1529 JUnitTestCase.assertTrue(comment.isDocumentation); |
| 1530 JUnitTestCase.assertFalse(comment.isEndOfLine()); | 1530 JUnitTestCase.assertFalse(comment.isEndOfLine); |
| 1531 } | 1531 } |
| 1532 void test_parseDoStatement() { | 1532 void test_parseDoStatement() { |
| 1533 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi
le (x);", []); | 1533 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi
le (x);", []); |
| 1534 JUnitTestCase.assertNotNull(statement.doKeyword); | 1534 JUnitTestCase.assertNotNull(statement.doKeyword); |
| 1535 JUnitTestCase.assertNotNull(statement.body); | 1535 JUnitTestCase.assertNotNull(statement.body); |
| 1536 JUnitTestCase.assertNotNull(statement.whileKeyword); | 1536 JUnitTestCase.assertNotNull(statement.whileKeyword); |
| 1537 JUnitTestCase.assertNotNull(statement.leftParenthesis); | 1537 JUnitTestCase.assertNotNull(statement.leftParenthesis); |
| 1538 JUnitTestCase.assertNotNull(statement.condition); | 1538 JUnitTestCase.assertNotNull(statement.condition); |
| 1539 JUnitTestCase.assertNotNull(statement.rightParenthesis); | 1539 JUnitTestCase.assertNotNull(statement.rightParenthesis); |
| 1540 JUnitTestCase.assertNotNull(statement.semicolon); | 1540 JUnitTestCase.assertNotNull(statement.semicolon); |
| (...skipping 1322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 void test_parsePrimaryExpression_null() { | 2863 void test_parsePrimaryExpression_null() { |
| 2864 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null"
, []); | 2864 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null"
, []); |
| 2865 JUnitTestCase.assertNotNull(literal.literal); | 2865 JUnitTestCase.assertNotNull(literal.literal); |
| 2866 } | 2866 } |
| 2867 void test_parsePrimaryExpression_parenthesized() { | 2867 void test_parsePrimaryExpression_parenthesized() { |
| 2868 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr
ession", "(x)", []); | 2868 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr
ession", "(x)", []); |
| 2869 JUnitTestCase.assertNotNull(expression); | 2869 JUnitTestCase.assertNotNull(expression); |
| 2870 } | 2870 } |
| 2871 void test_parsePrimaryExpression_string() { | 2871 void test_parsePrimaryExpression_string() { |
| 2872 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression"
, "\"string\"", []); | 2872 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression"
, "\"string\"", []); |
| 2873 JUnitTestCase.assertFalse(literal.isMultiline()); | 2873 JUnitTestCase.assertFalse(literal.isMultiline); |
| 2874 JUnitTestCase.assertEquals("string", literal.value); | 2874 JUnitTestCase.assertEquals("string", literal.value); |
| 2875 } | 2875 } |
| 2876 void test_parsePrimaryExpression_super() { | 2876 void test_parsePrimaryExpression_super() { |
| 2877 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio
n", "super.x", []); | 2877 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio
n", "super.x", []); |
| 2878 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); | 2878 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); |
| 2879 JUnitTestCase.assertNotNull(propertyAccess.operator); | 2879 JUnitTestCase.assertNotNull(propertyAccess.operator); |
| 2880 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); | 2880 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); |
| 2881 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | 2881 JUnitTestCase.assertNotNull(propertyAccess.propertyName); |
| 2882 } | 2882 } |
| 2883 void test_parsePrimaryExpression_this() { | 2883 void test_parsePrimaryExpression_this() { |
| (...skipping 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5972 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 5972 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 5973 } | 5973 } |
| 5974 void test_cascade_withAssignment() { | 5974 void test_cascade_withAssignment() { |
| 5975 CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] =
4 ..[0] = 11;", []); | 5975 CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] =
4 ..[0] = 11;", []); |
| 5976 Expression target = cascade.target; | 5976 Expression target = cascade.target; |
| 5977 for (Expression section in cascade.cascadeSections) { | 5977 for (Expression section in cascade.cascadeSections) { |
| 5978 EngineTestCase.assertInstanceOf(AssignmentExpression, section); | 5978 EngineTestCase.assertInstanceOf(AssignmentExpression, section); |
| 5979 Expression lhs = ((section as AssignmentExpression)).leftHandSide; | 5979 Expression lhs = ((section as AssignmentExpression)).leftHandSide; |
| 5980 EngineTestCase.assertInstanceOf(IndexExpression, lhs); | 5980 EngineTestCase.assertInstanceOf(IndexExpression, lhs); |
| 5981 IndexExpression index = lhs as IndexExpression; | 5981 IndexExpression index = lhs as IndexExpression; |
| 5982 JUnitTestCase.assertTrue(index.isCascaded()); | 5982 JUnitTestCase.assertTrue(index.isCascaded); |
| 5983 JUnitTestCase.assertSame(target, index.realTarget); | 5983 JUnitTestCase.assertSame(target, index.realTarget); |
| 5984 } | 5984 } |
| 5985 } | 5985 } |
| 5986 void test_conditionalExpression_precedence_logicalOrExpression() { | 5986 void test_conditionalExpression_precedence_logicalOrExpression() { |
| 5987 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y
: z", []); | 5987 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y
: z", []); |
| 5988 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition); | 5988 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition); |
| 5989 } | 5989 } |
| 5990 void test_constructor_initializer_withParenthesizedExpression() { | 5990 void test_constructor_initializer_withParenthesizedExpression() { |
| 5991 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr
eateSource(["class C {", " C() :", " this.a = (b == null ? c : d) {", " }",
"}"]), []); | 5991 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr
eateSource(["class C {", " C() :", " this.a = (b == null ? c : d) {", " }",
"}"]), []); |
| 5992 NodeList<CompilationUnitMember> declarations = unit.declarations; | 5992 NodeList<CompilationUnitMember> declarations = unit.declarations; |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6565 * The class `RecoveryParserTest` defines parser tests that test the parsing of
invalid code | 6565 * The class `RecoveryParserTest` defines parser tests that test the parsing of
invalid code |
| 6566 * sequences to ensure that the correct recovery steps are taken in the parser. | 6566 * sequences to ensure that the correct recovery steps are taken in the parser. |
| 6567 */ | 6567 */ |
| 6568 class RecoveryParserTest extends ParserTestCase { | 6568 class RecoveryParserTest extends ParserTestCase { |
| 6569 void fail_incompleteReturnType() { | 6569 void fail_incompleteReturnType() { |
| 6570 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["Map<Symbol
, convertStringToSymbolMap(Map<String, dynamic> map) {", " if (map == null) ret
urn null;", " Map<Symbol, dynamic> result = new Map<Symbol, dynamic>();", " ma
p.forEach((name, value) {", " result[new Symbol(name)] = value;", " });", "
return result;", "}"]), []); | 6570 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["Map<Symbol
, convertStringToSymbolMap(Map<String, dynamic> map) {", " if (map == null) ret
urn null;", " Map<Symbol, dynamic> result = new Map<Symbol, dynamic>();", " ma
p.forEach((name, value) {", " result[new Symbol(name)] = value;", " });", "
return result;", "}"]), []); |
| 6571 } | 6571 } |
| 6572 void test_additiveExpression_missing_LHS() { | 6572 void test_additiveExpression_missing_LHS() { |
| 6573 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6573 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6574 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6574 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6575 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6575 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6576 } | 6576 } |
| 6577 void test_additiveExpression_missing_LHS_RHS() { | 6577 void test_additiveExpression_missing_LHS_RHS() { |
| 6578 BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6578 BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6579 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6579 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6580 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6580 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6581 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6581 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6582 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6582 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6583 } | 6583 } |
| 6584 void test_additiveExpression_missing_RHS() { | 6584 void test_additiveExpression_missing_RHS() { |
| 6585 BinaryExpression expression = ParserTestCase.parseExpression("x +", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6585 BinaryExpression expression = ParserTestCase.parseExpression("x +", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6586 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6586 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6587 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6587 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6588 } | 6588 } |
| 6589 void test_additiveExpression_missing_RHS_super() { | 6589 void test_additiveExpression_missing_RHS_super() { |
| 6590 BinaryExpression expression = ParserTestCase.parseExpression("super +", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6590 BinaryExpression expression = ParserTestCase.parseExpression("super +", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6591 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6591 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6592 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6592 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6593 } | 6593 } |
| 6594 void test_additiveExpression_precedence_multiplicative_left() { | 6594 void test_additiveExpression_precedence_multiplicative_left() { |
| 6595 BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6595 BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6596 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6596 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6597 } | 6597 } |
| 6598 void test_additiveExpression_precedence_multiplicative_right() { | 6598 void test_additiveExpression_precedence_multiplicative_right() { |
| 6599 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6599 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6600 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6600 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6601 } | 6601 } |
| 6602 void test_additiveExpression_super() { | 6602 void test_additiveExpression_super() { |
| 6603 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [P
arserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6603 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [P
arserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6604 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6604 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6605 } | 6605 } |
| 6606 void test_assignmentExpression_missing_compound1() { | 6606 void test_assignmentExpression_missing_compound1() { |
| 6607 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[ParserErrorCode.MISSING_IDENTIFIER]); | 6607 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[ParserErrorCode.MISSING_IDENTIFIER]); |
| 6608 Expression syntheticExpression = expression.leftHandSide; | 6608 Expression syntheticExpression = expression.leftHandSide; |
| 6609 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6609 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6610 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6610 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6611 } | 6611 } |
| 6612 void test_assignmentExpression_missing_compound2() { | 6612 void test_assignmentExpression_missing_compound2() { |
| 6613 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[ParserErrorCode.MISSING_IDENTIFIER]); | 6613 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[ParserErrorCode.MISSING_IDENTIFIER]); |
| 6614 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; | 6614 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; |
| 6615 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6615 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6616 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6616 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6617 } | 6617 } |
| 6618 void test_assignmentExpression_missing_compound3() { | 6618 void test_assignmentExpression_missing_compound3() { |
| 6619 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[ParserErrorCode.MISSING_IDENTIFIER]); | 6619 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[ParserErrorCode.MISSING_IDENTIFIER]); |
| 6620 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; | 6620 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; |
| 6621 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6621 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6622 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6622 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6623 } | 6623 } |
| 6624 void test_assignmentExpression_missing_LHS() { | 6624 void test_assignmentExpression_missing_LHS() { |
| 6625 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6625 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6626 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | 6626 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); |
| 6627 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); | 6627 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic); |
| 6628 } | 6628 } |
| 6629 void test_assignmentExpression_missing_RHS() { | 6629 void test_assignmentExpression_missing_RHS() { |
| 6630 AssignmentExpression expression = ParserTestCase.parseExpression("x =", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6630 AssignmentExpression expression = ParserTestCase.parseExpression("x =", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6631 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | 6631 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); |
| 6632 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic()); | 6632 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic); |
| 6633 } | 6633 } |
| 6634 void test_bitwiseAndExpression_missing_LHS() { | 6634 void test_bitwiseAndExpression_missing_LHS() { |
| 6635 BinaryExpression expression = ParserTestCase.parseExpression("& y", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6635 BinaryExpression expression = ParserTestCase.parseExpression("& y", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6636 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6636 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6637 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6637 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6638 } | 6638 } |
| 6639 void test_bitwiseAndExpression_missing_LHS_RHS() { | 6639 void test_bitwiseAndExpression_missing_LHS_RHS() { |
| 6640 BinaryExpression expression = ParserTestCase.parseExpression("&", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6640 BinaryExpression expression = ParserTestCase.parseExpression("&", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6641 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6641 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6642 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6642 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6643 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6643 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6644 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6644 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6645 } | 6645 } |
| 6646 void test_bitwiseAndExpression_missing_RHS() { | 6646 void test_bitwiseAndExpression_missing_RHS() { |
| 6647 BinaryExpression expression = ParserTestCase.parseExpression("x &", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6647 BinaryExpression expression = ParserTestCase.parseExpression("x &", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6648 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6648 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6649 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6649 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6650 } | 6650 } |
| 6651 void test_bitwiseAndExpression_missing_RHS_super() { | 6651 void test_bitwiseAndExpression_missing_RHS_super() { |
| 6652 BinaryExpression expression = ParserTestCase.parseExpression("super &", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6652 BinaryExpression expression = ParserTestCase.parseExpression("super &", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6653 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6653 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6654 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6654 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6655 } | 6655 } |
| 6656 void test_bitwiseAndExpression_precedence_equality_left() { | 6656 void test_bitwiseAndExpression_precedence_equality_left() { |
| 6657 BinaryExpression expression = ParserTestCase.parseExpression("== &", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6657 BinaryExpression expression = ParserTestCase.parseExpression("== &", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6658 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6658 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6659 } | 6659 } |
| 6660 void test_bitwiseAndExpression_precedence_equality_right() { | 6660 void test_bitwiseAndExpression_precedence_equality_right() { |
| 6661 BinaryExpression expression = ParserTestCase.parseExpression("& ==", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6661 BinaryExpression expression = ParserTestCase.parseExpression("& ==", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6662 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6662 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6663 } | 6663 } |
| 6664 void test_bitwiseAndExpression_super() { | 6664 void test_bitwiseAndExpression_super() { |
| 6665 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6665 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6666 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6666 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6667 } | 6667 } |
| 6668 void test_bitwiseOrExpression_missing_LHS() { | 6668 void test_bitwiseOrExpression_missing_LHS() { |
| 6669 BinaryExpression expression = ParserTestCase.parseExpression("| y", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6669 BinaryExpression expression = ParserTestCase.parseExpression("| y", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6670 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6670 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6671 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6671 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6672 } | 6672 } |
| 6673 void test_bitwiseOrExpression_missing_LHS_RHS() { | 6673 void test_bitwiseOrExpression_missing_LHS_RHS() { |
| 6674 BinaryExpression expression = ParserTestCase.parseExpression("|", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6674 BinaryExpression expression = ParserTestCase.parseExpression("|", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6675 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6675 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6676 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6676 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6677 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6677 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6678 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6678 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6679 } | 6679 } |
| 6680 void test_bitwiseOrExpression_missing_RHS() { | 6680 void test_bitwiseOrExpression_missing_RHS() { |
| 6681 BinaryExpression expression = ParserTestCase.parseExpression("x |", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6681 BinaryExpression expression = ParserTestCase.parseExpression("x |", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6682 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6682 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6683 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6683 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6684 } | 6684 } |
| 6685 void test_bitwiseOrExpression_missing_RHS_super() { | 6685 void test_bitwiseOrExpression_missing_RHS_super() { |
| 6686 BinaryExpression expression = ParserTestCase.parseExpression("super |", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6686 BinaryExpression expression = ParserTestCase.parseExpression("super |", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6687 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6687 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6688 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6688 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6689 } | 6689 } |
| 6690 void test_bitwiseOrExpression_precedence_xor_left() { | 6690 void test_bitwiseOrExpression_precedence_xor_left() { |
| 6691 BinaryExpression expression = ParserTestCase.parseExpression("^ |", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6691 BinaryExpression expression = ParserTestCase.parseExpression("^ |", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6692 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6692 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6693 } | 6693 } |
| 6694 void test_bitwiseOrExpression_precedence_xor_right() { | 6694 void test_bitwiseOrExpression_precedence_xor_right() { |
| 6695 BinaryExpression expression = ParserTestCase.parseExpression("| ^", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6695 BinaryExpression expression = ParserTestCase.parseExpression("| ^", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6696 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6696 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6697 } | 6697 } |
| 6698 void test_bitwiseOrExpression_super() { | 6698 void test_bitwiseOrExpression_super() { |
| 6699 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6699 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6700 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6700 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6701 } | 6701 } |
| 6702 void test_bitwiseXorExpression_missing_LHS() { | 6702 void test_bitwiseXorExpression_missing_LHS() { |
| 6703 BinaryExpression expression = ParserTestCase.parseExpression("^ y", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6703 BinaryExpression expression = ParserTestCase.parseExpression("^ y", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6704 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6704 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6705 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6705 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6706 } | 6706 } |
| 6707 void test_bitwiseXorExpression_missing_LHS_RHS() { | 6707 void test_bitwiseXorExpression_missing_LHS_RHS() { |
| 6708 BinaryExpression expression = ParserTestCase.parseExpression("^", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6708 BinaryExpression expression = ParserTestCase.parseExpression("^", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6709 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6709 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6710 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6710 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6711 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6711 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6712 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6712 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6713 } | 6713 } |
| 6714 void test_bitwiseXorExpression_missing_RHS() { | 6714 void test_bitwiseXorExpression_missing_RHS() { |
| 6715 BinaryExpression expression = ParserTestCase.parseExpression("x ^", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6715 BinaryExpression expression = ParserTestCase.parseExpression("x ^", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6716 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6716 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6717 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6717 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6718 } | 6718 } |
| 6719 void test_bitwiseXorExpression_missing_RHS_super() { | 6719 void test_bitwiseXorExpression_missing_RHS_super() { |
| 6720 BinaryExpression expression = ParserTestCase.parseExpression("super ^", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6720 BinaryExpression expression = ParserTestCase.parseExpression("super ^", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6721 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6721 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6722 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6722 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6723 } | 6723 } |
| 6724 void test_bitwiseXorExpression_precedence_and_left() { | 6724 void test_bitwiseXorExpression_precedence_and_left() { |
| 6725 BinaryExpression expression = ParserTestCase.parseExpression("& ^", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6725 BinaryExpression expression = ParserTestCase.parseExpression("& ^", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6726 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6726 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6727 } | 6727 } |
| 6728 void test_bitwiseXorExpression_precedence_and_right() { | 6728 void test_bitwiseXorExpression_precedence_and_right() { |
| 6729 BinaryExpression expression = ParserTestCase.parseExpression("^ &", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); | 6729 BinaryExpression expression = ParserTestCase.parseExpression("^ &", [ParserE
rrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode
.MISSING_IDENTIFIER]); |
| 6730 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6730 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6731 } | 6731 } |
| 6732 void test_bitwiseXorExpression_super() { | 6732 void test_bitwiseXorExpression_super() { |
| 6733 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6733 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6734 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6734 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6735 } | 6735 } |
| 6736 void test_classTypeAlias_withBody() { | 6736 void test_classTypeAlias_withBody() { |
| 6737 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}
", "typedef B = Object with A {}"]), [ParserErrorCode.EXPECTED_TOKEN]); | 6737 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {}
", "typedef B = Object with A {}"]), [ParserErrorCode.EXPECTED_TOKEN]); |
| 6738 } | 6738 } |
| 6739 void test_conditionalExpression_missingElse() { | 6739 void test_conditionalExpression_missingElse() { |
| 6740 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]); | 6740 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 6741 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; | 6741 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; |
| 6742 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); | 6742 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic); |
| 6743 } | 6743 } |
| 6744 void test_conditionalExpression_missingThen() { | 6744 void test_conditionalExpression_missingThen() { |
| 6745 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]); | 6745 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx
pression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 6746 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; | 6746 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; |
| 6747 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); | 6747 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic); |
| 6748 } | 6748 } |
| 6749 void test_equalityExpression_missing_LHS() { | 6749 void test_equalityExpression_missing_LHS() { |
| 6750 BinaryExpression expression = ParserTestCase.parseExpression("== y", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6750 BinaryExpression expression = ParserTestCase.parseExpression("== y", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6751 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6751 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6752 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6752 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6753 } | 6753 } |
| 6754 void test_equalityExpression_missing_LHS_RHS() { | 6754 void test_equalityExpression_missing_LHS_RHS() { |
| 6755 BinaryExpression expression = ParserTestCase.parseExpression("==", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6755 BinaryExpression expression = ParserTestCase.parseExpression("==", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6756 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6756 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6757 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6757 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6758 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6758 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6759 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6759 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6760 } | 6760 } |
| 6761 void test_equalityExpression_missing_RHS() { | 6761 void test_equalityExpression_missing_RHS() { |
| 6762 BinaryExpression expression = ParserTestCase.parseExpression("x ==", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6762 BinaryExpression expression = ParserTestCase.parseExpression("x ==", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6763 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6763 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6764 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6764 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6765 } | 6765 } |
| 6766 void test_equalityExpression_missing_RHS_super() { | 6766 void test_equalityExpression_missing_RHS_super() { |
| 6767 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | 6767 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [Pa
rserErrorCode.MISSING_IDENTIFIER]); |
| 6768 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6768 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6769 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6769 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6770 } | 6770 } |
| 6771 void test_equalityExpression_precedence_relational_left() { | 6771 void test_equalityExpression_precedence_relational_left() { |
| 6772 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [Parse
rErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); | 6772 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [Parse
rErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); |
| 6773 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); | 6773 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); |
| 6774 } | 6774 } |
| 6775 void test_equalityExpression_precedence_relational_right() { | 6775 void test_equalityExpression_precedence_relational_right() { |
| 6776 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); | 6776 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); |
| 6777 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); | 6777 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); |
| 6778 } | 6778 } |
| 6779 void test_equalityExpression_super() { | 6779 void test_equalityExpression_super() { |
| 6780 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6780 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6781 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6781 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6782 } | 6782 } |
| 6783 void test_expressionList_multiple_end() { | 6783 void test_expressionList_multiple_end() { |
| 6784 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2,
3, 4", [ParserErrorCode.MISSING_IDENTIFIER]); | 6784 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2,
3, 4", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 6785 EngineTestCase.assertSize(4, result); | 6785 EngineTestCase.assertSize(4, result); |
| 6786 Expression syntheticExpression = result[0]; | 6786 Expression syntheticExpression = result[0]; |
| 6787 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6787 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6788 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6788 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6789 } | 6789 } |
| 6790 void test_expressionList_multiple_middle() { | 6790 void test_expressionList_multiple_middle() { |
| 6791 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, , 4", [ParserErrorCode.MISSING_IDENTIFIER]); | 6791 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, , 4", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 6792 EngineTestCase.assertSize(4, result); | 6792 EngineTestCase.assertSize(4, result); |
| 6793 Expression syntheticExpression = result[2]; | 6793 Expression syntheticExpression = result[2]; |
| 6794 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6794 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6795 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6795 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6796 } | 6796 } |
| 6797 void test_expressionList_multiple_start() { | 6797 void test_expressionList_multiple_start() { |
| 6798 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3,", [ParserErrorCode.MISSING_IDENTIFIER]); | 6798 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2
, 3,", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 6799 EngineTestCase.assertSize(4, result); | 6799 EngineTestCase.assertSize(4, result); |
| 6800 Expression syntheticExpression = result[3]; | 6800 Expression syntheticExpression = result[3]; |
| 6801 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | 6801 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); |
| 6802 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | 6802 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); |
| 6803 } | 6803 } |
| 6804 void test_isExpression_noType() { | 6804 void test_isExpression_noType() { |
| 6805 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T exte
nds Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.EXPECTED_TYPE_
NAME, ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_STATEMENT]); | 6805 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T exte
nds Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.EXPECTED_TYPE_
NAME, ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_STATEMENT]); |
| 6806 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; | 6806 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; |
| 6807 MethodDeclaration method = declaration.members[0] as MethodDeclaration; | 6807 MethodDeclaration method = declaration.members[0] as MethodDeclaration; |
| 6808 BlockFunctionBody body = method.body as BlockFunctionBody; | 6808 BlockFunctionBody body = method.body as BlockFunctionBody; |
| 6809 IfStatement ifStatement = body.block.statements[1] as IfStatement; | 6809 IfStatement ifStatement = body.block.statements[1] as IfStatement; |
| 6810 IsExpression expression = ifStatement.condition as IsExpression; | 6810 IsExpression expression = ifStatement.condition as IsExpression; |
| 6811 JUnitTestCase.assertNotNull(expression.expression); | 6811 JUnitTestCase.assertNotNull(expression.expression); |
| 6812 JUnitTestCase.assertNotNull(expression.isOperator); | 6812 JUnitTestCase.assertNotNull(expression.isOperator); |
| 6813 JUnitTestCase.assertNotNull(expression.notOperator); | 6813 JUnitTestCase.assertNotNull(expression.notOperator); |
| 6814 TypeName type = expression.type; | 6814 TypeName type = expression.type; |
| 6815 JUnitTestCase.assertNotNull(type); | 6815 JUnitTestCase.assertNotNull(type); |
| 6816 JUnitTestCase.assertTrue(type.name.isSynthetic()); | 6816 JUnitTestCase.assertTrue(type.name.isSynthetic); |
| 6817 EngineTestCase.assertInstanceOf(EmptyStatement, ifStatement.thenStatement); | 6817 EngineTestCase.assertInstanceOf(EmptyStatement, ifStatement.thenStatement); |
| 6818 } | 6818 } |
| 6819 void test_logicalAndExpression_missing_LHS() { | 6819 void test_logicalAndExpression_missing_LHS() { |
| 6820 BinaryExpression expression = ParserTestCase.parseExpression("&& y", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6820 BinaryExpression expression = ParserTestCase.parseExpression("&& y", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6821 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6821 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6822 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6822 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6823 } | 6823 } |
| 6824 void test_logicalAndExpression_missing_LHS_RHS() { | 6824 void test_logicalAndExpression_missing_LHS_RHS() { |
| 6825 BinaryExpression expression = ParserTestCase.parseExpression("&&", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6825 BinaryExpression expression = ParserTestCase.parseExpression("&&", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6826 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6826 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6827 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6827 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6828 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6828 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6829 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6829 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6830 } | 6830 } |
| 6831 void test_logicalAndExpression_missing_RHS() { | 6831 void test_logicalAndExpression_missing_RHS() { |
| 6832 BinaryExpression expression = ParserTestCase.parseExpression("x &&", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6832 BinaryExpression expression = ParserTestCase.parseExpression("x &&", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6833 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6833 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6834 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6834 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6835 } | 6835 } |
| 6836 void test_logicalAndExpression_precedence_bitwiseOr_left() { | 6836 void test_logicalAndExpression_precedence_bitwiseOr_left() { |
| 6837 BinaryExpression expression = ParserTestCase.parseExpression("| &&", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6837 BinaryExpression expression = ParserTestCase.parseExpression("| &&", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6838 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6838 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6839 } | 6839 } |
| 6840 void test_logicalAndExpression_precedence_bitwiseOr_right() { | 6840 void test_logicalAndExpression_precedence_bitwiseOr_right() { |
| 6841 BinaryExpression expression = ParserTestCase.parseExpression("&& |", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6841 BinaryExpression expression = ParserTestCase.parseExpression("&& |", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6842 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6842 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6843 } | 6843 } |
| 6844 void test_logicalOrExpression_missing_LHS() { | 6844 void test_logicalOrExpression_missing_LHS() { |
| 6845 BinaryExpression expression = ParserTestCase.parseExpression("|| y", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6845 BinaryExpression expression = ParserTestCase.parseExpression("|| y", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6846 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6846 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6847 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6847 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6848 } | 6848 } |
| 6849 void test_logicalOrExpression_missing_LHS_RHS() { | 6849 void test_logicalOrExpression_missing_LHS_RHS() { |
| 6850 BinaryExpression expression = ParserTestCase.parseExpression("||", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6850 BinaryExpression expression = ParserTestCase.parseExpression("||", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6851 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6851 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6852 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6852 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6853 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6853 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6854 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6854 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6855 } | 6855 } |
| 6856 void test_logicalOrExpression_missing_RHS() { | 6856 void test_logicalOrExpression_missing_RHS() { |
| 6857 BinaryExpression expression = ParserTestCase.parseExpression("x ||", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6857 BinaryExpression expression = ParserTestCase.parseExpression("x ||", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6858 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6858 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6859 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6859 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6860 } | 6860 } |
| 6861 void test_logicalOrExpression_precedence_logicalAnd_left() { | 6861 void test_logicalOrExpression_precedence_logicalAnd_left() { |
| 6862 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", [Parse
rErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); | 6862 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", [Parse
rErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); |
| 6863 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6863 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6864 } | 6864 } |
| 6865 void test_logicalOrExpression_precedence_logicalAnd_right() { | 6865 void test_logicalOrExpression_precedence_logicalAnd_right() { |
| 6866 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [Parse
rErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); | 6866 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [Parse
rErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCo
de.MISSING_IDENTIFIER]); |
| 6867 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6867 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6868 } | 6868 } |
| 6869 void test_multiplicativeExpression_missing_LHS() { | 6869 void test_multiplicativeExpression_missing_LHS() { |
| 6870 BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6870 BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6871 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6871 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6872 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6872 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6873 } | 6873 } |
| 6874 void test_multiplicativeExpression_missing_LHS_RHS() { | 6874 void test_multiplicativeExpression_missing_LHS_RHS() { |
| 6875 BinaryExpression expression = ParserTestCase.parseExpression("*", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6875 BinaryExpression expression = ParserTestCase.parseExpression("*", [ParserErr
orCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6876 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6876 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6877 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6877 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6878 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6878 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6879 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6879 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6880 } | 6880 } |
| 6881 void test_multiplicativeExpression_missing_RHS() { | 6881 void test_multiplicativeExpression_missing_RHS() { |
| 6882 BinaryExpression expression = ParserTestCase.parseExpression("x *", [ParserE
rrorCode.MISSING_IDENTIFIER]); | 6882 BinaryExpression expression = ParserTestCase.parseExpression("x *", [ParserE
rrorCode.MISSING_IDENTIFIER]); |
| 6883 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6883 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6884 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6884 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6885 } | 6885 } |
| 6886 void test_multiplicativeExpression_missing_RHS_super() { | 6886 void test_multiplicativeExpression_missing_RHS_super() { |
| 6887 BinaryExpression expression = ParserTestCase.parseExpression("super *", [Par
serErrorCode.MISSING_IDENTIFIER]); | 6887 BinaryExpression expression = ParserTestCase.parseExpression("super *", [Par
serErrorCode.MISSING_IDENTIFIER]); |
| 6888 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6888 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6889 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6889 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6890 } | 6890 } |
| 6891 void test_multiplicativeExpression_precedence_unary_left() { | 6891 void test_multiplicativeExpression_precedence_unary_left() { |
| 6892 BinaryExpression expression = ParserTestCase.parseExpression("-x *", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6892 BinaryExpression expression = ParserTestCase.parseExpression("-x *", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6893 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); | 6893 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); |
| 6894 } | 6894 } |
| 6895 void test_multiplicativeExpression_precedence_unary_right() { | 6895 void test_multiplicativeExpression_precedence_unary_right() { |
| 6896 BinaryExpression expression = ParserTestCase.parseExpression("* -y", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6896 BinaryExpression expression = ParserTestCase.parseExpression("* -y", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6897 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); | 6897 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); |
| 6898 } | 6898 } |
| 6899 void test_multiplicativeExpression_super() { | 6899 void test_multiplicativeExpression_super() { |
| 6900 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6900 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6901 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6901 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6902 } | 6902 } |
| 6903 void test_prefixExpression_missing_operand_minus() { | 6903 void test_prefixExpression_missing_operand_minus() { |
| 6904 PrefixExpression expression = ParserTestCase.parseExpression("-", [ParserErr
orCode.MISSING_IDENTIFIER]); | 6904 PrefixExpression expression = ParserTestCase.parseExpression("-", [ParserErr
orCode.MISSING_IDENTIFIER]); |
| 6905 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand); | 6905 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand); |
| 6906 JUnitTestCase.assertTrue(expression.operand.isSynthetic()); | 6906 JUnitTestCase.assertTrue(expression.operand.isSynthetic); |
| 6907 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | 6907 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); |
| 6908 } | 6908 } |
| 6909 void test_relationalExpression_missing_LHS() { | 6909 void test_relationalExpression_missing_LHS() { |
| 6910 IsExpression expression = ParserTestCase.parseExpression("is y", [ParserErro
rCode.MISSING_IDENTIFIER]); | 6910 IsExpression expression = ParserTestCase.parseExpression("is y", [ParserErro
rCode.MISSING_IDENTIFIER]); |
| 6911 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | 6911 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); |
| 6912 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | 6912 JUnitTestCase.assertTrue(expression.expression.isSynthetic); |
| 6913 } | 6913 } |
| 6914 void test_relationalExpression_missing_LHS_RHS() { | 6914 void test_relationalExpression_missing_LHS_RHS() { |
| 6915 IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorC
ode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER]); | 6915 IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorC
ode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6916 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | 6916 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); |
| 6917 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | 6917 JUnitTestCase.assertTrue(expression.expression.isSynthetic); |
| 6918 EngineTestCase.assertInstanceOf(TypeName, expression.type); | 6918 EngineTestCase.assertInstanceOf(TypeName, expression.type); |
| 6919 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | 6919 JUnitTestCase.assertTrue(expression.type.isSynthetic); |
| 6920 } | 6920 } |
| 6921 void test_relationalExpression_missing_RHS() { | 6921 void test_relationalExpression_missing_RHS() { |
| 6922 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro
rCode.EXPECTED_TYPE_NAME]); | 6922 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro
rCode.EXPECTED_TYPE_NAME]); |
| 6923 EngineTestCase.assertInstanceOf(TypeName, expression.type); | 6923 EngineTestCase.assertInstanceOf(TypeName, expression.type); |
| 6924 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | 6924 JUnitTestCase.assertTrue(expression.type.isSynthetic); |
| 6925 } | 6925 } |
| 6926 void test_relationalExpression_precedence_shift_right() { | 6926 void test_relationalExpression_precedence_shift_right() { |
| 6927 IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErr
orCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.M
ISSING_IDENTIFIER]); | 6927 IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErr
orCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.M
ISSING_IDENTIFIER]); |
| 6928 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); | 6928 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); |
| 6929 } | 6929 } |
| 6930 void test_shiftExpression_missing_LHS() { | 6930 void test_shiftExpression_missing_LHS() { |
| 6931 BinaryExpression expression = ParserTestCase.parseExpression("<< y", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6931 BinaryExpression expression = ParserTestCase.parseExpression("<< y", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6932 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6932 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6933 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6933 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6934 } | 6934 } |
| 6935 void test_shiftExpression_missing_LHS_RHS() { | 6935 void test_shiftExpression_missing_LHS_RHS() { |
| 6936 BinaryExpression expression = ParserTestCase.parseExpression("<<", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); | 6936 BinaryExpression expression = ParserTestCase.parseExpression("<<", [ParserEr
rorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]); |
| 6937 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | 6937 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); |
| 6938 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | 6938 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); |
| 6939 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6939 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6940 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6940 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6941 } | 6941 } |
| 6942 void test_shiftExpression_missing_RHS() { | 6942 void test_shiftExpression_missing_RHS() { |
| 6943 BinaryExpression expression = ParserTestCase.parseExpression("x <<", [Parser
ErrorCode.MISSING_IDENTIFIER]); | 6943 BinaryExpression expression = ParserTestCase.parseExpression("x <<", [Parser
ErrorCode.MISSING_IDENTIFIER]); |
| 6944 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6944 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6945 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6945 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6946 } | 6946 } |
| 6947 void test_shiftExpression_missing_RHS_super() { | 6947 void test_shiftExpression_missing_RHS_super() { |
| 6948 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | 6948 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [Pa
rserErrorCode.MISSING_IDENTIFIER]); |
| 6949 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | 6949 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); |
| 6950 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | 6950 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic); |
| 6951 } | 6951 } |
| 6952 void test_shiftExpression_precedence_unary_left() { | 6952 void test_shiftExpression_precedence_unary_left() { |
| 6953 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6953 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6954 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | 6954 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); |
| 6955 } | 6955 } |
| 6956 void test_shiftExpression_precedence_unary_right() { | 6956 void test_shiftExpression_precedence_unary_right() { |
| 6957 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); | 6957 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCod
e.MISSING_IDENTIFIER]); |
| 6958 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | 6958 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); |
| 6959 } | 6959 } |
| 6960 void test_shiftExpression_super() { | 6960 void test_shiftExpression_super() { |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7281 }); | 7281 }); |
| 7282 } | 7282 } |
| 7283 } | 7283 } |
| 7284 /** | 7284 /** |
| 7285 * The class `ErrorParserTest` defines parser tests that test the parsing of cod
e to ensure | 7285 * The class `ErrorParserTest` defines parser tests that test the parsing of cod
e to ensure |
| 7286 * that errors are correctly reported, and in some cases, not reported. | 7286 * that errors are correctly reported, and in some cases, not reported. |
| 7287 */ | 7287 */ |
| 7288 class ErrorParserTest extends ParserTestCase { | 7288 class ErrorParserTest extends ParserTestCase { |
| 7289 void fail_expectedListOrMapLiteral() { | 7289 void fail_expectedListOrMapLiteral() { |
| 7290 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); | 7290 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); |
| 7291 JUnitTestCase.assertTrue(literal.isSynthetic()); | 7291 JUnitTestCase.assertTrue(literal.isSynthetic); |
| 7292 } | 7292 } |
| 7293 void fail_illegalAssignmentToNonAssignable_superAssigned() { | 7293 void fail_illegalAssignmentToNonAssignable_superAssigned() { |
| 7294 ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGN
MENT_TO_NON_ASSIGNABLE]); | 7294 ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGN
MENT_TO_NON_ASSIGNABLE]); |
| 7295 } | 7295 } |
| 7296 void fail_invalidCommentReference__new_nonIdentifier() { | 7296 void fail_invalidCommentReference__new_nonIdentifier() { |
| 7297 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 7297 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 7298 } | 7298 } |
| 7299 void fail_invalidCommentReference__new_tooMuch() { | 7299 void fail_invalidCommentReference__new_tooMuch() { |
| 7300 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); | 7300 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); |
| 7301 } | 7301 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7483 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn
dMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]); | 7483 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn
dMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]); |
| 7484 } | 7484 } |
| 7485 void test_expectedExecutable_topLevel_beforeType() { | 7485 void test_expectedExecutable_topLevel_beforeType() { |
| 7486 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn
dMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]); | 7486 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn
dMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]); |
| 7487 } | 7487 } |
| 7488 void test_expectedInterpolationIdentifier() { | 7488 void test_expectedInterpolationIdentifier() { |
| 7489 ParserTestCase.parse5("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISS
ING_IDENTIFIER]); | 7489 ParserTestCase.parse5("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISS
ING_IDENTIFIER]); |
| 7490 } | 7490 } |
| 7491 void test_expectedStringLiteral() { | 7491 void test_expectedStringLiteral() { |
| 7492 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); | 7492 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); |
| 7493 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7493 JUnitTestCase.assertTrue(expression.isSynthetic); |
| 7494 } | 7494 } |
| 7495 void test_expectedToken_commaMissingInArgumentList() { | 7495 void test_expectedToken_commaMissingInArgumentList() { |
| 7496 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); | 7496 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); |
| 7497 } | 7497 } |
| 7498 void test_expectedToken_semicolonMissingAfterExpression() { | 7498 void test_expectedToken_semicolonMissingAfterExpression() { |
| 7499 ParserTestCase.parseStatement("x", [ParserErrorCode.EXPECTED_TOKEN]); | 7499 ParserTestCase.parseStatement("x", [ParserErrorCode.EXPECTED_TOKEN]); |
| 7500 } | 7500 } |
| 7501 void test_expectedToken_whileMissingInDoStatement() { | 7501 void test_expectedToken_whileMissingInDoStatement() { |
| 7502 ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN]
); | 7502 ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN]
); |
| 7503 } | 7503 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7711 ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING
_FUNCTION_PARAMETERS]); | 7711 ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING
_FUNCTION_PARAMETERS]); |
| 7712 } | 7712 } |
| 7713 void test_missingIdentifier_afterOperator() { | 7713 void test_missingIdentifier_afterOperator() { |
| 7714 ParserTestCase.parse5("parseMultiplicativeExpression", "1 *", [ParserErrorCo
de.MISSING_IDENTIFIER]); | 7714 ParserTestCase.parse5("parseMultiplicativeExpression", "1 *", [ParserErrorCo
de.MISSING_IDENTIFIER]); |
| 7715 } | 7715 } |
| 7716 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { | 7716 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { |
| 7717 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | 7717 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); |
| 7718 } | 7718 } |
| 7719 void test_missingIdentifier_number() { | 7719 void test_missingIdentifier_number() { |
| 7720 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); | 7720 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 7721 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7721 JUnitTestCase.assertTrue(expression.isSynthetic); |
| 7722 } | 7722 } |
| 7723 void test_missingKeywordOperator() { | 7723 void test_missingKeywordOperator() { |
| 7724 ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(),
null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]); | 7724 ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(),
null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]); |
| 7725 } | 7725 } |
| 7726 void test_missingNameInLibraryDirective() { | 7726 void test_missingNameInLibraryDirective() { |
| 7727 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [Pars
erErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); | 7727 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [Pars
erErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); |
| 7728 JUnitTestCase.assertNotNull(unit); | 7728 JUnitTestCase.assertNotNull(unit); |
| 7729 } | 7729 } |
| 7730 void test_missingNameInPartOfDirective() { | 7730 void test_missingNameInPartOfDirective() { |
| 7731 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [Pars
erErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); | 7731 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [Pars
erErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7864 } | 7864 } |
| 7865 void test_unexpectedToken_semicolonBetweenClassMembers() { | 7865 void test_unexpectedToken_semicolonBetweenClassMembers() { |
| 7866 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; | 7866 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; |
| 7867 } | 7867 } |
| 7868 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { | 7868 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { |
| 7869 ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEX
PECTED_TOKEN]); | 7869 ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEX
PECTED_TOKEN]); |
| 7870 } | 7870 } |
| 7871 void test_useOfUnaryPlusOperator() { | 7871 void test_useOfUnaryPlusOperator() { |
| 7872 SimpleIdentifier expression = ParserTestCase.parse5("parseUnaryExpression",
"+x", [ParserErrorCode.MISSING_IDENTIFIER]); | 7872 SimpleIdentifier expression = ParserTestCase.parse5("parseUnaryExpression",
"+x", [ParserErrorCode.MISSING_IDENTIFIER]); |
| 7873 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression); | 7873 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression); |
| 7874 JUnitTestCase.assertTrue(expression.isSynthetic()); | 7874 JUnitTestCase.assertTrue(expression.isSynthetic); |
| 7875 } | 7875 } |
| 7876 void test_varAsTypeName_as() { | 7876 void test_varAsTypeName_as() { |
| 7877 ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME
]); | 7877 ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME
]); |
| 7878 } | 7878 } |
| 7879 void test_varClass() { | 7879 void test_varClass() { |
| 7880 ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_C
LASS]); | 7880 ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_C
LASS]); |
| 7881 } | 7881 } |
| 7882 void test_varReturnType() { | 7882 void test_varReturnType() { |
| 7883 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); | 7883 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); |
| 7884 } | 7884 } |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8695 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe
t) => target.couldBeStartOfCompilationUnitMember()), | 8695 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe
t) => target.couldBeStartOfCompilationUnitMember()), |
| 8696 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ
et.createSyntheticIdentifier()), | 8696 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ
et.createSyntheticIdentifier()), |
| 8697 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t
arget.createSyntheticStringLiteral()), | 8697 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t
arget.createSyntheticStringLiteral()), |
| 8698 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.createSyntheticToken(arg0)), | 8698 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.createSyntheticToken(arg0)), |
| 8699 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target.
ensureAssignable(arg0)), | 8699 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target.
ensureAssignable(arg0)), |
| 8700 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg
0)), | 8700 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg
0)), |
| 8701 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f
indRange(arg0, arg1)), | 8701 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f
indRange(arg0, arg1)), |
| 8702 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe
t.getCodeBlockRanges(arg0)), | 8702 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe
t.getCodeBlockRanges(arg0)), |
| 8703 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn
dToken(arg0)), | 8703 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn
dToken(arg0)), |
| 8704 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe
t.hasReturnTypeInTypeAlias()), | 8704 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe
t.hasReturnTypeInTypeAlias()), |
| 8705 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i
sFunctionDeclaration()), | |
| 8706 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.isFunctionExpression(arg0)), | 8705 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.isFunctionExpression(arg0)), |
| 8707 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD
igit(arg0)), | 8706 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD
igit(arg0)), |
| 8708 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target)
=> target.isInitializedVariableDeclaration()), | |
| 8709 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.
isLinkText(arg0, arg1)), | 8707 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.
isLinkText(arg0, arg1)), |
| 8710 'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target.isOper
ator(arg0)), | 8708 'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target.isOper
ator(arg0)), |
| 8711 'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target.isSwitch
Member()), | |
| 8712 'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.le
xicallyFirst(arg0)), | 8709 'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.le
xicallyFirst(arg0)), |
| 8713 'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(a
rg0)), | 8710 'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(a
rg0)), |
| 8714 'matches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.mat
ches3(arg0, arg1)), | 8711 'matches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.mat
ches3(arg0, arg1)), |
| 8715 'matchesAny_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.
matchesAny(arg0, arg1)), | 8712 'matchesAny_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.
matchesAny(arg0, arg1)), |
| 8716 'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target.match
esIdentifier()), | 8713 'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target.match
esIdentifier()), |
| 8717 'matchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target
.matchesIdentifier2(arg0)), | 8714 'matchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target
.matchesIdentifier2(arg0)), |
| 8718 'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target.optional
(arg0)), | 8715 'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target.optional
(arg0)), |
| 8719 'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseAdditiveExpression()), | 8716 'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseAdditiveExpression()), |
| 8720 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn
notation()), | 8717 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn
notation()), |
| 8721 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu
ment()), | 8718 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu
ment()), |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8851 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), | 8848 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), |
| 8852 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), | 8849 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), |
| 8853 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; | 8850 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; |
| 8854 | 8851 |
| 8855 | 8852 |
| 8856 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { | 8853 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { |
| 8857 parser.currentToken = tokenStream; | 8854 parser.currentToken = tokenStream; |
| 8858 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; | 8855 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; |
| 8859 return method.invoke(parser, objects); | 8856 return method.invoke(parser, objects); |
| 8860 } | 8857 } |
| OLD | NEW |