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

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

Issue 2876813002: Implement generalized function types. (Closed)
Patch Set: Address comments. Created 3 years, 7 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
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/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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return list.parameters.single; 458 return list.parameters.single;
459 } 459 }
460 460
461 @override 461 @override
462 FormalParameterList parseFormalParameterList(String code, 462 FormalParameterList parseFormalParameterList(String code,
463 {bool inFunctionType: false, 463 {bool inFunctionType: false,
464 List<ErrorCode> errorCodes: const <ErrorCode>[]}) { 464 List<ErrorCode> errorCodes: const <ErrorCode>[]}) {
465 return _runParser( 465 return _runParser(
466 code, 466 code,
467 (parser) => (analyzer.Token token) { 467 (parser) => (analyzer.Token token) {
468 return parser.parseFormalParameters(token, 468 return parser.parseFormalParameters(
469 inFunctionType: inFunctionType); 469 token,
470 inFunctionType
471 ? fasta.MemberKind.GeneralizedFunctionType
472 : fasta.MemberKind.NonStaticMethod);
470 }, 473 },
471 errorCodes) as FormalParameterList; 474 errorCodes) as FormalParameterList;
472 } 475 }
473 476
474 @override 477 @override
475 CompilationUnitMember parseFullCompilationUnitMember() { 478 CompilationUnitMember parseFullCompilationUnitMember() {
476 return _parserProxy._run((parser) => parser.parseTopLevelDeclaration) 479 return _parserProxy._run((parser) => parser.parseTopLevelDeclaration)
477 as CompilationUnitMember; 480 as CompilationUnitMember;
478 } 481 }
479 482
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 927
925 @override 928 @override
926 @failingTest 929 @failingTest
927 void test_parseCompilationUnit_exportAsPrefix_parameterized() { 930 void test_parseCompilationUnit_exportAsPrefix_parameterized() {
928 // TODO(paulberry): As of commit 5de9108 this syntax is invalid. 931 // TODO(paulberry): As of commit 5de9108 this syntax is invalid.
929 super.test_parseCompilationUnit_exportAsPrefix_parameterized(); 932 super.test_parseCompilationUnit_exportAsPrefix_parameterized();
930 } 933 }
931 934
932 @override 935 @override
933 @failingTest 936 @failingTest
934 void test_parseCompilationUnit_typedefAsPrefix() {
935 // TODO(paulberry): As of commit 5de9108 this syntax is invalid.
936 super.test_parseCompilationUnit_typedefAsPrefix();
937 }
938
939 @override
940 @failingTest
941 void test_parseDirectives_mixed() { 937 void test_parseDirectives_mixed() {
942 // TODO(paulberry,ahe): This test verifies the analyzer parser's ability to 938 // TODO(paulberry,ahe): This test verifies the analyzer parser's ability to
943 // stop parsing as soon as the first non-directive is encountered; this is 939 // stop parsing as soon as the first non-directive is encountered; this is
944 // useful for quickly traversing an import graph. Consider adding a similar 940 // useful for quickly traversing an import graph. Consider adding a similar
945 // ability to Fasta's parser. 941 // ability to Fasta's parser.
946 super.test_parseDirectives_mixed(); 942 super.test_parseDirectives_mixed();
947 } 943 }
948 944
949 @override 945 @override
950 @failingTest 946 @failingTest
951 void test_parsePartOfDirective_name() { 947 void test_parsePartOfDirective_name() {
952 // TODO(paulberry,ahe): Thes test verifies that even if URIs in "part of" 948 // TODO(paulberry,ahe): Thes test verifies that even if URIs in "part of"
953 // declarations are enabled, a construct of the form "part of identifier;" 949 // declarations are enabled, a construct of the form "part of identifier;"
954 // is still properly handled. URIs in "part of" declarations are not 950 // is still properly handled. URIs in "part of" declarations are not
955 // supported by Fasta yet. 951 // supported by Fasta yet.
956 super.test_parsePartOfDirective_name(); 952 super.test_parsePartOfDirective_name();
957 } 953 }
958 954
959 @override 955 @override
960 @failingTest 956 @failingTest
961 void test_parsePartOfDirective_uri() { 957 void test_parsePartOfDirective_uri() {
962 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by 958 // TODO(paulberry,ahe): URIs in "part of" declarations are not supported by
963 // Fasta. 959 // Fasta.
964 super.test_parsePartOfDirective_uri(); 960 super.test_parsePartOfDirective_uri();
965 } 961 }
966 } 962 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/fasta/ast_builder.dart ('k') | pkg/compiler/lib/src/parser/diet_parser_task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698