| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 3464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3475 listener.assertErrorsWithCodes([ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | 3475 listener.assertErrorsWithCodes([ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); |
| 3476 } | 3476 } |
| 3477 | 3477 |
| 3478 void test_nonIdentifierLibraryName_library() { | 3478 void test_nonIdentifierLibraryName_library() { |
| 3479 CompilationUnit unit = parseCompilationUnit( | 3479 CompilationUnit unit = parseCompilationUnit( |
| 3480 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 3480 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 3481 expect(unit, isNotNull); | 3481 expect(unit, isNotNull); |
| 3482 } | 3482 } |
| 3483 | 3483 |
| 3484 void test_nonIdentifierLibraryName_partOf() { | 3484 void test_nonIdentifierLibraryName_partOf() { |
| 3485 CompilationUnit unit = parseCompilationUnit( | 3485 CompilationUnit unit = parseCompilationUnit("part of 3;", [ |
| 3486 "part of 3;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, | 3486 ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, |
| 3487 ParserErrorCode.UNEXPECTED_TOKEN]); | 3487 ParserErrorCode.UNEXPECTED_TOKEN |
| 3488 ]); |
| 3488 expect(unit, isNotNull); | 3489 expect(unit, isNotNull); |
| 3489 } | 3490 } |
| 3490 | 3491 |
| 3491 void test_nonPartOfDirectiveInPart_after() { | 3492 void test_nonPartOfDirectiveInPart_after() { |
| 3492 parseCompilationUnit("part of l; part 'f.dart';", | 3493 parseCompilationUnit("part of l; part 'f.dart';", |
| 3493 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 3494 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 3494 } | 3495 } |
| 3495 | 3496 |
| 3496 void test_nonPartOfDirectiveInPart_before() { | 3497 void test_nonPartOfDirectiveInPart_before() { |
| 3497 parseCompilationUnit("part 'f.dart'; part of m;", | 3498 parseCompilationUnit("part 'f.dart'; part of m;", |
| (...skipping 9675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13173 expect(declaration.documentationComment, isNull); | 13174 expect(declaration.documentationComment, isNull); |
| 13174 expect(declaration.abstractKeyword, isNull); | 13175 expect(declaration.abstractKeyword, isNull); |
| 13175 expect(declaration.extendsClause, isNull); | 13176 expect(declaration.extendsClause, isNull); |
| 13176 expect(declaration.implementsClause, isNull); | 13177 expect(declaration.implementsClause, isNull); |
| 13177 expect(declaration.classKeyword, isNotNull); | 13178 expect(declaration.classKeyword, isNotNull); |
| 13178 expect(declaration.leftBracket, isNotNull); | 13179 expect(declaration.leftBracket, isNotNull); |
| 13179 expect(declaration.name, isNotNull); | 13180 expect(declaration.name, isNotNull); |
| 13180 expect(declaration.members, hasLength(0)); | 13181 expect(declaration.members, hasLength(0)); |
| 13181 expect(declaration.rightBracket, isNotNull); | 13182 expect(declaration.rightBracket, isNotNull); |
| 13182 expect(declaration.typeParameters, isNull); | 13183 expect(declaration.typeParameters, isNull); |
| 13184 _assertDeclarationName(declaration.name); |
| 13185 } |
| 13186 |
| 13187 /** |
| 13188 * Assert that the given [name] is in declaration context. |
| 13189 */ |
| 13190 void _assertDeclarationName(SimpleIdentifier name) { |
| 13191 expect(name.inDeclarationContext(), isTrue); |
| 13183 } | 13192 } |
| 13184 | 13193 |
| 13185 void test_parseClassDeclaration_extends() { | 13194 void test_parseClassDeclaration_extends() { |
| 13186 createParser('class A extends B {}'); | 13195 createParser('class A extends B {}'); |
| 13187 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13196 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13188 expect(member, isNotNull); | 13197 expect(member, isNotNull); |
| 13189 assertNoErrors(); | 13198 assertNoErrors(); |
| 13190 expect(member, new isInstanceOf<ClassDeclaration>()); | 13199 expect(member, new isInstanceOf<ClassDeclaration>()); |
| 13191 ClassDeclaration declaration = member; | 13200 ClassDeclaration declaration = member; |
| 13192 expect(declaration.documentationComment, isNull); | 13201 expect(declaration.documentationComment, isNull); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13321 expect(member, new isInstanceOf<ClassTypeAlias>()); | 13330 expect(member, new isInstanceOf<ClassTypeAlias>()); |
| 13322 ClassTypeAlias typeAlias = member; | 13331 ClassTypeAlias typeAlias = member; |
| 13323 expect(typeAlias.typedefKeyword, isNotNull); | 13332 expect(typeAlias.typedefKeyword, isNotNull); |
| 13324 expect(typeAlias.name, isNotNull); | 13333 expect(typeAlias.name, isNotNull); |
| 13325 expect(typeAlias.typeParameters, isNull); | 13334 expect(typeAlias.typeParameters, isNull); |
| 13326 expect(typeAlias.withClause, isNotNull); | 13335 expect(typeAlias.withClause, isNotNull); |
| 13327 expect(typeAlias.implementsClause, isNotNull); | 13336 expect(typeAlias.implementsClause, isNotNull); |
| 13328 expect(typeAlias.implementsClause.implementsKeyword, isNotNull); | 13337 expect(typeAlias.implementsClause.implementsKeyword, isNotNull); |
| 13329 expect(typeAlias.implementsClause.interfaces.length, 1); | 13338 expect(typeAlias.implementsClause.interfaces.length, 1); |
| 13330 expect(typeAlias.semicolon, isNotNull); | 13339 expect(typeAlias.semicolon, isNotNull); |
| 13340 _assertDeclarationName(typeAlias.name); |
| 13331 } | 13341 } |
| 13332 | 13342 |
| 13333 void test_parseClassDeclaration_typeAlias_withB() { | 13343 void test_parseClassDeclaration_typeAlias_withB() { |
| 13334 createParser('class A = Object with B;'); | 13344 createParser('class A = Object with B;'); |
| 13335 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13345 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13336 expect(member, isNotNull); | 13346 expect(member, isNotNull); |
| 13337 assertNoErrors(); | 13347 assertNoErrors(); |
| 13338 expect(member, new isInstanceOf<ClassTypeAlias>()); | 13348 expect(member, new isInstanceOf<ClassTypeAlias>()); |
| 13339 ClassTypeAlias typeAlias = member; | 13349 ClassTypeAlias typeAlias = member; |
| 13340 expect(typeAlias.typedefKeyword, isNotNull); | 13350 expect(typeAlias.typedefKeyword, isNotNull); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 13358 expect(declaration.abstractKeyword, isNull); | 13368 expect(declaration.abstractKeyword, isNull); |
| 13359 expect(declaration.extendsClause, isNull); | 13369 expect(declaration.extendsClause, isNull); |
| 13360 expect(declaration.implementsClause, isNull); | 13370 expect(declaration.implementsClause, isNull); |
| 13361 expect(declaration.classKeyword, isNotNull); | 13371 expect(declaration.classKeyword, isNotNull); |
| 13362 expect(declaration.leftBracket, isNotNull); | 13372 expect(declaration.leftBracket, isNotNull); |
| 13363 expect(declaration.name, isNotNull); | 13373 expect(declaration.name, isNotNull); |
| 13364 expect(declaration.members, hasLength(0)); | 13374 expect(declaration.members, hasLength(0)); |
| 13365 expect(declaration.rightBracket, isNotNull); | 13375 expect(declaration.rightBracket, isNotNull); |
| 13366 expect(declaration.typeParameters, isNotNull); | 13376 expect(declaration.typeParameters, isNotNull); |
| 13367 expect(declaration.typeParameters.typeParameters, hasLength(1)); | 13377 expect(declaration.typeParameters.typeParameters, hasLength(1)); |
| 13378 _assertDeclarationName(declaration.typeParameters.typeParameters[0].name); |
| 13368 } | 13379 } |
| 13369 | 13380 |
| 13370 void test_parseClassDeclaration_withDocumentationComment() { | 13381 void test_parseClassDeclaration_withDocumentationComment() { |
| 13371 createParser('/// Doc\nclass C {}'); | 13382 createParser('/// Doc\nclass C {}'); |
| 13372 var classDeclaration = parseFullCompilationUnitMember() as ClassDeclaration; | 13383 var classDeclaration = parseFullCompilationUnitMember() as ClassDeclaration; |
| 13373 expectCommentText(classDeclaration.documentationComment, '/// Doc'); | 13384 expectCommentText(classDeclaration.documentationComment, '/// Doc'); |
| 13374 } | 13385 } |
| 13375 | 13386 |
| 13376 void test_parseClassTypeAlias_withDocumentationComment() { | 13387 void test_parseClassTypeAlias_withDocumentationComment() { |
| 13377 createParser('/// Doc\nclass C = D with E;'); | 13388 createParser('/// Doc\nclass C = D with E;'); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13543 void test_parseCompilationUnitMember_constVariable() { | 13554 void test_parseCompilationUnitMember_constVariable() { |
| 13544 createParser('const int x = 0;'); | 13555 createParser('const int x = 0;'); |
| 13545 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13556 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13546 expect(member, isNotNull); | 13557 expect(member, isNotNull); |
| 13547 assertNoErrors(); | 13558 assertNoErrors(); |
| 13548 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); | 13559 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); |
| 13549 TopLevelVariableDeclaration declaration = member; | 13560 TopLevelVariableDeclaration declaration = member; |
| 13550 expect(declaration.semicolon, isNotNull); | 13561 expect(declaration.semicolon, isNotNull); |
| 13551 expect(declaration.variables, isNotNull); | 13562 expect(declaration.variables, isNotNull); |
| 13552 expect(declaration.variables.keyword.lexeme, 'const'); | 13563 expect(declaration.variables.keyword.lexeme, 'const'); |
| 13564 _assertDeclarationName(declaration.variables.variables[0].name); |
| 13553 } | 13565 } |
| 13554 | 13566 |
| 13555 void test_parseCompilationUnitMember_expressionFunctionBody_tokens() { | 13567 void test_parseCompilationUnitMember_expressionFunctionBody_tokens() { |
| 13556 createParser('f() => 0;'); | 13568 createParser('f() => 0;'); |
| 13557 var f = parseFullCompilationUnitMember() as FunctionDeclaration; | 13569 var f = parseFullCompilationUnitMember() as FunctionDeclaration; |
| 13558 var body = f.functionExpression.body as ExpressionFunctionBody; | 13570 var body = f.functionExpression.body as ExpressionFunctionBody; |
| 13559 expect(body.functionDefinition.lexeme, '=>'); | 13571 expect(body.functionDefinition.lexeme, '=>'); |
| 13560 expect(body.semicolon.lexeme, ';'); | 13572 expect(body.semicolon.lexeme, ';'); |
| 13573 _assertDeclarationName(f.name); |
| 13561 } | 13574 } |
| 13562 | 13575 |
| 13563 void test_parseCompilationUnitMember_finalVariable() { | 13576 void test_parseCompilationUnitMember_finalVariable() { |
| 13564 createParser('final x = 0;'); | 13577 createParser('final x = 0;'); |
| 13565 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13578 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13566 expect(member, isNotNull); | 13579 expect(member, isNotNull); |
| 13567 assertNoErrors(); | 13580 assertNoErrors(); |
| 13568 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); | 13581 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); |
| 13569 TopLevelVariableDeclaration declaration = member; | 13582 TopLevelVariableDeclaration declaration = member; |
| 13570 expect(declaration.semicolon, isNotNull); | 13583 expect(declaration.semicolon, isNotNull); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13676 void test_parseCompilationUnitMember_getter_external_noType() { | 13689 void test_parseCompilationUnitMember_getter_external_noType() { |
| 13677 createParser('external get p;'); | 13690 createParser('external get p;'); |
| 13678 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13691 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13679 expect(member, isNotNull); | 13692 expect(member, isNotNull); |
| 13680 assertNoErrors(); | 13693 assertNoErrors(); |
| 13681 expect(member, new isInstanceOf<FunctionDeclaration>()); | 13694 expect(member, new isInstanceOf<FunctionDeclaration>()); |
| 13682 FunctionDeclaration declaration = member; | 13695 FunctionDeclaration declaration = member; |
| 13683 expect(declaration.externalKeyword, isNotNull); | 13696 expect(declaration.externalKeyword, isNotNull); |
| 13684 expect(declaration.functionExpression, isNotNull); | 13697 expect(declaration.functionExpression, isNotNull); |
| 13685 expect(declaration.propertyKeyword, isNotNull); | 13698 expect(declaration.propertyKeyword, isNotNull); |
| 13699 _assertDeclarationName(declaration.name); |
| 13686 } | 13700 } |
| 13687 | 13701 |
| 13688 void test_parseCompilationUnitMember_getter_external_type() { | 13702 void test_parseCompilationUnitMember_getter_external_type() { |
| 13689 createParser('external int get p;'); | 13703 createParser('external int get p;'); |
| 13690 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13704 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13691 expect(member, isNotNull); | 13705 expect(member, isNotNull); |
| 13692 assertNoErrors(); | 13706 assertNoErrors(); |
| 13693 expect(member, new isInstanceOf<FunctionDeclaration>()); | 13707 expect(member, new isInstanceOf<FunctionDeclaration>()); |
| 13694 FunctionDeclaration declaration = member; | 13708 FunctionDeclaration declaration = member; |
| 13695 expect(declaration.externalKeyword, isNotNull); | 13709 expect(declaration.externalKeyword, isNotNull); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13745 | 13759 |
| 13746 void test_parseCompilationUnitMember_setter_noType() { | 13760 void test_parseCompilationUnitMember_setter_noType() { |
| 13747 createParser('set p(v) {}'); | 13761 createParser('set p(v) {}'); |
| 13748 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13762 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13749 expect(member, isNotNull); | 13763 expect(member, isNotNull); |
| 13750 assertNoErrors(); | 13764 assertNoErrors(); |
| 13751 expect(member, new isInstanceOf<FunctionDeclaration>()); | 13765 expect(member, new isInstanceOf<FunctionDeclaration>()); |
| 13752 FunctionDeclaration declaration = member; | 13766 FunctionDeclaration declaration = member; |
| 13753 expect(declaration.functionExpression, isNotNull); | 13767 expect(declaration.functionExpression, isNotNull); |
| 13754 expect(declaration.propertyKeyword, isNotNull); | 13768 expect(declaration.propertyKeyword, isNotNull); |
| 13769 _assertDeclarationName(declaration.name); |
| 13755 } | 13770 } |
| 13756 | 13771 |
| 13757 void test_parseCompilationUnitMember_setter_type() { | 13772 void test_parseCompilationUnitMember_setter_type() { |
| 13758 createParser('void set p(int v) {}'); | 13773 createParser('void set p(int v) {}'); |
| 13759 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13774 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13760 expect(member, isNotNull); | 13775 expect(member, isNotNull); |
| 13761 assertNoErrors(); | 13776 assertNoErrors(); |
| 13762 expect(member, new isInstanceOf<FunctionDeclaration>()); | 13777 expect(member, new isInstanceOf<FunctionDeclaration>()); |
| 13763 FunctionDeclaration declaration = member; | 13778 FunctionDeclaration declaration = member; |
| 13764 expect(declaration.functionExpression, isNotNull); | 13779 expect(declaration.functionExpression, isNotNull); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 13775 ClassTypeAlias typeAlias = member; | 13790 ClassTypeAlias typeAlias = member; |
| 13776 expect(typeAlias.typedefKeyword, isNotNull); | 13791 expect(typeAlias.typedefKeyword, isNotNull); |
| 13777 expect(typeAlias.name.name, "C"); | 13792 expect(typeAlias.name.name, "C"); |
| 13778 expect(typeAlias.typeParameters, isNull); | 13793 expect(typeAlias.typeParameters, isNull); |
| 13779 expect(typeAlias.equals, isNotNull); | 13794 expect(typeAlias.equals, isNotNull); |
| 13780 expect(typeAlias.abstractKeyword, isNotNull); | 13795 expect(typeAlias.abstractKeyword, isNotNull); |
| 13781 expect(typeAlias.superclass.name.name, "S"); | 13796 expect(typeAlias.superclass.name.name, "S"); |
| 13782 expect(typeAlias.withClause, isNotNull); | 13797 expect(typeAlias.withClause, isNotNull); |
| 13783 expect(typeAlias.implementsClause, isNull); | 13798 expect(typeAlias.implementsClause, isNull); |
| 13784 expect(typeAlias.semicolon, isNotNull); | 13799 expect(typeAlias.semicolon, isNotNull); |
| 13800 _assertDeclarationName(typeAlias.name); |
| 13785 } | 13801 } |
| 13786 | 13802 |
| 13787 void test_parseCompilationUnitMember_typeAlias_generic() { | 13803 void test_parseCompilationUnitMember_typeAlias_generic() { |
| 13788 createParser('class C<E> = S<E> with M<E> implements I<E>;'); | 13804 createParser('class C<E> = S<E> with M<E> implements I<E>;'); |
| 13789 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13805 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13790 expect(member, isNotNull); | 13806 expect(member, isNotNull); |
| 13791 assertNoErrors(); | 13807 assertNoErrors(); |
| 13792 expect(member, new isInstanceOf<ClassTypeAlias>()); | 13808 expect(member, new isInstanceOf<ClassTypeAlias>()); |
| 13793 ClassTypeAlias typeAlias = member; | 13809 ClassTypeAlias typeAlias = member; |
| 13794 expect(typeAlias.typedefKeyword, isNotNull); | 13810 expect(typeAlias.typedefKeyword, isNotNull); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13840 | 13856 |
| 13841 void test_parseCompilationUnitMember_typedef() { | 13857 void test_parseCompilationUnitMember_typedef() { |
| 13842 createParser('typedef F();'); | 13858 createParser('typedef F();'); |
| 13843 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13859 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13844 expect(member, isNotNull); | 13860 expect(member, isNotNull); |
| 13845 assertNoErrors(); | 13861 assertNoErrors(); |
| 13846 expect(member, new isInstanceOf<FunctionTypeAlias>()); | 13862 expect(member, new isInstanceOf<FunctionTypeAlias>()); |
| 13847 FunctionTypeAlias typeAlias = member; | 13863 FunctionTypeAlias typeAlias = member; |
| 13848 expect(typeAlias.name.name, "F"); | 13864 expect(typeAlias.name.name, "F"); |
| 13849 expect(typeAlias.parameters.parameters, hasLength(0)); | 13865 expect(typeAlias.parameters.parameters, hasLength(0)); |
| 13866 _assertDeclarationName(typeAlias.name); |
| 13850 } | 13867 } |
| 13851 | 13868 |
| 13852 void test_parseCompilationUnitMember_typedef_withDocComment() { | 13869 void test_parseCompilationUnitMember_typedef_withDocComment() { |
| 13853 createParser('/// Doc\ntypedef F();'); | 13870 createParser('/// Doc\ntypedef F();'); |
| 13854 var typeAlias = parseFullCompilationUnitMember() as FunctionTypeAlias; | 13871 var typeAlias = parseFullCompilationUnitMember() as FunctionTypeAlias; |
| 13855 expectCommentText(typeAlias.documentationComment, '/// Doc'); | 13872 expectCommentText(typeAlias.documentationComment, '/// Doc'); |
| 13856 } | 13873 } |
| 13857 | 13874 |
| 13858 void test_parseCompilationUnitMember_typedVariable() { | 13875 void test_parseCompilationUnitMember_typedVariable() { |
| 13859 createParser('int x = 0;'); | 13876 createParser('int x = 0;'); |
| 13860 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13877 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13861 expect(member, isNotNull); | 13878 expect(member, isNotNull); |
| 13862 assertNoErrors(); | 13879 assertNoErrors(); |
| 13863 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); | 13880 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); |
| 13864 TopLevelVariableDeclaration declaration = member; | 13881 TopLevelVariableDeclaration declaration = member; |
| 13865 expect(declaration.semicolon, isNotNull); | 13882 expect(declaration.semicolon, isNotNull); |
| 13866 expect(declaration.variables, isNotNull); | 13883 expect(declaration.variables, isNotNull); |
| 13867 expect(declaration.variables.type, isNotNull); | 13884 expect(declaration.variables.type, isNotNull); |
| 13868 expect(declaration.variables.keyword, isNull); | 13885 expect(declaration.variables.keyword, isNull); |
| 13886 _assertDeclarationName(declaration.variables.variables[0].name); |
| 13869 } | 13887 } |
| 13870 | 13888 |
| 13871 void test_parseCompilationUnitMember_variable() { | 13889 void test_parseCompilationUnitMember_variable() { |
| 13872 createParser('var x = 0;'); | 13890 createParser('var x = 0;'); |
| 13873 CompilationUnitMember member = parseFullCompilationUnitMember(); | 13891 CompilationUnitMember member = parseFullCompilationUnitMember(); |
| 13874 expect(member, isNotNull); | 13892 expect(member, isNotNull); |
| 13875 assertNoErrors(); | 13893 assertNoErrors(); |
| 13876 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); | 13894 expect(member, new isInstanceOf<TopLevelVariableDeclaration>()); |
| 13877 TopLevelVariableDeclaration declaration = member; | 13895 TopLevelVariableDeclaration declaration = member; |
| 13878 expect(declaration.semicolon, isNotNull); | 13896 expect(declaration.semicolon, isNotNull); |
| (...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14791 createParser(''' | 14809 createParser(''' |
| 14792 class A< | 14810 class A< |
| 14793 /// Doc | 14811 /// Doc |
| 14794 B> {} | 14812 B> {} |
| 14795 '''); | 14813 '''); |
| 14796 var classDeclaration = parseFullCompilationUnitMember() as ClassDeclaration; | 14814 var classDeclaration = parseFullCompilationUnitMember() as ClassDeclaration; |
| 14797 var typeVariable = classDeclaration.typeParameters.typeParameters[0]; | 14815 var typeVariable = classDeclaration.typeParameters.typeParameters[0]; |
| 14798 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 14816 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
| 14799 } | 14817 } |
| 14800 } | 14818 } |
| OLD | NEW |