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 3442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3453 } | 3453 } |
3454 | 3454 |
3455 void test_nonIdentifierLibraryName_library() { | 3455 void test_nonIdentifierLibraryName_library() { |
3456 CompilationUnit unit = parseCompilationUnit( | 3456 CompilationUnit unit = parseCompilationUnit( |
3457 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 3457 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
3458 expect(unit, isNotNull); | 3458 expect(unit, isNotNull); |
3459 } | 3459 } |
3460 | 3460 |
3461 void test_nonIdentifierLibraryName_partOf() { | 3461 void test_nonIdentifierLibraryName_partOf() { |
3462 CompilationUnit unit = parseCompilationUnit( | 3462 CompilationUnit unit = parseCompilationUnit( |
3463 "part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 3463 "part of 3;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, |
| 3464 ParserErrorCode.UNEXPECTED_TOKEN]); |
3464 expect(unit, isNotNull); | 3465 expect(unit, isNotNull); |
3465 } | 3466 } |
3466 | 3467 |
3467 void test_nonPartOfDirectiveInPart_after() { | 3468 void test_nonPartOfDirectiveInPart_after() { |
3468 parseCompilationUnit("part of l; part 'f.dart';", | 3469 parseCompilationUnit("part of l; part 'f.dart';", |
3469 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 3470 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
3470 } | 3471 } |
3471 | 3472 |
3472 void test_nonPartOfDirectiveInPart_before() { | 3473 void test_nonPartOfDirectiveInPart_before() { |
3473 parseCompilationUnit("part 'f.dart'; part of m;", | 3474 parseCompilationUnit("part 'f.dart'; part of m;", |
(...skipping 11282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14756 expect(functionType.returnType, isNotNull); | 14757 expect(functionType.returnType, isNotNull); |
14757 expect(functionType.typeParameters, isNull); | 14758 expect(functionType.typeParameters, isNull); |
14758 } | 14759 } |
14759 | 14760 |
14760 void test_parseTypeAlias_genericFunction_withDocComment() { | 14761 void test_parseTypeAlias_genericFunction_withDocComment() { |
14761 createParser('/// Doc\ntypedef F = bool Function();'); | 14762 createParser('/// Doc\ntypedef F = bool Function();'); |
14762 var typeAlias = parseFullCompilationUnitMember() as GenericTypeAlias; | 14763 var typeAlias = parseFullCompilationUnitMember() as GenericTypeAlias; |
14763 expectCommentText(typeAlias.documentationComment, '/// Doc'); | 14764 expectCommentText(typeAlias.documentationComment, '/// Doc'); |
14764 } | 14765 } |
14765 } | 14766 } |
OLD | NEW |