| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 Expression parseBitwiseOrExpression(String code); | 93 Expression parseBitwiseOrExpression(String code); |
| 94 | 94 |
| 95 Expression parseBitwiseXorExpression(String code); | 95 Expression parseBitwiseXorExpression(String code); |
| 96 | 96 |
| 97 Expression parseCascadeSection(String code); | 97 Expression parseCascadeSection(String code); |
| 98 | 98 |
| 99 CompilationUnit parseCompilationUnit(String source, | 99 CompilationUnit parseCompilationUnit(String source, |
| 100 [List<ErrorCode> errorCodes = const <ErrorCode>[]]); | 100 [List<ErrorCode> errorCodes = const <ErrorCode>[]]); |
| 101 | 101 |
| 102 /// TODO(paulberry): merge with [parseCompilationUnit] | |
| 103 CompilationUnit parseCompilationUnitWithOptions(String source, | |
| 104 [List<ErrorCode> errorCodes = const <ErrorCode>[]]); | |
| 105 | |
| 106 ConditionalExpression parseConditionalExpression(String code); | 102 ConditionalExpression parseConditionalExpression(String code); |
| 107 | 103 |
| 108 Expression parseConstExpression(String code); | 104 Expression parseConstExpression(String code); |
| 109 | 105 |
| 110 ConstructorInitializer parseConstructorInitializer(String code); | 106 ConstructorInitializer parseConstructorInitializer(String code); |
| 111 | 107 |
| 112 /** | 108 /** |
| 113 * Parse the given source as a compilation unit. | 109 * Parse the given source as a compilation unit. |
| 114 * | 110 * |
| 115 * @param source the source to be parsed | 111 * @param source the source to be parsed |
| (...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 BinaryExpression, expression.rightOperand); | 1776 BinaryExpression, expression.rightOperand); |
| 1781 } | 1777 } |
| 1782 | 1778 |
| 1783 void test_shiftExpression_super() { | 1779 void test_shiftExpression_super() { |
| 1784 BinaryExpression expression = parseExpression("super >> 4 << 3"); | 1780 BinaryExpression expression = parseExpression("super >> 4 << 3"); |
| 1785 EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, | 1781 EngineTestCase.assertInstanceOf((obj) => obj is BinaryExpression, |
| 1786 BinaryExpression, expression.leftOperand); | 1782 BinaryExpression, expression.leftOperand); |
| 1787 } | 1783 } |
| 1788 | 1784 |
| 1789 void test_topLevelFunction_nestedGenericFunction() { | 1785 void test_topLevelFunction_nestedGenericFunction() { |
| 1790 parseCompilationUnitWithOptions(''' | 1786 parseCompilationUnit(''' |
| 1791 void f() { | 1787 void f() { |
| 1792 void g<T>() { | 1788 void g<T>() { |
| 1793 } | 1789 } |
| 1794 } | 1790 } |
| 1795 '''); | 1791 '''); |
| 1796 } | 1792 } |
| 1797 | 1793 |
| 1798 void _validate_assignableExpression_arguments_normal_chain_typeArguments( | 1794 void _validate_assignableExpression_arguments_normal_chain_typeArguments( |
| 1799 String code) { | 1795 String code) { |
| 1800 PropertyAccess propertyAccess1 = parseExpression(code); | 1796 PropertyAccess propertyAccess1 = parseExpression(code); |
| (...skipping 12976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14777 expectCommentText(typeVariable.documentationComment, '/// Doc'); | 14773 expectCommentText(typeVariable.documentationComment, '/// Doc'); |
| 14778 } | 14774 } |
| 14779 | 14775 |
| 14780 /** | 14776 /** |
| 14781 * Assert that the given [name] is in declaration context. | 14777 * Assert that the given [name] is in declaration context. |
| 14782 */ | 14778 */ |
| 14783 void _assertIsDeclarationName(SimpleIdentifier name) { | 14779 void _assertIsDeclarationName(SimpleIdentifier name) { |
| 14784 expect(name.inDeclarationContext(), isTrue); | 14780 expect(name.inDeclarationContext(), isTrue); |
| 14785 } | 14781 } |
| 14786 } | 14782 } |
| OLD | NEW |