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

Unified Diff: pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart

Issue 2752853002: Improve printing of generic function types and add tests (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | pkg/analyzer/test/src/dart/ast/utilities_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
index 115bad594a6184c8575fa5e50ea4b4c26ab43428..b0c28c63999e4595820418033c9efe677641370f 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
@@ -612,6 +612,23 @@ class AstTestFactory {
identifier: identifier3(identifier),
parameters: formalParameterList(parameters));
+ static GenericFunctionType genericFunctionType(TypeAnnotation returnType,
+ TypeParameterList typeParameters, FormalParameterList parameters) =>
+ astFactory.genericFunctionType(returnType,
+ TokenFactory.tokenFromString("Function"), typeParameters, parameters);
+
+ static GenericTypeAlias genericTypeAlias(String name,
+ TypeParameterList typeParameters, GenericFunctionType functionType) =>
+ astFactory.genericTypeAlias(
+ null,
+ null,
+ TokenFactory.tokenFromKeyword(Keyword.TYPEDEF),
+ identifier3(name),
+ typeParameters,
+ TokenFactory.tokenFromType(TokenType.EQ),
+ functionType,
+ TokenFactory.tokenFromType(TokenType.SEMICOLON));
+
static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) =>
astFactory.hideCombinator(
TokenFactory.tokenFromString("hide"), identifiers);
@@ -1069,7 +1086,8 @@ class AstTestFactory {
keyword:
keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
type: type,
- identifier: identifier3(parameterName));
+ identifier:
+ parameterName == null ? null : identifier3(parameterName));
static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
simpleFormalParameter2(null, null, parameterName);
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | pkg/analyzer/test/src/dart/ast/utilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698