| 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 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3939 } | 3939 } |
| 3940 | 3940 |
| 3941 void test_topLevelVariable_withMetadata() { | 3941 void test_topLevelVariable_withMetadata() { |
| 3942 parseCompilationUnit("String @A string;", [ | 3942 parseCompilationUnit("String @A string;", [ |
| 3943 ParserErrorCode.MISSING_IDENTIFIER, | 3943 ParserErrorCode.MISSING_IDENTIFIER, |
| 3944 ParserErrorCode.EXPECTED_TOKEN, | 3944 ParserErrorCode.EXPECTED_TOKEN, |
| 3945 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE | 3945 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE |
| 3946 ]); | 3946 ]); |
| 3947 } | 3947 } |
| 3948 | 3948 |
| 3949 void test_typedef_incomplete() { |
| 3950 // TODO(brianwilkerson) Improve recovery for this case. |
| 3951 parseCompilationUnit( |
| 3952 ''' |
| 3953 class A {} |
| 3954 class B extends A {} |
| 3955 |
| 3956 typedef T |
| 3957 |
| 3958 main() { |
| 3959 Function< |
| 3960 } |
| 3961 ''', |
| 3962 [ |
| 3963 ParserErrorCode.EXPECTED_TOKEN, |
| 3964 ParserErrorCode.UNEXPECTED_TOKEN, |
| 3965 ParserErrorCode.EXPECTED_EXECUTABLE |
| 3966 ]); |
| 3967 } |
| 3968 |
| 3949 void test_typedef_namedFunction() { | 3969 void test_typedef_namedFunction() { |
| 3950 // TODO(brianwilkerson) Improve recovery for this case. | 3970 // TODO(brianwilkerson) Improve recovery for this case. |
| 3951 parseCompilationUnit('typedef void Function();', [ | 3971 parseCompilationUnit('typedef void Function();', [ |
| 3952 ParserErrorCode.UNEXPECTED_TOKEN, | 3972 ParserErrorCode.UNEXPECTED_TOKEN, |
| 3953 ParserErrorCode.MISSING_IDENTIFIER, | 3973 ParserErrorCode.MISSING_IDENTIFIER, |
| 3954 ParserErrorCode.EXPECTED_EXECUTABLE, | 3974 ParserErrorCode.EXPECTED_EXECUTABLE, |
| 3955 ParserErrorCode.MISSING_TYPEDEF_PARAMETERS | 3975 ParserErrorCode.MISSING_TYPEDEF_PARAMETERS |
| 3956 ]); | 3976 ]); |
| 3957 } | 3977 } |
| 3958 | 3978 |
| (...skipping 10997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14956 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 14976 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
| 14957 } | 14977 } |
| 14958 | 14978 |
| 14959 /** | 14979 /** |
| 14960 * Assert that the given [name] is in declaration context. | 14980 * Assert that the given [name] is in declaration context. |
| 14961 */ | 14981 */ |
| 14962 void _assertIsDeclarationName(SimpleIdentifier name) { | 14982 void _assertIsDeclarationName(SimpleIdentifier name) { |
| 14963 expect(name.inDeclarationContext(), isTrue); | 14983 expect(name.inDeclarationContext(), isTrue); |
| 14964 } | 14984 } |
| 14965 } | 14985 } |
| OLD | NEW |