OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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/token.dart' as analyzer; | 6 import 'package:analyzer/dart/ast/token.dart' as analyzer; |
7 import 'package:analyzer/dart/element/element.dart'; | 7 import 'package:analyzer/dart/element/element.dart'; |
8 import 'package:analyzer/error/error.dart'; | 8 import 'package:analyzer/error/error.dart'; |
9 import 'package:analyzer/src/fasta/ast_builder.dart'; | 9 import 'package:analyzer/src/fasta/ast_builder.dart'; |
10 import 'package:analyzer/src/fasta/element_store.dart'; | 10 import 'package:analyzer/src/fasta/element_store.dart'; |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 @override | 654 @override |
655 Expression parseThrowExpressionWithoutCascade(String code) { | 655 Expression parseThrowExpressionWithoutCascade(String code) { |
656 return _parseExpression(code); | 656 return _parseExpression(code); |
657 } | 657 } |
658 | 658 |
659 @override | 659 @override |
660 PrefixExpression parseUnaryExpression(String code) { | 660 PrefixExpression parseUnaryExpression(String code) { |
661 return _parseExpression(code); | 661 return _parseExpression(code); |
662 } | 662 } |
663 | 663 |
| 664 @override |
| 665 VariableDeclarationList parseVariableDeclarationList(String code) { |
| 666 var statement = parseStatement('$code;') as VariableDeclarationStatement; |
| 667 return statement.variables; |
| 668 } |
| 669 |
664 Expression _parseExpression(String code) { | 670 Expression _parseExpression(String code) { |
665 var statement = parseStatement('$code;') as ExpressionStatement; | 671 var statement = parseStatement('$code;') as ExpressionStatement; |
666 return statement.expression; | 672 return statement.expression; |
667 } | 673 } |
668 | 674 |
669 Object _runParser( | 675 Object _runParser( |
670 String source, ParseFunction getParseFunction(fasta.Parser parser), | 676 String source, ParseFunction getParseFunction(fasta.Parser parser), |
671 [List<ErrorCode> errorCodes = const <ErrorCode>[]]) { | 677 [List<ErrorCode> errorCodes = const <ErrorCode>[]]) { |
672 if (errorCodes.isNotEmpty) { | 678 if (errorCodes.isNotEmpty) { |
673 // TODO(paulberry): Check that the parser generates the proper errors. | 679 // TODO(paulberry): Check that the parser generates the proper errors. |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 @failingTest | 940 @failingTest |
935 void test_parseTryStatement_on_catch() { | 941 void test_parseTryStatement_on_catch() { |
936 super.test_parseTryStatement_on_catch(); | 942 super.test_parseTryStatement_on_catch(); |
937 } | 943 } |
938 | 944 |
939 @override | 945 @override |
940 @failingTest | 946 @failingTest |
941 void test_parseTryStatement_on_catch_finally() { | 947 void test_parseTryStatement_on_catch_finally() { |
942 super.test_parseTryStatement_on_catch_finally(); | 948 super.test_parseTryStatement_on_catch_finally(); |
943 } | 949 } |
| 950 |
| 951 @override |
| 952 @failingTest |
| 953 void test_parseVariableDeclarationListAfterMetadata_const_typeComment() { |
| 954 super.test_parseVariableDeclarationListAfterMetadata_const_typeComment(); |
| 955 } |
| 956 |
| 957 @override |
| 958 @failingTest |
| 959 void test_parseVariableDeclarationListAfterMetadata_dynamic_typeComment() { |
| 960 super.test_parseVariableDeclarationListAfterMetadata_dynamic_typeComment(); |
| 961 } |
| 962 |
| 963 @override |
| 964 @failingTest |
| 965 void test_parseVariableDeclarationListAfterMetadata_final_typeComment() { |
| 966 super.test_parseVariableDeclarationListAfterMetadata_final_typeComment(); |
| 967 } |
| 968 |
| 969 @override |
| 970 @failingTest |
| 971 void test_parseVariableDeclarationListAfterMetadata_type_typeComment() { |
| 972 super.test_parseVariableDeclarationListAfterMetadata_type_typeComment(); |
| 973 } |
| 974 |
| 975 @override |
| 976 @failingTest |
| 977 void test_parseVariableDeclarationListAfterMetadata_var_typeComment() { |
| 978 super.test_parseVariableDeclarationListAfterMetadata_var_typeComment(); |
| 979 } |
944 } | 980 } |
945 | 981 |
946 /** | 982 /** |
947 * Tests of the fasta parser based on [TopLevelParserTestMixin]. | 983 * Tests of the fasta parser based on [TopLevelParserTestMixin]. |
948 */ | 984 */ |
949 @reflectiveTest | 985 @reflectiveTest |
950 class TopLevelParserTest_Fasta extends FastaParserTestCase | 986 class TopLevelParserTest_Fasta extends FastaParserTestCase |
951 with TopLevelParserTestMixin { | 987 with TopLevelParserTestMixin { |
952 @override | 988 @override |
953 @failingTest | 989 @failingTest |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 } | 1043 } |
1008 | 1044 |
1009 @override | 1045 @override |
1010 @failingTest | 1046 @failingTest |
1011 void test_parsePartOfDirective_uri() { | 1047 void test_parsePartOfDirective_uri() { |
1012 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by | 1048 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by |
1013 // Fasta. | 1049 // Fasta. |
1014 super.test_parsePartOfDirective_uri(); | 1050 super.test_parsePartOfDirective_uri(); |
1015 } | 1051 } |
1016 } | 1052 } |
OLD | NEW |