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

Unified Diff: pkg/analyzer/lib/src/dart/ast/ast_factory.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/lib/src/dart/ast/ast_factory.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
index 482ae0161c3fd87e9797c5a9f3904c25ff169027..f7e92be807ebd241ee06786c8f05312099177bde 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
@@ -7,6 +7,7 @@ import 'package:analyzer/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:front_end/src/scanner/token.dart';
+import 'package:meta/meta.dart';
/**
* Concrete implementation of [AstFactory] based on the standard AST
@@ -373,10 +374,25 @@ class AstFactoryImpl extends AstFactory {
SimpleIdentifier identifier,
TypeParameterList typeParameters,
FormalParameterList parameters) =>
- new FieldFormalParameterImpl(comment, metadata, keyword, type,
+ new FieldFormalParameterImpl(comment, metadata, null, keyword, type,
thisKeyword, period, identifier, typeParameters, parameters);
@override
+ FieldFormalParameter fieldFormalParameter2(
+ {Comment comment,
+ List<Annotation> metadata,
+ Token covariantKeyword,
+ Token keyword,
+ TypeAnnotation type,
+ @required Token thisKeyword,
+ @required Token period,
+ @required SimpleIdentifier identifier,
+ TypeParameterList typeParameters,
+ FormalParameterList parameters}) =>
+ new FieldFormalParameterImpl(comment, metadata, covariantKeyword, keyword,
+ type, thisKeyword, period, identifier, typeParameters, parameters);
+
+ @override
ForEachStatement forEachStatementWithDeclaration(
Token awaitKeyword,
Token forKeyword,
@@ -500,10 +516,23 @@ class AstFactoryImpl extends AstFactory {
TypeParameterList typeParameters,
FormalParameterList parameters,
{Token question: null}) =>
- new FunctionTypedFormalParameterImpl(comment, metadata, returnType,
+ new FunctionTypedFormalParameterImpl(comment, metadata, null, returnType,
identifier, typeParameters, parameters, question);
@override
+ FunctionTypedFormalParameter functionTypedFormalParameter2(
+ {Comment comment,
+ List<Annotation> metadata,
+ Token covariantKeyword,
+ TypeAnnotation returnType,
+ @required SimpleIdentifier identifier,
+ TypeParameterList typeParameters,
+ @required FormalParameterList parameters,
+ Token question}) =>
+ new FunctionTypedFormalParameterImpl(comment, metadata, covariantKeyword,
+ returnType, identifier, typeParameters, parameters, question);
+
+ @override
GenericFunctionType genericFunctionType(
TypeAnnotation returnType,
Token functionKeyword,
@@ -778,7 +807,18 @@ class AstFactoryImpl extends AstFactory {
TypeAnnotation type,
SimpleIdentifier identifier) =>
new SimpleFormalParameterImpl(
- comment, metadata, keyword, type, identifier);
+ comment, metadata, null, keyword, type, identifier);
+
+ @override
+ SimpleFormalParameter simpleFormalParameter2(
+ {Comment comment,
+ List<Annotation> metadata,
+ Token covariantKeyword,
+ Token keyword,
+ TypeAnnotation type,
+ @required SimpleIdentifier identifier}) =>
+ new SimpleFormalParameterImpl(
+ comment, metadata, covariantKeyword, keyword, type, identifier);
@override
SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration: false}) {

Powered by Google App Engine
This is Rietveld 408576698