| 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 import 'package:analyzer/dart/ast/ast.dart'; | 5 import 'package:analyzer/dart/ast/ast.dart'; |
| 6 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 6 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 7 import 'package:analyzer/dart/ast/token.dart'; | 7 import 'package:analyzer/dart/ast/token.dart'; |
| 8 import 'package:analyzer/dart/ast/visitor.dart'; | 8 import 'package:analyzer/dart/ast/visitor.dart'; |
| 9 import 'package:analyzer/error/error.dart'; | 9 import 'package:analyzer/error/error.dart'; |
| 10 import 'package:analyzer/error/listener.dart'; | 10 import 'package:analyzer/error/listener.dart'; |
| (...skipping 4137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4148 assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]); | 4148 assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]); |
| 4149 } | 4149 } |
| 4150 | 4150 |
| 4151 @failingTest | 4151 @failingTest |
| 4152 void test_unexpectedToken_invalidPostfixExpression() { | 4152 void test_unexpectedToken_invalidPostfixExpression() { |
| 4153 // Note: this might not be the right error to produce, but some error should | 4153 // Note: this might not be the right error to produce, but some error should |
| 4154 // be produced | 4154 // be produced |
| 4155 parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]); | 4155 parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 4156 } | 4156 } |
| 4157 | 4157 |
| 4158 void test_unexpectedToken_returnInExpressionFuntionBody() { | 4158 void test_unexpectedToken_returnInExpressionFunctionBody() { |
| 4159 parseCompilationUnit( | 4159 parseCompilationUnit( |
| 4160 "f() => return null;", [ParserErrorCode.UNEXPECTED_TOKEN]); | 4160 "f() => return null;", [ParserErrorCode.UNEXPECTED_TOKEN]); |
| 4161 } | 4161 } |
| 4162 | 4162 |
| 4163 void test_unexpectedToken_semicolonBetweenClassMembers() { | 4163 void test_unexpectedToken_semicolonBetweenClassMembers() { |
| 4164 createParser('class C { int x; ; int y;}'); | 4164 createParser('class C { int x; ; int y;}'); |
| 4165 ClassDeclaration declaration = parseFullCompilationUnitMember(); | 4165 ClassDeclaration declaration = parseFullCompilationUnitMember(); |
| 4166 expectNotNullIfNoErrors(declaration); | 4166 expectNotNullIfNoErrors(declaration); |
| 4167 listener.assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]); | 4167 listener.assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]); |
| 4168 } | 4168 } |
| (...skipping 10986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15155 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 15155 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
| 15156 } | 15156 } |
| 15157 | 15157 |
| 15158 /** | 15158 /** |
| 15159 * Assert that the given [name] is in declaration context. | 15159 * Assert that the given [name] is in declaration context. |
| 15160 */ | 15160 */ |
| 15161 void _assertIsDeclarationName(SimpleIdentifier name) { | 15161 void _assertIsDeclarationName(SimpleIdentifier name) { |
| 15162 expect(name.inDeclarationContext(), isTrue); | 15162 expect(name.inDeclarationContext(), isTrue); |
| 15163 } | 15163 } |
| 15164 } | 15164 } |
| OLD | NEW |