Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Side by Side Diff: pkg/analyzer/test/generated/parser_fasta_test.dart

Issue 2740573002: Fix for parsing default parameters. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/generated/parser.dart' as analyzer; 9 import 'package:analyzer/src/generated/parser.dart' as analyzer;
10 import 'package:analyzer/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 FormalParameterList list = parseFormalParameterList(parametersCode, 768 FormalParameterList list = parseFormalParameterList(parametersCode,
769 inFunctionType: false, errorCodes: errorCodes); 769 inFunctionType: false, errorCodes: errorCodes);
770 return list.parameters.single; 770 return list.parameters.single;
771 } 771 }
772 772
773 @override 773 @override
774 FormalParameterList parseFormalParameterList(String code, 774 FormalParameterList parseFormalParameterList(String code,
775 {bool inFunctionType: false, 775 {bool inFunctionType: false,
776 List<ErrorCode> errorCodes: const <ErrorCode>[]}) { 776 List<ErrorCode> errorCodes: const <ErrorCode>[]}) {
777 return _runParser( 777 return _runParser(
778 code, (parser) => parser.parseFormalParameters, errorCodes) 778 code,
779 as FormalParameterList; 779 (parser) => (fasta.Token token) {
780 return parser.parseFormalParameters(token,
781 inFunctionType: inFunctionType);
782 },
783 errorCodes) as FormalParameterList;
780 } 784 }
781 785
782 @override 786 @override
783 CompilationUnitMember parseFullCompilationUnitMember() { 787 CompilationUnitMember parseFullCompilationUnitMember() {
784 return _parserProxy._run((parser) => parser.parseTopLevelDeclaration) 788 return _parserProxy._run((parser) => parser.parseTopLevelDeclaration)
785 as CompilationUnitMember; 789 as CompilationUnitMember;
786 } 790 }
787 791
788 @override 792 @override
789 Directive parseFullDirective() { 793 Directive parseFullDirective() {
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 986
983 @override 987 @override
984 @failingTest 988 @failingTest
985 void test_parseFormalParameter_type_function() { 989 void test_parseFormalParameter_type_function() {
986 // TODO(scheglov): Unhandled event: FunctionTypedFormalParameter 990 // TODO(scheglov): Unhandled event: FunctionTypedFormalParameter
987 super.test_parseFormalParameter_type_function(); 991 super.test_parseFormalParameter_type_function();
988 } 992 }
989 993
990 @override 994 @override
991 @failingTest 995 @failingTest
992 void test_parseFormalParameterList_normal_named_inFunctionType() {
993 // TODO(scheglov): Unhandled event: OptionalFormalParameters
994 super.test_parseFormalParameterList_normal_named_inFunctionType();
995 }
996
997 @override
998 @failingTest
999 void test_parseFormalParameterList_prefixedType_partial() { 996 void test_parseFormalParameterList_prefixedType_partial() {
1000 // TODO(scheglov): Unimplemented: errors 997 // TODO(scheglov): Unimplemented: errors
1001 super.test_parseFormalParameterList_prefixedType_partial(); 998 super.test_parseFormalParameterList_prefixedType_partial();
1002 } 999 }
1003 1000
1004 @override 1001 @override
1005 @failingTest 1002 @failingTest
1006 void test_parseFormalParameterList_prefixedType_partial2() { 1003 void test_parseFormalParameterList_prefixedType_partial2() {
1007 // TODO(scheglov): Unimplemented: errors 1004 // TODO(scheglov): Unimplemented: errors
1008 super.test_parseFormalParameterList_prefixedType_partial2(); 1005 super.test_parseFormalParameterList_prefixedType_partial2();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 super.test_parseNormalFormalParameter_function_void_typeParameterComments(); 1065 super.test_parseNormalFormalParameter_function_void_typeParameterComments();
1069 } 1066 }
1070 1067
1071 @override 1068 @override
1072 @failingTest 1069 @failingTest
1073 void test_parseNormalFormalParameter_function_void_typeParameters_nullable() { 1070 void test_parseNormalFormalParameter_function_void_typeParameters_nullable() {
1074 // TODO(scheglov): Not implemented: Nnbd 1071 // TODO(scheglov): Not implemented: Nnbd
1075 super 1072 super
1076 .test_parseNormalFormalParameter_function_void_typeParameters_nullable() ; 1073 .test_parseNormalFormalParameter_function_void_typeParameters_nullable() ;
1077 } 1074 }
1078
1079 @override
1080 @failingTest
1081 void test_parseNormalFormalParameter_simple_noName() {
1082 // TODO(scheglov): in function type, type instead of parameter name
1083 super.test_parseNormalFormalParameter_simple_noName();
1084 }
1085 } 1075 }
1086 1076
1087 /** 1077 /**
1088 * Proxy implementation of [KernelClassElement] used by Fasta parser tests. 1078 * Proxy implementation of [KernelClassElement] used by Fasta parser tests.
1089 * 1079 *
1090 * Any element used as a type name is presumed to refer to an instance of this 1080 * Any element used as a type name is presumed to refer to an instance of this
1091 * class. 1081 * class.
1092 */ 1082 */
1093 class InterfaceTypeProxy implements KernelInterfaceType { 1083 class InterfaceTypeProxy implements KernelInterfaceType {
1094 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 1084 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 void test_parseTypeAlias_genericFunction_typeParameters_voidReturnType() { 1418 void test_parseTypeAlias_genericFunction_typeParameters_voidReturnType() {
1429 super.test_parseTypeAlias_genericFunction_typeParameters_voidReturnType(); 1419 super.test_parseTypeAlias_genericFunction_typeParameters_voidReturnType();
1430 } 1420 }
1431 1421
1432 @override 1422 @override
1433 @failingTest 1423 @failingTest
1434 void test_parseTypeAlias_genericFunction_voidReturnType() { 1424 void test_parseTypeAlias_genericFunction_voidReturnType() {
1435 super.test_parseTypeAlias_genericFunction_voidReturnType(); 1425 super.test_parseTypeAlias_genericFunction_voidReturnType();
1436 } 1426 }
1437 } 1427 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698