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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2710393002: Revert "Add NormalFormalParameter.covariantKeyword setter and factory parameter." (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/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 0170d362cebbb3b049ae8d13d2998e1f75c9bfe8..045a8c459e9414b1e3e4c2fbe478a522c485e653 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -4163,13 +4163,14 @@ class Parser {
period = _expect(TokenType.PERIOD);
}
if (!_matchesIdentifier() && inFunctionType) {
- return astFactory.simpleFormalParameter(
+ SimpleFormalParameterImpl parameter = astFactory.simpleFormalParameter(
commentAndMetadata.comment,
commentAndMetadata.metadata,
- covariantKeyword,
holder.keyword,
holder.type,
null);
+ parameter.covariantKeyword = covariantKeyword;
+ return parameter;
}
SimpleIdentifier identifier = parseSimpleIdentifier();
TypeParameterList typeParameters = _parseGenericMethodTypeParameters();
@@ -4184,20 +4185,22 @@ class Parser {
if (enableNnbd && _matches(TokenType.QUESTION)) {
question = getAndAdvance();
}
- return astFactory.functionTypedFormalParameter(
- commentAndMetadata.comment,
- commentAndMetadata.metadata,
- covariantKeyword,
- holder.type,
- astFactory.simpleIdentifier(identifier.token, isDeclaration: true),
- typeParameters,
- parameters,
- question: question);
+ FunctionTypedFormalParameterImpl parameter =
+ astFactory.functionTypedFormalParameter(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ holder.type,
+ astFactory.simpleIdentifier(identifier.token,
+ isDeclaration: true),
+ typeParameters,
+ parameters,
+ question: question);
+ parameter.covariantKeyword = covariantKeyword;
+ return parameter;
} else {
- return astFactory.fieldFormalParameter(
+ FieldFormalParameterImpl parameter = astFactory.fieldFormalParameter(
commentAndMetadata.comment,
commentAndMetadata.metadata,
- covariantKeyword,
holder.keyword,
holder.type,
thisKeyword,
@@ -4205,6 +4208,8 @@ class Parser {
identifier,
typeParameters,
parameters);
+ parameter.covariantKeyword = covariantKeyword;
+ return parameter;
}
} else if (typeParameters != null) {
// TODO(brianwilkerson) Report an error. It looks like a function-typed
@@ -4226,10 +4231,9 @@ class Parser {
// TODO(brianwilkerson) If there are type parameters but no parameters,
// should we create a synthetic empty parameter list here so we can
// capture the type parameters?
- return astFactory.fieldFormalParameter(
+ FieldFormalParameterImpl parameter = astFactory.fieldFormalParameter(
commentAndMetadata.comment,
commentAndMetadata.metadata,
- covariantKeyword,
holder.keyword,
type,
thisKeyword,
@@ -4237,14 +4241,17 @@ class Parser {
identifier,
null,
null);
+ parameter.covariantKeyword = covariantKeyword;
+ return parameter;
}
- return astFactory.simpleFormalParameter(
+ SimpleFormalParameterImpl parameter = astFactory.simpleFormalParameter(
commentAndMetadata.comment,
commentAndMetadata.metadata,
- covariantKeyword,
holder.keyword,
type,
astFactory.simpleIdentifier(identifier.token, isDeclaration: true));
+ parameter.covariantKeyword = covariantKeyword;
+ return parameter;
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/dart/ast/utilities.dart ('k') | pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698