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

Unified Diff: pkg/analyzer/test/src/dart/ast/utilities_test.dart

Issue 2713173003: Add AST factories for formal parameters with all optional named parameters. (Closed)
Patch Set: Created 3 years, 10 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
Index: pkg/analyzer/test/src/dart/ast/utilities_test.dart
diff --git a/pkg/analyzer/test/src/dart/ast/utilities_test.dart b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
index b818e5d2a44e1fe63c15274bac8e4b52effdde4d..2f077750c10d63f4c097ca6c25376b38278579fb 100644
--- a/pkg/analyzer/test/src/dart/ast/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
@@ -1972,16 +1972,13 @@ class ToSourceVisitor2Test extends EngineTestCase {
void test_visitFieldFormalParameter_functionTyped_typeParameters() {
_assertSource(
"A this.a<E, F>(b)",
- astFactory.fieldFormalParameter(
- null,
- null,
- null,
- AstTestFactory.typeName4('A'),
- TokenFactory.tokenFromKeyword(Keyword.THIS),
- TokenFactory.tokenFromType(TokenType.PERIOD),
- AstTestFactory.identifier3('a'),
- AstTestFactory.typeParameterList(['E', 'F']),
- AstTestFactory.formalParameterList(
+ astFactory.fieldFormalParameter2(
+ type: AstTestFactory.typeName4('A'),
+ thisKeyword: TokenFactory.tokenFromKeyword(Keyword.THIS),
+ period: TokenFactory.tokenFromType(TokenType.PERIOD),
+ identifier: AstTestFactory.identifier3('a'),
+ typeParameters: AstTestFactory.typeParameterList(['E', 'F']),
+ parameters: AstTestFactory.formalParameterList(
[AstTestFactory.simpleFormalParameter3("b")])));
}
@@ -2505,13 +2502,11 @@ class ToSourceVisitor2Test extends EngineTestCase {
void test_visitFunctionTypedFormalParameter_typeParameters() {
_assertSource(
"T f<E>()",
- astFactory.functionTypedFormalParameter(
- null,
- null,
- AstTestFactory.typeName4("T"),
- AstTestFactory.identifier3('f'),
- AstTestFactory.typeParameterList(['E']),
- AstTestFactory.formalParameterList([])));
+ astFactory.functionTypedFormalParameter2(
+ returnType: AstTestFactory.typeName4("T"),
+ identifier: AstTestFactory.identifier3('f'),
+ typeParameters: AstTestFactory.typeParameterList(['E']),
+ parameters: AstTestFactory.formalParameterList([])));
}
void test_visitIfStatement_withElse() {
@@ -4326,16 +4321,13 @@ class ToSourceVisitorTest extends EngineTestCase {
void test_visitFieldFormalParameter_functionTyped_typeParameters() {
_assertSource(
"A this.a<E, F>(b)",
- astFactory.fieldFormalParameter(
- null,
- null,
- null,
- AstTestFactory.typeName4('A'),
- TokenFactory.tokenFromKeyword(Keyword.THIS),
- TokenFactory.tokenFromType(TokenType.PERIOD),
- AstTestFactory.identifier3('a'),
- AstTestFactory.typeParameterList(['E', 'F']),
- AstTestFactory.formalParameterList(
+ astFactory.fieldFormalParameter2(
+ type: AstTestFactory.typeName4('A'),
+ thisKeyword: TokenFactory.tokenFromKeyword(Keyword.THIS),
+ period: TokenFactory.tokenFromType(TokenType.PERIOD),
+ identifier: AstTestFactory.identifier3('a'),
+ typeParameters: AstTestFactory.typeParameterList(['E', 'F']),
+ parameters: AstTestFactory.formalParameterList(
[AstTestFactory.simpleFormalParameter3("b")])));
}
@@ -4859,13 +4851,11 @@ class ToSourceVisitorTest extends EngineTestCase {
void test_visitFunctionTypedFormalParameter_typeParameters() {
_assertSource(
"T f<E>()",
- astFactory.functionTypedFormalParameter(
- null,
- null,
- AstTestFactory.typeName4("T"),
- AstTestFactory.identifier3('f'),
- AstTestFactory.typeParameterList(['E']),
- AstTestFactory.formalParameterList([])));
+ astFactory.functionTypedFormalParameter2(
+ returnType: AstTestFactory.typeName4("T"),
+ identifier: AstTestFactory.identifier3('f'),
+ typeParameters: AstTestFactory.typeParameterList(['E']),
+ parameters: AstTestFactory.formalParameterList([])));
}
void test_visitIfStatement_withElse() {
« pkg/analyzer/lib/dart/ast/ast_factory.dart ('K') | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698