Version 2.13.0-116.0.dev
Merge commit '75308fc26b7c08c26029cd143720eb05b5370abc' into 'dev'
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 52181fb..0b7792e 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,3 +1,6 @@
+## 1.2.0
+* Deprecated all setters in API of AST. Use `parseString()` instead.
+
## 1.1.0
* Deprecated `TypeProvider.futureType2()`, `iterableType2()`, etc.
Use corresponding `TypeProvider.futureType()`, `iterableType()`, etc.
diff --git a/pkg/analyzer/lib/dart/ast/ast.dart b/pkg/analyzer/lib/dart/ast/ast.dart
index 8dada5e..64526cc 100644
--- a/pkg/analyzer/lib/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/dart/ast/ast.dart
@@ -69,6 +69,7 @@
/// Set the documentation comment associated with this node to the given
/// [comment].
+ @Deprecated('Clients should not build AST manually')
set documentationComment(Comment? comment);
/// Return the first token following the comment and metadata.
@@ -103,12 +104,14 @@
/// Set the arguments to the constructor being invoked to the given
/// [arguments].
+ @Deprecated('Clients should not build AST manually')
set arguments(ArgumentList? arguments);
/// Return the at sign that introduced the annotation.
Token get atSign;
/// Set the at sign that introduced the annotation to the given [token].
+ @Deprecated('Clients should not build AST manually')
set atSign(Token token);
/// Return the name of the constructor being invoked, or `null` if this
@@ -116,6 +119,7 @@
SimpleIdentifier? get constructorName;
/// Set the name of the constructor being invoked to the given [name].
+ @Deprecated('Clients should not build AST manually')
set constructorName(SimpleIdentifier? name);
/// Return the element associated with this annotation, or `null` if the AST
@@ -124,6 +128,7 @@
Element? get element;
/// Set the element associated with this annotation to the given [element].
+ @Deprecated('Clients should not build AST manually')
set element(Element? element);
/// Return the element annotation representing this annotation in the element
@@ -132,6 +137,7 @@
/// Set the element annotation representing this annotation in the element
/// model to the given [annotation].
+ @Deprecated('Clients should not build AST manually')
set elementAnnotation(ElementAnnotation? annotation);
/// Return the name of the class defining the constructor that is being
@@ -140,6 +146,7 @@
/// Set the name of the class defining the constructor that is being invoked
/// or the name of the field that is being referenced to the given [name].
+ @Deprecated('Clients should not build AST manually')
set name(Identifier name);
@override
@@ -150,6 +157,7 @@
Token? get period;
/// Set the period before the constructor name to the given [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Returns the type arguments to the constructor being invoked, or `null` if
@@ -183,18 +191,21 @@
/// list to the given list of [parameters]. The list of parameters must be the
/// same length as the number of arguments, but can contain `null` entries if
/// a given argument does not correspond to a formal parameter.
+ @Deprecated('Clients should not build AST manually')
set correspondingStaticParameters(List<ParameterElement?> parameters);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
}
@@ -209,6 +220,7 @@
Token get asOperator;
/// Set the 'as' operator to the given [token].
+ @Deprecated('Clients should not build AST manually')
set asOperator(Token token);
/// Return the expression used to compute the value being cast.
@@ -216,12 +228,14 @@
/// Set the expression used to compute the value being cast to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the type being cast to.
TypeAnnotation get type;
/// Set the type being cast to to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation type);
}
@@ -241,6 +255,7 @@
Token get assertKeyword;
/// Set the token representing the 'assert' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set assertKeyword(Token token);
/// Return the comma between the [condition] and the [message], or `null` if
@@ -249,6 +264,7 @@
/// Set the comma between the [condition] and the [message] to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set comma(Token? token);
/// Return the condition that is being asserted to be `true`.
@@ -256,12 +272,14 @@
/// Set the condition that is being asserted to be `true` to the given
/// [condition].
+ @Deprecated('Clients should not build AST manually')
set condition(Expression condition);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the message to report if the assertion fails, or `null` if no
@@ -270,12 +288,14 @@
/// Set the message to report if the assertion fails to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set message(Expression? expression);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
}
@@ -290,6 +310,7 @@
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -308,12 +329,14 @@
Expression get leftHandSide;
/// Return the expression used to compute the left hand side.
+ @Deprecated('Clients should not build AST manually')
set leftHandSide(Expression expression);
/// Return the assignment operator being applied.
Token get operator;
/// Set the assignment operator being applied to the given [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token token);
/// Return the expression used to compute the right hand side.
@@ -321,6 +344,7 @@
/// Set the expression used to compute the left hand side to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set rightHandSide(Expression expression);
}
@@ -689,6 +713,7 @@
Token get awaitKeyword;
/// Set the 'await' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set awaitKeyword(Token token);
/// Return the expression whose value is being waited on.
@@ -696,6 +721,7 @@
/// Set the expression whose value is being waited on to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
}
@@ -712,12 +738,14 @@
/// Set the expression used to compute the left operand to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set leftOperand(Expression expression);
/// Return the binary operator being applied.
Token get operator;
/// Set the binary operator being applied to the given [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token token);
/// Return the expression used to compute the right operand.
@@ -725,6 +753,7 @@
/// Set the expression used to compute the right operand to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set rightOperand(Expression expression);
/// The function type of the invocation, or `null` if the AST structure has
@@ -732,6 +761,7 @@
FunctionType? get staticInvokeType;
/// Sets the function type of the invocation.
+ @Deprecated('Clients should not build AST manually')
set staticInvokeType(FunctionType? value);
}
@@ -746,12 +776,14 @@
Token get leftBracket;
/// Set the left curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the right curly bracket.
Token get rightBracket;
/// Set the right curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
/// Return the statements contained in the block.
@@ -769,12 +801,15 @@
Block get block;
/// Set the block representing the body of the function to the given [block].
+ @Deprecated('Clients should not build AST manually')
set block(Block block);
/// Set token representing the 'async' or 'sync' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Set the star following the 'async' or 'sync' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set star(Token? token);
}
@@ -789,6 +824,7 @@
Token get literal;
/// Set the token representing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set literal(Token token);
/// Return the value of the literal.
@@ -806,6 +842,7 @@
Token get breakKeyword;
/// Set the token representing the 'break' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set breakKeyword(Token token);
/// Return the label associated with the statement, or `null` if there is no
@@ -813,12 +850,14 @@
SimpleIdentifier? get label;
/// Set the label associated with the statement to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set label(SimpleIdentifier? identifier);
/// Return the semicolon terminating the statement.
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the node from which this break statement is breaking.
@@ -833,6 +872,7 @@
/// Set the node from which this break statement is breaking to the given
/// [node].
+ @Deprecated('Clients should not build AST manually')
set target(AstNode? node);
}
@@ -866,6 +906,7 @@
Expression get target;
/// Set the target of the cascade sections to the given [target].
+ @Deprecated('Clients should not build AST manually')
set target(Expression target);
}
@@ -884,6 +925,7 @@
Block get body;
/// Set the body of the catch block to the given [block].
+ @Deprecated('Clients should not build AST manually')
set body(Block block);
/// Return the token representing the 'catch' keyword, or `null` if there is
@@ -891,6 +933,7 @@
Token? get catchKeyword;
/// Set the token representing the 'catch' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set catchKeyword(Token? token);
/// Return the comma separating the exception parameter from the stack trace
@@ -899,6 +942,7 @@
/// Set the comma separating the exception parameter from the stack trace
/// parameter to the given [token].
+ @Deprecated('Clients should not build AST manually')
set comma(Token? token);
/// Return the parameter whose value will be the exception that was thrown, or
@@ -907,6 +951,7 @@
/// Set the parameter whose value will be the exception that was thrown to the
/// given [parameter].
+ @Deprecated('Clients should not build AST manually')
set exceptionParameter(SimpleIdentifier? parameter);
/// Return the type of exceptions caught by this catch clause, or `null` if
@@ -915,12 +960,14 @@
/// Set the type of exceptions caught by this catch clause to the given
/// [exceptionType].
+ @Deprecated('Clients should not build AST manually')
set exceptionType(TypeAnnotation? exceptionType);
/// Return the left parenthesis, or `null` if there is no 'catch' keyword.
Token? get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token? token);
/// Return the token representing the 'on' keyword, or `null` if there is no
@@ -928,12 +975,14 @@
Token? get onKeyword;
/// Set the token representing the 'on' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set onKeyword(Token? token);
/// Return the right parenthesis, or `null` if there is no 'catch' keyword.
Token? get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token? token);
/// Return the parameter whose value will be the stack trace associated with
@@ -942,6 +991,7 @@
/// Set the parameter whose value will be the stack trace associated with the
/// exception to the given [parameter].
+ @Deprecated('Clients should not build AST manually')
set stackTraceParameter(SimpleIdentifier? parameter);
}
@@ -959,12 +1009,14 @@
Token? get abstractKeyword;
/// Set the 'abstract' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set abstractKeyword(Token? token);
/// Return the token representing the 'class' keyword.
Token get classKeyword;
/// Set the token representing the 'class' keyword.
+ @Deprecated('Clients should not build AST manually')
set classKeyword(Token token);
/// Return the extends clause for this class, or `null` if the class does not
@@ -972,15 +1024,18 @@
ExtendsClause? get extendsClause;
/// Set the extends clause for this class to the given [extendsClause].
+ @Deprecated('Clients should not build AST manually')
set extendsClause(ExtendsClause? extendsClause);
/// Set the implements clause for the class to the given [implementsClause].
+ @Deprecated('Clients should not build AST manually')
set implementsClause(ImplementsClause? implementsClause);
/// Return `true` if this class is declared to be an abstract class.
bool get isAbstract;
/// Set the left curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the native clause for this class, or `null` if the class does not
@@ -988,13 +1043,16 @@
NativeClause? get nativeClause;
/// Set the native clause for this class to the given [nativeClause].
+ @Deprecated('Clients should not build AST manually')
set nativeClause(NativeClause? nativeClause);
/// Set the right curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
/// Set the type parameters for the class to the given list of
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
/// Return the with clause for the class, or `null` if the class does not have
@@ -1002,6 +1060,7 @@
WithClause? get withClause;
/// Set the with clause for the class to the given [withClause].
+ @Deprecated('Clients should not build AST manually')
set withClause(WithClause? withClause);
/// Return the constructor declared in the class with the given [name], or
@@ -1071,6 +1130,7 @@
Token? get abstractKeyword;
/// Set the token for the 'abstract' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set abstractKeyword(Token? token);
@override
@@ -1081,6 +1141,7 @@
/// Set the token for the '=' separating the name from the definition to the
/// given [token].
+ @Deprecated('Clients should not build AST manually')
set equals(Token token);
/// Return the implements clause for this class, or `null` if there is no
@@ -1088,6 +1149,7 @@
ImplementsClause? get implementsClause;
/// Set the implements clause for this class to the given [implementsClause].
+ @Deprecated('Clients should not build AST manually')
set implementsClause(ImplementsClause? implementsClause);
/// Return `true` if this class is declared to be an abstract class.
@@ -1101,6 +1163,7 @@
/// Set the name of the superclass of the class being declared to the given
/// [superclass] name.
+ @Deprecated('Clients should not build AST manually')
set superclass(TypeName superclass);
/// Return the type parameters for the class, or `null` if the class does not
@@ -1109,12 +1172,14 @@
/// Set the type parameters for the class to the given list of
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
/// Return the with clause for this class.
WithClause get withClause;
/// Set the with clause for this class to the given with [withClause].
+ @Deprecated('Clients should not build AST manually')
set withClause(WithClause withClause);
}
@@ -1144,6 +1209,7 @@
/// Set the 'hide' or 'show' keyword specifying what kind of processing is
/// to be done on the names to the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token token);
}
@@ -1193,6 +1259,7 @@
Identifier get identifier;
/// Set the identifier being referenced to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set identifier(Identifier identifier);
/// Return the token representing the 'new' keyword, or `null` if there was no
@@ -1200,6 +1267,7 @@
Token? get newKeyword;
/// Set the token representing the 'new' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set newKeyword(Token? token);
}
@@ -1229,6 +1297,7 @@
abstract class CompilationUnit implements AstNode {
/// Set the first token included in this node's source range to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set beginToken(Token token);
/// Return the declarations contained in this compilation unit.
@@ -1243,10 +1312,12 @@
/// Set the element associated with this compilation unit to the given
/// [element].
+ @Deprecated('Clients should not build AST manually')
set element(CompilationUnitElement? element);
/// Set the last token included in this node's source range to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set endToken(Token token);
/// The set of features available to this compilation unit.
@@ -1264,6 +1335,7 @@
LineInfo? get lineInfo;
/// Set the line information for this compilation unit to the given [info].
+ @Deprecated('Clients should not build AST manually')
set lineInfo(LineInfo? info);
/// Return the script tag at the beginning of the compilation unit, or `null`
@@ -1272,6 +1344,7 @@
/// Set the script tag at the beginning of the compilation unit to the given
/// [scriptTag].
+ @Deprecated('Clients should not build AST manually')
set scriptTag(ScriptTag? scriptTag);
/// Return a list containing all of the directives and declarations in this
@@ -1366,6 +1439,7 @@
/// Set the token used to separate the then expression from the else
/// expression to the given [token].
+ @Deprecated('Clients should not build AST manually')
set colon(Token token);
/// Return the condition used to determine which of the expressions is
@@ -1374,6 +1448,7 @@
/// Set the condition used to determine which of the expressions is executed
/// next to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set condition(Expression expression);
/// Return the expression that is executed if the condition evaluates to
@@ -1382,6 +1457,7 @@
/// Set the expression that is executed if the condition evaluates to `false`
/// to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set elseExpression(Expression expression);
/// Return the token used to separate the condition from the then expression.
@@ -1389,6 +1465,7 @@
/// Set the token used to separate the condition from the then expression to
/// the given [token].
+ @Deprecated('Clients should not build AST manually')
set question(Token token);
/// Return the expression that is executed if the condition evaluates to
@@ -1397,6 +1474,7 @@
/// Set the expression that is executed if the condition evaluates to `true`
/// to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set thenExpression(Expression expression);
}
@@ -1418,18 +1496,21 @@
Token? get equalToken;
/// Set the token for the equal operator to the given [token].
+ @Deprecated('Clients should not build AST manually')
set equalToken(Token? token);
/// Return the token for the 'if' keyword.
Token get ifKeyword;
/// Set the token for the 'if' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set ifKeyword(Token token);
/// Return the token for the left parenthesis.
Token get leftParenthesis;
/// Set the token for the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the name of the declared variable whose value is being used in the
@@ -1438,12 +1519,14 @@
/// Set the name of the declared variable whose value is being used in the
/// condition to the given [name].
+ @Deprecated('Clients should not build AST manually')
set name(DottedName name);
/// Return the token for the right parenthesis.
Token get rightParenthesis;
/// Set the token for the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
/// Return the URI of the implementation library to be used if the condition
@@ -1452,12 +1535,14 @@
/// Set the URI of the implementation library to be used if the condition is
/// true to the given [uri].
+ @Deprecated('Clients should not build AST manually')
set uri(StringLiteral uri);
/// Return the source to which the [uri] was resolved.
Source? get uriSource;
/// Set the source to which the [uri] was resolved to the given [source].
+ @Deprecated('Clients should not build AST manually')
set uriSource(Source? source);
/// Return the value to which the value of the declared variable will be
@@ -1466,6 +1551,7 @@
/// Set the value to which the value of the declared variable will be
/// compared to the given [value].
+ @Deprecated('Clients should not build AST manually')
set value(StringLiteral? value);
}
@@ -1495,6 +1581,7 @@
FunctionBody get body;
/// Set the body of the constructor to the given [functionBody].
+ @Deprecated('Clients should not build AST manually')
set body(FunctionBody functionBody);
/// Return the token for the 'const' keyword, or `null` if the constructor is
@@ -1502,6 +1589,7 @@
Token? get constKeyword;
/// Set the token for the 'const' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set constKeyword(Token? token);
@override
@@ -1512,6 +1600,7 @@
/// Set the token for the 'external' keyword, or `null` if the constructor
/// is not external.
+ @Deprecated('Clients should not build AST manually')
set externalKeyword(Token? token);
/// Return the token for the 'factory' keyword, or `null` if the constructor
@@ -1519,6 +1608,7 @@
Token? get factoryKeyword;
/// Set the token for the 'factory' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set factoryKeyword(Token? token);
/// Return the initializers associated with the constructor.
@@ -1529,6 +1619,7 @@
SimpleIdentifier? get name;
/// Set the name of the constructor to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier? identifier);
/// Return the parameters associated with the constructor.
@@ -1536,6 +1627,7 @@
/// Set the parameters associated with the constructor to the given list of
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList parameters);
/// Return the token for the period before the constructor name, or `null` if
@@ -1544,6 +1636,7 @@
/// Set the token for the period before the constructor name to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the name of the constructor to which this constructor will be
@@ -1552,6 +1645,7 @@
/// Set the name of the constructor to which this constructor will be
/// redirected to the given [redirectedConstructor] name.
+ @Deprecated('Clients should not build AST manually')
set redirectedConstructor(ConstructorName? redirectedConstructor);
/// Return the type of object being created.
@@ -1562,6 +1656,7 @@
Identifier get returnType;
/// Set the type of object being created to the given [typeName].
+ @Deprecated('Clients should not build AST manually')
set returnType(Identifier typeName);
/// Return the token for the separator (colon or equals) before the
@@ -1570,6 +1665,7 @@
/// Set the token for the separator (colon or equals) before the initializer
/// list or redirection to the given [token].
+ @Deprecated('Clients should not build AST manually')
set separator(Token? token);
}
@@ -1586,6 +1682,7 @@
/// Set the token for the equal sign between the field name and the
/// expression to the given [token].
+ @Deprecated('Clients should not build AST manually')
set equals(Token token);
/// Return the expression computing the value to which the field will be
@@ -1594,12 +1691,14 @@
/// Set the expression computing the value to which the field will be
/// initialized to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the name of the field being initialized.
SimpleIdentifier get fieldName;
/// Set the name of the field being initialized to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set fieldName(SimpleIdentifier identifier);
/// Return the token for the period after the 'this' keyword, or `null` if
@@ -1608,6 +1707,7 @@
/// Set the token for the period after the 'this' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the token for the 'this' keyword, or `null` if there is no 'this'
@@ -1615,6 +1715,7 @@
Token? get thisKeyword;
/// Set the token for the 'this' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set thisKeyword(Token? token);
}
@@ -1640,6 +1741,7 @@
SimpleIdentifier? get name;
/// Set the name of the constructor to the given [name].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier? name);
/// Return the token for the period before the constructor name, or `null` if
@@ -1648,6 +1750,7 @@
/// Set the token for the period before the constructor name to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the name of the type defining the constructor.
@@ -1655,6 +1758,7 @@
/// Set the name of the type defining the constructor to the given [type]
/// name.
+ @Deprecated('Clients should not build AST manually')
set type(TypeName type);
}
@@ -1669,6 +1773,7 @@
/// Set the element associated with the referenced constructor based on static
/// type information to the given [element].
+ @Deprecated('Clients should not build AST manually')
set staticElement(ConstructorElement? element);
}
@@ -1683,6 +1788,7 @@
Token get continueKeyword;
/// Set the token representing the 'continue' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set continueKeyword(Token token);
/// Return the label associated with the statement, or `null` if there is no
@@ -1690,12 +1796,14 @@
SimpleIdentifier? get label;
/// Set the label associated with the statement to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set label(SimpleIdentifier? identifier);
/// Return the semicolon terminating the statement.
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the node to which this continue statement is continuing.
@@ -1710,6 +1818,7 @@
/// Set the node to which this continue statement is continuing to the given
/// [node].
+ @Deprecated('Clients should not build AST manually')
set target(AstNode? node);
}
@@ -1739,6 +1848,7 @@
SimpleIdentifier get identifier;
/// Set the name of the variable being declared to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set identifier(SimpleIdentifier identifier);
/// Return `true` if this variable was declared with the 'const' modifier.
@@ -1755,6 +1865,7 @@
/// Set the token representing either the 'final', 'const' or 'var' keyword to
/// the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Return the name of the declared type of the parameter, or `null` if the
@@ -1762,6 +1873,7 @@
TypeAnnotation? get type;
/// Set the declared type of the parameter to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation? type);
}
@@ -1784,9 +1896,11 @@
/// Set the expression computing the default value for the parameter to the
/// given [expression].
+ @Deprecated('Clients should not build AST manually')
set defaultValue(Expression? expression);
/// Set the kind of this parameter to the given [kind].
+ @Deprecated('Clients should not build AST manually')
set kind(ParameterKind kind);
/// Return the formal parameter with which the default value is associated.
@@ -1794,6 +1908,7 @@
/// Set the formal parameter with which the default value is associated to the
/// given [formalParameter].
+ @Deprecated('Clients should not build AST manually')
set parameter(NormalFormalParameter formalParameter);
/// Return the token separating the parameter from the default value, or
@@ -1802,6 +1917,7 @@
/// Set the token separating the parameter from the default value to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set separator(Token? token);
}
@@ -1822,6 +1938,7 @@
Element? get element;
/// Set the element associated with this directive to the given [element].
+ @Deprecated('Clients should not build AST manually')
set element(Element? element);
/// Return the token representing the keyword that introduces this directive
@@ -1840,6 +1957,7 @@
Statement get body;
/// Set the body of the loop to the given [statement].
+ @Deprecated('Clients should not build AST manually')
set body(Statement statement);
/// Return the condition that determines when the loop will terminate.
@@ -1847,36 +1965,42 @@
/// Set the condition that determines when the loop will terminate to the
/// given [expression].
+ @Deprecated('Clients should not build AST manually')
set condition(Expression expression);
/// Return the token representing the 'do' keyword.
Token get doKeyword;
/// Set the token representing the 'do' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set doKeyword(Token token);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
/// Return the semicolon terminating the statement.
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the token representing the 'while' keyword.
Token get whileKeyword;
/// Set the token representing the 'while' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set whileKeyword(Token token);
}
@@ -1906,12 +2030,14 @@
Token get literal;
/// Set the token representing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set literal(Token token);
/// Return the value of the literal.
double get value;
/// Set the value of the literal to the given [value].
+ @Deprecated('Clients should not build AST manually')
set value(double value);
}
@@ -1929,6 +2055,7 @@
/// Set the token representing the semicolon that marks the end of the
/// function body to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -1943,6 +2070,7 @@
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -1954,6 +2082,7 @@
SimpleIdentifier get name;
/// Set the name of the constant to the given [name].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier name);
}
@@ -1974,12 +2103,14 @@
Token get enumKeyword;
/// Set the 'enum' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set enumKeyword(Token token);
/// Return the left curly bracket.
Token get leftBracket;
/// Set the left curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
@override
@@ -1989,6 +2120,7 @@
Token get rightBracket;
/// Set the right curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
}
@@ -2036,6 +2168,7 @@
DartType? get staticType;
/// Set the static type of this expression to the given [type].
+ @Deprecated('Clients should not build AST manually')
set staticType(DartType? type);
/// If this expression is a parenthesized expression, return the result of
@@ -2056,6 +2189,7 @@
/// Set the expression representing the body of the function to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the token introducing the expression that represents the body of the
@@ -2064,15 +2198,18 @@
/// Set the token introducing the expression that represents the body of the
/// function to the given [token].
+ @Deprecated('Clients should not build AST manually')
set functionDefinition(Token token);
/// Set token representing the 'async' or 'sync' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Return the semicolon terminating the statement.
Token? get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token? token);
}
@@ -2087,6 +2224,7 @@
Expression get expression;
/// Set the expression that comprises the statement to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the semicolon terminating the statement, or `null` if the
@@ -2095,6 +2233,7 @@
Token? get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token? token);
}
@@ -2109,12 +2248,14 @@
Token get extendsKeyword;
/// Set the token representing the 'extends' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set extendsKeyword(Token token);
/// Return the name of the class that is being extended.
TypeName get superclass;
/// Set the name of the class that is being extended to the given [name].
+ @Deprecated('Clients should not build AST manually')
set superclass(TypeName name);
}
@@ -2231,6 +2372,7 @@
Token? get covariantKeyword;
/// Set the token for the 'covariant' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set covariantKeyword(Token? token);
/// The `external` keyword, or `null` if the keyword was not used.
@@ -2240,6 +2382,7 @@
VariableDeclarationList get fields;
/// Set the fields being declared to the given list of [fields].
+ @Deprecated('Clients should not build AST manually')
set fields(VariableDeclarationList fields);
/// Return `true` if the fields are declared to be static.
@@ -2249,6 +2392,7 @@
Token get semicolon;
/// Set the semicolon terminating the declaration to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the token representing the 'static' keyword, or `null` if the
@@ -2256,6 +2400,7 @@
Token? get staticKeyword;
/// Set the token representing the 'static' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set staticKeyword(Token? token);
}
@@ -2276,6 +2421,7 @@
/// Set the token representing either the 'final', 'const' or 'var' keyword to
/// the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Return the parameters of the function-typed parameter, or `null` if this
@@ -2284,12 +2430,14 @@
/// Set the parameters of the function-typed parameter to the given
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList? parameters);
/// Return the token representing the period.
Token get period;
/// Set the token representing the period to the given [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token token);
/// If the parameter is function-typed, and has the question mark, then its
@@ -2301,6 +2449,7 @@
Token get thisKeyword;
/// Set the token representing the 'this' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set thisKeyword(Token token);
/// Return the declared type of the parameter, or `null` if the parameter does
@@ -2311,6 +2460,7 @@
TypeAnnotation? get type;
/// Set the declared type of the parameter to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation? type);
/// Return the type parameters associated with this method, or `null` if this
@@ -2319,6 +2469,7 @@
/// Set the type parameters associated with this method to the given
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -2506,12 +2657,14 @@
/// Set the left square bracket ('[') or left curly brace ('{') introducing
/// the optional parameters to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftDelimiter(Token? token);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return a list containing the elements representing the parameters in this
@@ -2531,12 +2684,14 @@
/// Set the right square bracket (']') or right curly brace ('}') terminating
/// the optional parameters to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightDelimiter(Token? token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
}
@@ -2693,6 +2848,7 @@
Token? get externalKeyword;
/// Set the token representing the 'external' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set externalKeyword(Token? token);
/// Return the function expression being wrapped.
@@ -2700,6 +2856,7 @@
/// Set the function expression being wrapped to the given
/// [functionExpression].
+ @Deprecated('Clients should not build AST manually')
set functionExpression(FunctionExpression functionExpression);
/// Return `true` if this function declares a getter.
@@ -2717,6 +2874,7 @@
/// Set the token representing the 'get' or 'set' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set propertyKeyword(Token? token);
/// Return the return type of the function, or `null` if no return type was
@@ -2724,6 +2882,7 @@
TypeAnnotation? get returnType;
/// Set the return type of the function to the given [type].
+ @Deprecated('Clients should not build AST manually')
set returnType(TypeAnnotation? type);
}
@@ -2736,6 +2895,7 @@
/// Set the function declaration being wrapped to the given
/// [functionDeclaration].
+ @Deprecated('Clients should not build AST manually')
set functionDeclaration(FunctionDeclaration functionDeclaration);
}
@@ -2750,6 +2910,7 @@
FunctionBody get body;
/// Set the body of the function to the given [functionBody].
+ @Deprecated('Clients should not build AST manually')
set body(FunctionBody functionBody);
/// Return the element associated with the function, or `null` if the AST
@@ -2762,6 +2923,7 @@
/// Set the parameters associated with the function to the given list of
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList? parameters);
/// Return the type parameters associated with this method, or `null` if this
@@ -2770,6 +2932,7 @@
/// Set the type parameters associated with this method to the given
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -2786,6 +2949,7 @@
abstract class FunctionExpressionInvocation
implements NullShortableExpression, InvocationExpression {
/// Set the list of arguments to the method to the given [argumentList].
+ @Deprecated('Clients should not build AST manually')
set argumentList(ArgumentList argumentList);
/// Return the expression producing the function being invoked.
@@ -2794,6 +2958,7 @@
/// Set the expression producing the function being invoked to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set function(Expression expression);
/// Return the element associated with the function being invoked based on
@@ -2803,10 +2968,12 @@
/// Set the element associated with the function being invoked based on static
/// type information to the given [element].
+ @Deprecated('Clients should not build AST manually')
set staticElement(ExecutableElement? element);
/// Set the type arguments to be applied to the method being invoked to the
/// given [typeArguments].
+ @Deprecated('Clients should not build AST manually')
set typeArguments(TypeArgumentList? typeArguments);
}
@@ -2829,6 +2996,7 @@
/// Set the parameters associated with the function type to the given list of
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList parameters);
/// Return the return type of the function type being defined, or `null` if no
@@ -2837,6 +3005,7 @@
/// Set the return type of the function type being defined to the given
/// [type].
+ @Deprecated('Clients should not build AST manually')
set returnType(TypeAnnotation? type);
/// Return the type parameters for the function type, or `null` if the
@@ -2845,6 +3014,7 @@
/// Set the type parameters for the function type to the given list of
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -2864,6 +3034,7 @@
/// Set the parameters of the function-typed parameter to the given
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList parameters);
/// Return the question mark indicating that the function type is nullable, or
@@ -2876,6 +3047,7 @@
TypeAnnotation? get returnType;
/// Set the return type of the function to the given [type].
+ @Deprecated('Clients should not build AST manually')
set returnType(TypeAnnotation? type);
/// Return the type parameters associated with this function, or `null` if
@@ -2884,6 +3056,7 @@
/// Set the type parameters associated with this method to the given
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -2922,6 +3095,7 @@
Token get functionKeyword;
/// Set the keyword 'Function' to the given [token].
+ @Deprecated('Clients should not build AST manually')
set functionKeyword(Token token);
/// Return the parameters associated with the function type.
@@ -2929,10 +3103,12 @@
/// Set the parameters associated with the function type to the given list of
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList parameters);
/// Set the question mark indicating that the type is nullable to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set question(Token? token);
/// Return the return type of the function type being defined, or `null` if
@@ -2940,6 +3116,7 @@
TypeAnnotation? get returnType;
/// Set the return type of the function type being defined to the given[type].
+ @Deprecated('Clients should not build AST manually')
set returnType(TypeAnnotation? type);
/// Return the type parameters for the function type, or `null` if the
@@ -2948,6 +3125,7 @@
/// Set the type parameters for the function type to the given list of
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -3071,6 +3249,7 @@
/// Set the condition used to determine which of the statements is executed
/// next to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set condition(Expression expression);
/// Return the token representing the 'else' keyword, or `null` if there is no
@@ -3078,6 +3257,7 @@
Token? get elseKeyword;
/// Set the token representing the 'else' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set elseKeyword(Token? token);
/// Return the statement that is executed if the condition evaluates to
@@ -3086,24 +3266,28 @@
/// Set the statement that is executed if the condition evaluates to `false`
/// to the given [statement].
+ @Deprecated('Clients should not build AST manually')
set elseStatement(Statement? statement);
/// Return the token representing the 'if' keyword.
Token get ifKeyword;
/// Set the token representing the 'if' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set ifKeyword(Token token);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
/// Return the statement that is executed if the condition evaluates to
@@ -3112,6 +3296,7 @@
/// Set the statement that is executed if the condition evaluates to `true` to
/// the given [statement].
+ @Deprecated('Clients should not build AST manually')
set thenStatement(Statement statement);
}
@@ -3126,6 +3311,7 @@
Token get implementsKeyword;
/// Set the token representing the 'implements' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set implementsKeyword(Token token);
/// Return the list of the interfaces that are being implemented.
@@ -3251,6 +3437,7 @@
Token? get asKeyword;
/// Set the token representing the 'as' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set asKeyword(Token? token);
/// Return the token representing the 'deferred' keyword, or `null` if the
@@ -3258,6 +3445,7 @@
Token? get deferredKeyword;
/// Set the token representing the 'deferred' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set deferredKeyword(Token? token);
@override
@@ -3269,6 +3457,7 @@
/// Set the prefix to be used with the imported names to the given
/// [identifier].
+ @Deprecated('Clients should not build AST manually')
set prefix(SimpleIdentifier? identifier);
}
@@ -3284,6 +3473,7 @@
Expression get index;
/// Set the expression used to compute the index to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set index(Expression expression);
/// Return `true` if this expression is cascaded.
@@ -3299,6 +3489,7 @@
Token get leftBracket;
/// Set the left square bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the period (".." | "?..") before a cascaded index expression, or
@@ -3307,6 +3498,7 @@
/// Set the period ("..") before a cascaded index expression to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the question mark before the left bracket, or `null` if there is no
@@ -3333,6 +3525,7 @@
/// Set the expression used to compute the object being indexed to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set target(Expression? expression);
/// Return `true` if this expression is computing a right-hand value (that is,
@@ -3367,12 +3560,14 @@
ArgumentList get argumentList;
/// Set the list of arguments to the constructor to the given [argumentList].
+ @Deprecated('Clients should not build AST manually')
set argumentList(ArgumentList argumentList);
/// Return the name of the constructor to be invoked.
ConstructorName get constructorName;
/// Set the name of the constructor to be invoked to the given [name].
+ @Deprecated('Clients should not build AST manually')
set constructorName(ConstructorName name);
/// Return `true` if this creation expression is used to invoke a constant
@@ -3387,6 +3582,7 @@
/// Set the 'new' or 'const' keyword used to indicate how an object should be
/// created to the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
}
@@ -3409,6 +3605,7 @@
Token get literal;
/// Set the token representing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set literal(Token token);
/// Return the value of the literal, or `null` when [literal] does not
@@ -3416,6 +3613,7 @@
int? get value;
/// Set the value of the literal to the given [value].
+ @Deprecated('Clients should not build AST manually')
set value(int? value);
}
@@ -3442,6 +3640,7 @@
/// Set the expression to be evaluated for the value to be converted into a
/// string to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the token used to introduce the interpolation expression; either
@@ -3452,6 +3651,7 @@
/// Set the token used to introduce the interpolation expression; either '$'
/// if the expression is a simple identifier or '${' if the expression is a
/// full expression to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the right curly bracket, or `null` if the expression is an
@@ -3459,6 +3659,7 @@
Token? get rightBracket;
/// Set the right curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token? token);
}
@@ -3473,6 +3674,7 @@
Token get contents;
/// Set the characters that will be added to the string to the given [token].
+ @Deprecated('Clients should not build AST manually')
set contents(Token token);
/// Return the offset of the after-last contents character.
@@ -3485,6 +3687,7 @@
String get value;
/// Set the value of the literal to the given [value].
+ @Deprecated('Clients should not build AST manually')
set value(String value);
}
@@ -3517,6 +3720,7 @@
/// Sets the function type of the invocation based on the static type
/// information.
+ @Deprecated('Clients should not build AST manually')
set staticInvokeType(DartType? value);
/// Return the type arguments to be applied to the method being invoked, or
@@ -3546,12 +3750,14 @@
/// Set the expression used to compute the value whose type is being tested to
/// the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the is operator.
Token get isOperator;
/// Set the is operator to the given [token].
+ @Deprecated('Clients should not build AST manually')
set isOperator(Token token);
/// Return the not operator, or `null` if the sense of the test is not
@@ -3559,12 +3765,14 @@
Token? get notOperator;
/// Set the not operator to the given [token].
+ @Deprecated('Clients should not build AST manually')
set notOperator(Token? token);
/// Return the type being tested for.
TypeAnnotation get type;
/// Set the type being tested for to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation type);
}
@@ -3580,12 +3788,14 @@
/// Set the colon that separates the label from the statement to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set colon(Token token);
/// Return the label being associated with the statement.
SimpleIdentifier get label;
/// Set the label being associated with the statement to the given [label].
+ @Deprecated('Clients should not build AST manually')
set label(SimpleIdentifier label);
}
@@ -3604,6 +3814,7 @@
/// Set the statement with which the labels are being associated to the given
/// [statement].
+ @Deprecated('Clients should not build AST manually')
set statement(Statement statement);
}
@@ -3618,18 +3829,21 @@
Token get libraryKeyword;
/// Set the token representing the 'library' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set libraryKeyword(Token token);
/// Return the name of the library being defined.
LibraryIdentifier get name;
/// Set the name of the library being defined to the given [name].
+ @Deprecated('Clients should not build AST manually')
set name(LibraryIdentifier name);
/// Return the semicolon terminating the directive.
Token get semicolon;
/// Set the semicolon terminating the directive to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -3661,12 +3875,14 @@
Token get leftBracket;
/// Set the left square bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the right square bracket.
Token get rightBracket;
/// Set the right square bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
}
@@ -3697,12 +3913,14 @@
/// Set the expression computing the key with which the value will be
/// associated to the given [string].
+ @Deprecated('Clients should not build AST manually')
set key(Expression string);
/// Return the colon that separates the key from the value.
Token get separator;
/// Set the colon that separates the key from the value to the given [token].
+ @Deprecated('Clients should not build AST manually')
set separator(Token token);
/// Return the expression computing the value that will be associated with the
@@ -3711,6 +3929,7 @@
/// Set the expression computing the value that will be associated with the
/// key to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set value(Expression expression);
}
@@ -3737,6 +3956,7 @@
FunctionBody get body;
/// Set the body of the method to the given [functionBody].
+ @Deprecated('Clients should not build AST manually')
set body(FunctionBody functionBody);
@override
@@ -3747,6 +3967,7 @@
Token? get externalKeyword;
/// Set the token for the 'external' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set externalKeyword(Token? token);
/// Return `true` if this method is declared to be an abstract method.
@@ -3770,12 +3991,14 @@
/// Set the token representing the 'abstract' or 'static' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set modifierKeyword(Token? token);
/// Return the name of the method.
SimpleIdentifier get name;
/// Set the name of the method to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier identifier);
/// Return the token representing the 'operator' keyword, or `null` if this
@@ -3783,6 +4006,7 @@
Token? get operatorKeyword;
/// Set the token representing the 'operator' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set operatorKeyword(Token? token);
/// Return the parameters associated with the method, or `null` if this method
@@ -3791,6 +4015,7 @@
/// Set the parameters associated with the method to the given list of
/// [parameters].
+ @Deprecated('Clients should not build AST manually')
set parameters(FormalParameterList? parameters);
/// Return the token representing the 'get' or 'set' keyword, or `null` if
@@ -3799,6 +4024,7 @@
/// Set the token representing the 'get' or 'set' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set propertyKeyword(Token? token);
/// Return the return type of the method, or `null` if no return type was
@@ -3806,6 +4032,7 @@
TypeAnnotation? get returnType;
/// Set the return type of the method to the given [type].
+ @Deprecated('Clients should not build AST manually')
set returnType(TypeAnnotation? type);
/// Return the type parameters associated with this method, or `null` if this
@@ -3814,6 +4041,7 @@
/// Set the type parameters associated with this method to the given
/// [typeParameters].
+ @Deprecated('Clients should not build AST manually')
set typeParameters(TypeParameterList? typeParameters);
}
@@ -3831,6 +4059,7 @@
abstract class MethodInvocation
implements NullShortableExpression, InvocationExpression {
/// Set the list of arguments to the method to the given [argumentList].
+ @Deprecated('Clients should not build AST manually')
set argumentList(ArgumentList argumentList);
/// Return `true` if this expression is cascaded.
@@ -3846,6 +4075,7 @@
SimpleIdentifier get methodName;
/// Set the name of the method being invoked to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set methodName(SimpleIdentifier identifier);
/// Return the operator that separates the target from the method name, or
@@ -3857,6 +4087,7 @@
/// Set the operator that separates the target from the method name to the
/// given [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token? token);
/// Return the expression used to compute the receiver of the invocation.
@@ -3876,10 +4107,12 @@
/// Set the expression producing the object on which the method is defined to
/// the given [expression].
+ @Deprecated('Clients should not build AST manually')
set target(Expression? expression);
/// Set the type arguments to be applied to the method being invoked to the
/// given [typeArguments].
+ @Deprecated('Clients should not build AST manually')
set typeArguments(TypeArgumentList? typeArguments);
}
@@ -3896,6 +4129,7 @@
/// Set the element associated with the expression based on static types to
/// the given [element].
+ @Deprecated('Clients should not build AST manually')
set staticElement(MethodElement? element);
}
@@ -3923,6 +4157,7 @@
SimpleIdentifier get name;
/// Set the name of the member being declared to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier identifier);
}
@@ -3944,12 +4179,14 @@
/// Set the expression with which the name is associated to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the name associated with the expression.
Label get name;
/// Set the name associated with the expression to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(Label identifier);
}
@@ -3970,13 +4207,16 @@
Identifier get name;
/// Set the name of the type to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(Identifier identifier);
/// Set the question mark indicating that the type is nullable to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set question(Token? token);
/// Set the type being named to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(DartType? type);
/// Return the type arguments associated with the type, or `null` if there are
@@ -3985,6 +4225,7 @@
/// Set the type arguments associated with the type to the given
/// [typeArguments].
+ @Deprecated('Clients should not build AST manually')
set typeArguments(TypeArgumentList? typeArguments);
}
@@ -4005,12 +4246,13 @@
/// Set the token representing the keyword that introduces this directive
/// ('import', 'export', 'library' or 'part') to the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token token);
/// Return the source that was selected based on the declared variables.
///
/// This will be the source from the first configuration whose condition is
- /// true, or the [uriSource] if either there are no configurations or if
+ /// true, or the `[uriSource]` if either there are no configurations or if
/// there are no configurations whose condition is true.
Source? get selectedSource;
@@ -4018,7 +4260,7 @@
/// variables.
///
/// This will be the URI from the first configuration whose condition is
- /// true, or the [uriContent] if either there are no configurations or if
+ /// true, or the `[uriContent]` if either there are no configurations or if
/// there are no configurations whose condition is true.
String? get selectedUriContent;
@@ -4026,6 +4268,7 @@
Token get semicolon;
/// Set the semicolon terminating the directive to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -4041,12 +4284,14 @@
/// Set the name of the native object that implements the class to the given
/// [name].
+ @Deprecated('Clients should not build AST manually')
set name(StringLiteral? name);
/// Return the token representing the 'native' keyword.
Token get nativeKeyword;
/// Set the token representing the 'native' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set nativeKeyword(Token token);
}
@@ -4064,6 +4309,7 @@
/// Set the token representing 'native' that marks the start of the function
/// body to the given [token].
+ @Deprecated('Clients should not build AST manually')
set nativeKeyword(Token token);
/// Return the token representing the semicolon that marks the end of the
@@ -4072,6 +4318,7 @@
/// Set the token representing the semicolon that marks the end of the
/// function body to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the string literal representing the string after the 'native'
@@ -4080,6 +4327,7 @@
/// Set the string literal representing the string after the 'native' token to
/// the given [stringLiteral].
+ @Deprecated('Clients should not build AST manually')
set stringLiteral(StringLiteral? stringLiteral);
}
@@ -4105,6 +4353,7 @@
/// Set the node at the given [index] in the list to the given [node] or throw
/// a [RangeError] if [index] is out of bounds.
+ @Deprecated('Clients should not build AST manually')
@override
void operator []=(int index, E node);
@@ -4122,6 +4371,7 @@
/// Clients may not extend, implement or mix-in this class.
abstract class NormalFormalParameter implements FormalParameter {
/// Set the token for the 'covariant' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set covariantKeyword(Token? token);
/// Return the documentation comment associated with this parameter, or `null`
@@ -4131,12 +4381,15 @@
/// Set the documentation comment associated with this parameter to the given
/// [comment].
+ @Deprecated('Clients should not build AST manually')
set documentationComment(Comment? comment);
/// Set the name of the parameter being declared to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set identifier(SimpleIdentifier? identifier);
/// Set the metadata associated with this node to the given [metadata].
+ @Deprecated('Clients should not build AST manually')
set metadata(List<Annotation> metadata);
/// Return a list containing the comment and annotations associated with this
@@ -4155,6 +4408,7 @@
Token get literal;
/// Set the token representing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set literal(Token token);
}
@@ -4201,18 +4455,21 @@
Expression get expression;
/// Set the expression within the parentheses to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
}
@@ -4227,12 +4484,14 @@
Token get partKeyword;
/// Set the token representing the 'part' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set partKeyword(Token token);
/// Return the semicolon terminating the directive.
Token get semicolon;
/// Set the semicolon terminating the directive to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -4249,24 +4508,28 @@
/// Set the name of the library that the containing compilation unit is part
/// of to the given [libraryName].
+ @Deprecated('Clients should not build AST manually')
set libraryName(LibraryIdentifier? libraryName);
/// Return the token representing the 'of' keyword.
Token get ofKeyword;
/// Set the token representing the 'of' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set ofKeyword(Token token);
/// Return the token representing the 'part' keyword.
Token get partKeyword;
/// Set the token representing the 'part' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set partKeyword(Token token);
/// Return the semicolon terminating the directive.
Token get semicolon;
/// Set the semicolon terminating the directive to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the URI of the library that the containing compilation unit is part
@@ -4277,6 +4540,7 @@
/// Return the URI of the library that the containing compilation unit is part
/// of, or `null` if no URI was given (typically because a library name was
/// provided).
+ @Deprecated('Clients should not build AST manually')
set uri(StringLiteral? uri);
}
@@ -4297,6 +4561,7 @@
/// Set the expression computing the operand for the operator to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set operand(Expression expression);
/// Return the postfix operator being applied to the operand.
@@ -4304,6 +4569,7 @@
/// Set the postfix operator being applied to the operand to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token token);
}
@@ -4319,6 +4585,7 @@
SimpleIdentifier get identifier;
/// Set the identifier being prefixed to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set identifier(SimpleIdentifier identifier);
/// Return `true` if this type is a deferred type. If the AST structure has
@@ -4333,6 +4600,7 @@
/// Set the period used to separate the prefix from the identifier to the
/// given [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token token);
/// Return the prefix associated with the library in which the identifier is
@@ -4341,6 +4609,7 @@
/// Set the prefix associated with the library in which the identifier is
/// defined to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set prefix(SimpleIdentifier identifier);
}
@@ -4361,12 +4630,14 @@
/// Set the expression computing the operand for the operator to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set operand(Expression expression);
/// Return the prefix operator being applied to the operand.
Token get operator;
/// Set the prefix operator being applied to the operand to the given [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token token);
}
@@ -4394,12 +4665,14 @@
Token get operator;
/// Set the property access operator to the given [token].
+ @Deprecated('Clients should not build AST manually')
set operator(Token token);
/// Return the name of the property being accessed.
SimpleIdentifier get propertyName;
/// Set the name of the property being accessed to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set propertyName(SimpleIdentifier identifier);
/// Return the expression used to compute the receiver of the invocation.
@@ -4419,6 +4692,7 @@
/// Set the expression computing the object defining the property being
/// accessed to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set target(Expression? expression);
}
@@ -4435,6 +4709,7 @@
ArgumentList get argumentList;
/// Set the list of arguments to the constructor to the given [argumentList].
+ @Deprecated('Clients should not build AST manually')
set argumentList(ArgumentList argumentList);
/// Return the name of the constructor that is being invoked, or `null` if the
@@ -4443,6 +4718,7 @@
/// Set the name of the constructor that is being invoked to the given
/// [identifier].
+ @Deprecated('Clients should not build AST manually')
set constructorName(SimpleIdentifier? identifier);
/// Return the token for the period before the name of the constructor that is
@@ -4451,12 +4727,14 @@
/// Set the token for the period before the name of the constructor that is
/// being invoked to the given [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the token for the 'this' keyword.
Token get thisKeyword;
/// Set the token for the 'this' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set thisKeyword(Token token);
}
@@ -4471,6 +4749,7 @@
Token get rethrowKeyword;
/// Set the token representing the 'rethrow' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rethrowKeyword(Token token);
}
@@ -4487,18 +4766,21 @@
/// Set the expression computing the value to be returned to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression? expression);
/// Return the token representing the 'return' keyword.
Token get returnKeyword;
/// Set the token representing the 'return' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set returnKeyword(Token token);
/// Return the semicolon terminating the statement.
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
}
@@ -4514,6 +4796,7 @@
Token get scriptTag;
/// Set the token representing this script tag to the given [token].
+ @Deprecated('Clients should not build AST manually')
set scriptTag(Token token);
}
@@ -4605,6 +4888,7 @@
/// Set the token representing either the 'final', 'const' or 'var' keyword to
/// the given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Return the declared type of the parameter, or `null` if the parameter does
@@ -4612,6 +4896,7 @@
TypeAnnotation? get type;
/// Set the declared type of the parameter to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation? type);
}
@@ -4632,10 +4917,11 @@
/// Set the element associated with this identifier based on static type
/// information to the given [element].
+ @Deprecated('Clients should not build AST manually')
set staticElement(Element? element);
/// If the identifier is a tear-off, return the inferred type arguments
- /// applied to the function type of the element to produce its [staticType].
+ /// applied to the function type of the element to produce its `[staticType]`.
///
/// Return an empty list if the function type does not have type parameters.
///
@@ -4650,6 +4936,7 @@
Token get token;
/// Set the token representing the identifier to the given [token].
+ @Deprecated('Clients should not build AST manually')
set token(Token token);
/// Return `true` if this identifier is the name being declared in a
@@ -4701,12 +4988,14 @@
Token get literal;
/// Set the token representing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set literal(Token token);
/// Return the value of the literal.
String get value;
/// Set the value of the literal to the given [string].
+ @Deprecated('Clients should not build AST manually')
set value(String string);
}
@@ -4818,6 +5107,7 @@
ArgumentList get argumentList;
/// Set the list of arguments to the constructor to the given [argumentList].
+ @Deprecated('Clients should not build AST manually')
set argumentList(ArgumentList argumentList);
/// Return the name of the constructor that is being invoked, or `null` if the
@@ -4826,6 +5116,7 @@
/// Set the name of the constructor that is being invoked to the given
/// [identifier].
+ @Deprecated('Clients should not build AST manually')
set constructorName(SimpleIdentifier? identifier);
/// Return the token for the period before the name of the constructor that is
@@ -4834,12 +5125,14 @@
/// Set the token for the period before the name of the constructor that is
/// being invoked to the given [token].
+ @Deprecated('Clients should not build AST manually')
set period(Token? token);
/// Return the token for the 'super' keyword.
Token get superKeyword;
/// Set the token for the 'super' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set superKeyword(Token token);
}
@@ -4854,6 +5147,7 @@
Token get superKeyword;
/// Set the token representing the 'super' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set superKeyword(Token token);
}
@@ -4869,6 +5163,7 @@
/// Set the expression controlling whether the statements will be executed to
/// the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
}
@@ -4894,6 +5189,7 @@
/// Set the colon separating the keyword or the expression from the
/// statements to the given [token].
+ @Deprecated('Clients should not build AST manually')
set colon(Token token);
/// Return the token representing the 'case' or 'default' keyword.
@@ -4901,6 +5197,7 @@
/// Set the token representing the 'case' or 'default' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token token);
/// Return the labels associated with the switch member.
@@ -4924,18 +5221,21 @@
/// Set the expression used to determine which of the switch members will be
/// selected to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the left curly bracket.
Token get leftBracket;
/// Set the left curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the switch members that can be selected by the expression.
@@ -4945,18 +5245,21 @@
Token get rightBracket;
/// Set the right curly bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
/// Return the token representing the 'switch' keyword.
Token get switchKeyword;
/// Set the token representing the 'switch' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set switchKeyword(Token token);
}
@@ -4974,6 +5277,7 @@
Token get poundSign;
/// Set the token introducing the literal to the given [token].
+ @Deprecated('Clients should not build AST manually')
set poundSign(Token token);
}
@@ -4988,6 +5292,7 @@
Token get thisKeyword;
/// Set the token representing the 'this' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set thisKeyword(Token token);
}
@@ -5003,12 +5308,14 @@
/// Set the expression computing the exception to be thrown to the given
/// [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the token representing the 'throw' keyword.
Token get throwKeyword;
/// Set the token representing the 'throw' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set throwKeyword(Token token);
}
@@ -5034,6 +5341,7 @@
Token get semicolon;
/// Set the semicolon terminating the declaration to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the top-level variables being declared.
@@ -5041,6 +5349,7 @@
/// Set the top-level variables being declared to the given list of
/// [variables].
+ @Deprecated('Clients should not build AST manually')
set variables(VariableDeclarationList variables);
}
@@ -5058,6 +5367,7 @@
Block get body;
/// Set the body of the statement to the given [block].
+ @Deprecated('Clients should not build AST manually')
set body(Block block);
/// Return the catch clauses contained in the try statement.
@@ -5068,6 +5378,7 @@
Block? get finallyBlock;
/// Set the finally block contained in the try statement to the given [block].
+ @Deprecated('Clients should not build AST manually')
set finallyBlock(Block? block);
/// Return the token representing the 'finally' keyword, or `null` if the
@@ -5075,12 +5386,14 @@
Token? get finallyKeyword;
/// Set the token representing the 'finally' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set finallyKeyword(Token? token);
/// Return the token representing the 'try' keyword.
Token get tryKeyword;
/// Set the token representing the 'try' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set tryKeyword(Token token);
}
@@ -5102,12 +5415,14 @@
Token get semicolon;
/// Set the semicolon terminating the declaration to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the token representing the 'typedef' keyword.
Token get typedefKeyword;
/// Set the token representing the 'typedef' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set typedefKeyword(Token token);
}
@@ -5142,12 +5457,14 @@
Token get leftBracket;
/// Set the left bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftBracket(Token token);
/// Return the right bracket.
Token get rightBracket;
/// Set the right bracket to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightBracket(Token token);
}
@@ -5164,6 +5481,7 @@
Token? get constKeyword;
/// Set the token representing the 'const' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set constKeyword(Token? token);
/// Return `true` if this literal is a constant expression, either because the
@@ -5177,6 +5495,7 @@
/// Set the type argument associated with this literal to the given
/// [typeArguments].
+ @Deprecated('Clients should not build AST manually')
set typeArguments(TypeArgumentList? typeArguments);
}
@@ -5200,6 +5519,7 @@
TypeAnnotation? get bound;
/// Set the upper bound for legal arguments to the given [type].
+ @Deprecated('Clients should not build AST manually')
set bound(TypeAnnotation? type);
@override
@@ -5210,12 +5530,14 @@
Token? get extendsKeyword;
/// Set the token representing the 'extends' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set extendsKeyword(Token? token);
/// Return the name of the type parameter.
SimpleIdentifier get name;
/// Set the name of the type parameter to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier identifier);
}
@@ -5249,6 +5571,7 @@
StringLiteral get uri;
/// Set the URI referenced by this directive to the given [uri].
+ @Deprecated('Clients should not build AST manually')
set uri(StringLiteral uri);
/// Return the content of the [uri], or `null` if the AST structure has not
@@ -5256,6 +5579,7 @@
String? get uriContent;
/// Set the content of the [uri] to the given [content].
+ @Deprecated('Clients should not build AST manually')
set uriContent(String? content);
/// Return the element associated with the [uri] of this directive, or `null`
@@ -5270,6 +5594,7 @@
Source? get uriSource;
/// Set the source to which the [uri] was resolved to the given [source].
+ @Deprecated('Clients should not build AST manually')
set uriSource(Source? source);
}
@@ -5296,6 +5621,7 @@
/// Set the equal sign separating the variable name from the initial value to
/// the given [token].
+ @Deprecated('Clients should not build AST manually')
set equals(Token? token);
/// Return the expression used to compute the initial value for the variable,
@@ -5304,6 +5630,7 @@
/// Set the expression used to compute the initial value for the variable to
/// the given [expression].
+ @Deprecated('Clients should not build AST manually')
set initializer(Expression? expression);
/// Return `true` if this variable was declared with the 'const' modifier.
@@ -5322,6 +5649,7 @@
SimpleIdentifier get name;
/// Set the name of the variable being declared to the given [identifier].
+ @Deprecated('Clients should not build AST manually')
set name(SimpleIdentifier identifier);
}
@@ -5360,6 +5688,7 @@
/// Set the token representing the 'final', 'const' or 'var' keyword to the
/// given [token].
+ @Deprecated('Clients should not build AST manually')
set keyword(Token? token);
/// Return the token representing the 'late' keyword, or `null` if the late
@@ -5371,6 +5700,7 @@
TypeAnnotation? get type;
/// Set the type of the variables being declared to the given [type].
+ @Deprecated('Clients should not build AST manually')
set type(TypeAnnotation? type);
/// Return a list containing the individual variables being declared.
@@ -5389,12 +5719,14 @@
Token get semicolon;
/// Set the semicolon terminating the statement to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the variables being declared.
VariableDeclarationList get variables;
/// Set the variables being declared to the given list of [variables].
+ @Deprecated('Clients should not build AST manually')
set variables(VariableDeclarationList variables);
}
@@ -5409,6 +5741,7 @@
Statement get body;
/// Set the body of the loop to the given [statement].
+ @Deprecated('Clients should not build AST manually')
set body(Statement statement);
/// Return the expression used to determine whether to execute the body of the
@@ -5417,24 +5750,28 @@
/// Set the expression used to determine whether to execute the body of the
/// loop to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set condition(Expression expression);
/// Return the left parenthesis.
Token get leftParenthesis;
/// Set the left parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set leftParenthesis(Token token);
/// Return the right parenthesis.
Token get rightParenthesis;
/// Set the right parenthesis to the given [token].
+ @Deprecated('Clients should not build AST manually')
set rightParenthesis(Token token);
/// Return the token representing the 'while' keyword.
Token get whileKeyword;
/// Set the token representing the 'while' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set whileKeyword(Token token);
}
@@ -5452,6 +5789,7 @@
Token get withKeyword;
/// Set the token representing the 'with' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set withKeyword(Token token);
}
@@ -5466,12 +5804,14 @@
Expression get expression;
/// Set the expression whose value will be yielded to the given [expression].
+ @Deprecated('Clients should not build AST manually')
set expression(Expression expression);
/// Return the semicolon following the expression.
Token get semicolon;
/// Return the semicolon following the expression to the given [token].
+ @Deprecated('Clients should not build AST manually')
set semicolon(Token token);
/// Return the star optionally following the 'yield' keyword.
@@ -5479,11 +5819,13 @@
/// Return the star optionally following the 'yield' keyword to the given
/// [token].
+ @Deprecated('Clients should not build AST manually')
set star(Token? token);
/// Return the 'yield' keyword.
Token get yieldKeyword;
/// Return the 'yield' keyword to the given [token].
+ @Deprecated('Clients should not build AST manually')
set yieldKeyword(Token token);
}
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index dc2c87a..fcf5423 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -10,7 +10,6 @@
import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/error/listener.dart';
@@ -23,6 +22,7 @@
import 'package:analyzer/src/dart/analysis/referenced_names.dart';
import 'package:analyzer/src/dart/analysis/unlinked_api_signature.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -403,7 +403,7 @@
/// Return a new parsed unresolved [CompilationUnit].
///
/// If an exception happens during parsing, an empty unit is returned.
- CompilationUnit parse([AnalysisErrorListener? errorListener]) {
+ CompilationUnitImpl parse([AnalysisErrorListener? errorListener]) {
errorListener ??= AnalysisErrorListener.NULL_LISTENER;
try {
return _parse(errorListener);
@@ -527,13 +527,13 @@
}
}
- CompilationUnit _createEmptyCompilationUnit() {
+ CompilationUnitImpl _createEmptyCompilationUnit() {
var token = Token.eof(0);
var unit = astFactory.compilationUnit(
beginToken: token,
endToken: token,
featureSet: _contextFeatureSet!,
- ) as CompilationUnitImpl;
+ );
unit.lineInfo = LineInfo(const <int>[0]);
@@ -605,7 +605,7 @@
}
}
- CompilationUnit _parse(AnalysisErrorListener errorListener) {
+ CompilationUnitImpl _parse(AnalysisErrorListener errorListener) {
if (source == null) {
return _createEmptyCompilationUnit();
}
@@ -628,7 +628,7 @@
);
parser.enableOptionalNewAndConst = true;
- var unit = parser.parseCompilationUnit(token) as CompilationUnitImpl;
+ var unit = parser.parseCompilationUnit(token);
unit.lineInfo = lineInfo;
unit.languageVersion = LibraryLanguageVersion(
package: packageLanguageVersion!,
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
index c3b00d8..82b883d 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
@@ -109,7 +109,7 @@
/// Compute analysis results for all units of the library.
Map<FileState, UnitAnalysisResult> analyzeSync() {
timerLibraryAnalyzer.start();
- Map<FileState, CompilationUnit> units = {};
+ Map<FileState, CompilationUnitImpl> units = {};
// Parse all files.
timerLibraryAnalyzerFreshUnit.start();
@@ -517,10 +517,10 @@
}
/// Return a new parsed unresolved [CompilationUnit].
- CompilationUnit _parse(FileState file) {
+ CompilationUnitImpl _parse(FileState file) {
AnalysisErrorListener errorListener = _getErrorListener(file);
String content = file.content;
- CompilationUnit unit = file.parse(errorListener);
+ var unit = file.parse(errorListener);
LineInfo lineInfo = unit.lineInfo!;
_fileToLineInfo[file] = lineInfo;
@@ -529,8 +529,8 @@
return unit;
}
- void _resolveDirectives(Map<FileState, CompilationUnit> units) {
- CompilationUnit definingCompilationUnit = units[_library]!;
+ void _resolveDirectives(Map<FileState, CompilationUnitImpl> units) {
+ var definingCompilationUnit = units[_library]!;
definingCompilationUnit.element = _libraryElement.definingCompilationUnit;
bool matchNodeElement(Directive node, Element element) {
@@ -541,14 +541,14 @@
LibraryIdentifier? libraryNameNode;
var seenPartSources = <Source>{};
- var directivesToResolve = <Directive>[];
+ var directivesToResolve = <DirectiveImpl>[];
int partDirectiveIndex = 0;
int partElementIndex = 0;
for (Directive directive in definingCompilationUnit.directives) {
- if (directive is LibraryDirective) {
+ if (directive is LibraryDirectiveImpl) {
libraryNameNode = directive.name;
directivesToResolve.add(directive);
- } else if (directive is ImportDirective) {
+ } else if (directive is ImportDirectiveImpl) {
for (ImportElement importElement in _libraryElement.imports) {
if (matchNodeElement(directive, importElement)) {
directive.element = importElement;
@@ -562,7 +562,7 @@
}
}
}
- } else if (directive is ExportDirective) {
+ } else if (directive is ExportDirectiveImpl) {
for (ExportElement exportElement in _libraryElement.exports) {
if (matchNodeElement(directive, exportElement)) {
directive.element = exportElement;
@@ -575,7 +575,7 @@
}
}
}
- } else if (directive is PartDirective) {
+ } else if (directive is PartDirectiveImpl) {
StringLiteral partUri = directive.uri;
var partFile = _library.partedFiles[partDirectiveIndex++];
@@ -647,7 +647,7 @@
//
// Resolve the relevant directives to the library element.
//
- for (Directive directive in directivesToResolve) {
+ for (var directive in directivesToResolve) {
directive.element = _libraryElement;
}
@@ -734,8 +734,8 @@
}
void _resolveUriBasedDirectives(FileState file, CompilationUnit unit) {
- for (Directive directive in unit.directives) {
- if (directive is UriBasedDirective) {
+ for (var directive in unit.directives) {
+ if (directive is UriBasedDirectiveImpl) {
StringLiteral uriLiteral = directive.uri;
String? uriContent = uriLiteral.stringValue?.trim();
directive.uriContent = uriContent;
@@ -751,6 +751,7 @@
relativeUri,
);
for (var configuration in directive.configurations) {
+ configuration as ConfigurationImpl;
var uriLiteral = configuration.uri;
String? uriContent = uriLiteral.stringValue?.trim();
Source? defaultSource = _resolveUri(
diff --git a/pkg/analyzer/lib/src/dart/ast/ast.dart b/pkg/analyzer/lib/src/dart/ast/ast.dart
index e0cbb1c..e38573d 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast.dart
@@ -1872,21 +1872,22 @@
}
/// Create a block comment consisting of the given [tokens].
- static Comment createBlockComment(List<Token> tokens) =>
+ static CommentImpl createBlockComment(List<Token> tokens) =>
CommentImpl(tokens, CommentType.BLOCK, const <CommentReference>[]);
/// Create a documentation comment consisting of the given [tokens].
- static Comment createDocumentationComment(List<Token> tokens) => CommentImpl(
- tokens, CommentType.DOCUMENTATION, const <CommentReference>[]);
+ static CommentImpl createDocumentationComment(List<Token> tokens) =>
+ CommentImpl(
+ tokens, CommentType.DOCUMENTATION, const <CommentReference>[]);
/// Create a documentation comment consisting of the given [tokens] and having
/// the given [references] embedded within it.
- static Comment createDocumentationCommentWithReferences(
+ static CommentImpl createDocumentationCommentWithReferences(
List<Token> tokens, List<CommentReference> references) =>
CommentImpl(tokens, CommentType.DOCUMENTATION, references);
/// Create an end-of-line comment consisting of the given [tokens].
- static Comment createEndOfLineComment(List<Token> tokens) =>
+ static CommentImpl createEndOfLineComment(List<Token> tokens) =>
CommentImpl(tokens, CommentType.END_OF_LINE, const <CommentReference>[]);
}
@@ -4327,6 +4328,9 @@
}
@override
+ SimpleIdentifierImpl? get identifier;
+
+ @override
bool get isNamed => kind.isNamed;
@override
@@ -4354,10 +4358,10 @@
ParameterKind get kind;
static void setDeclaredElement(
- FormalParameter node,
+ FormalParameterImpl node,
ParameterElement element,
) {
- if (node is DefaultFormalParameter) {
+ if (node is DefaultFormalParameterImpl) {
setDeclaredElement(node.parameter, element);
} else if (node is SimpleFormalParameterImpl) {
node.declaredElement = element;
diff --git a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
index 9caaf9f..ef4451b 100644
--- a/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
+++ b/pkg/analyzer/lib/src/dart/ast/ast_factory.dart
@@ -9,15 +9,18 @@
import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
+/// The instance of [AstFactoryImpl].
+final AstFactoryImpl astFactory = AstFactoryImpl();
+
/// Concrete implementation of [AstFactory] based on the standard AST
/// implementation.
class AstFactoryImpl extends AstFactory {
@override
- AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
+ AdjacentStringsImpl adjacentStrings(List<StringLiteral> strings) =>
AdjacentStringsImpl(strings);
@override
- Annotation annotation(
+ AnnotationImpl annotation(
{required Token atSign,
required Identifier name,
TypeArgumentList? typeArguments,
@@ -33,18 +36,18 @@
arguments as ArgumentListImpl?);
@override
- ArgumentList argumentList(Token leftParenthesis, List<Expression> arguments,
- Token rightParenthesis) =>
+ ArgumentListImpl argumentList(Token leftParenthesis,
+ List<Expression> arguments, Token rightParenthesis) =>
ArgumentListImpl(leftParenthesis, arguments, rightParenthesis);
@override
- AsExpression asExpression(
+ AsExpressionImpl asExpression(
Expression expression, Token asOperator, TypeAnnotation type) =>
AsExpressionImpl(
expression as ExpressionImpl, asOperator, type as TypeAnnotationImpl);
@override
- AssertInitializer assertInitializer(
+ AssertInitializerImpl assertInitializer(
Token assertKeyword,
Token leftParenthesis,
Expression condition,
@@ -60,7 +63,7 @@
rightParenthesis);
@override
- AssertStatement assertStatement(
+ AssertStatementImpl assertStatement(
Token assertKeyword,
Token leftParenthesis,
Expression condition,
@@ -78,52 +81,53 @@
semicolon);
@override
- AssignmentExpression assignmentExpression(
+ AssignmentExpressionImpl assignmentExpression(
Expression leftHandSide, Token operator, Expression rightHandSide) =>
AssignmentExpressionImpl(leftHandSide as ExpressionImpl, operator,
rightHandSide as ExpressionImpl);
@override
- AwaitExpression awaitExpression(Token awaitKeyword, Expression expression) =>
+ AwaitExpressionImpl awaitExpression(
+ Token awaitKeyword, Expression expression) =>
AwaitExpressionImpl(awaitKeyword, expression as ExpressionImpl);
@override
- BinaryExpression binaryExpression(
+ BinaryExpressionImpl binaryExpression(
Expression leftOperand, Token operator, Expression rightOperand) =>
BinaryExpressionImpl(leftOperand as ExpressionImpl, operator,
rightOperand as ExpressionImpl);
@override
- Block block(
+ BlockImpl block(
Token leftBracket, List<Statement> statements, Token rightBracket) =>
BlockImpl(leftBracket, statements, rightBracket);
@override
- Comment blockComment(List<Token> tokens) =>
+ CommentImpl blockComment(List<Token> tokens) =>
CommentImpl.createBlockComment(tokens);
@override
- BlockFunctionBody blockFunctionBody(
+ BlockFunctionBodyImpl blockFunctionBody(
Token? keyword, Token? star, Block block) =>
BlockFunctionBodyImpl(keyword, star, block as BlockImpl);
@override
- BooleanLiteral booleanLiteral(Token literal, bool value) =>
+ BooleanLiteralImpl booleanLiteral(Token literal, bool value) =>
BooleanLiteralImpl(literal, value);
@override
- BreakStatement breakStatement(
+ BreakStatementImpl breakStatement(
Token breakKeyword, SimpleIdentifier? label, Token semicolon) =>
BreakStatementImpl(
breakKeyword, label as SimpleIdentifierImpl?, semicolon);
@override
- CascadeExpression cascadeExpression(
+ CascadeExpressionImpl cascadeExpression(
Expression target, List<Expression> cascadeSections) =>
CascadeExpressionImpl(target as ExpressionImpl, cascadeSections);
@override
- CatchClause catchClause(
+ CatchClauseImpl catchClause(
Token? onKeyword,
TypeAnnotation? exceptionType,
Token? catchKeyword,
@@ -145,7 +149,7 @@
body as BlockImpl);
@override
- ClassDeclaration classDeclaration(
+ ClassDeclarationImpl classDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token? abstractKeyword,
@@ -173,7 +177,7 @@
rightBracket);
@override
- ClassTypeAlias classTypeAlias(
+ ClassTypeAliasImpl classTypeAlias(
Comment? comment,
List<Annotation>? metadata,
Token keyword,
@@ -199,11 +203,12 @@
semicolon);
@override
- CommentReference commentReference(Token? newKeyword, Identifier identifier) =>
+ CommentReferenceImpl commentReference(
+ Token? newKeyword, Identifier identifier) =>
CommentReferenceImpl(newKeyword, identifier as IdentifierImpl);
@override
- CompilationUnit compilationUnit(
+ CompilationUnitImpl compilationUnit(
{required Token beginToken,
ScriptTag? scriptTag,
List<Directive>? directives,
@@ -214,7 +219,7 @@
declarations, endToken, featureSet);
@override
- ConditionalExpression conditionalExpression(
+ ConditionalExpressionImpl conditionalExpression(
Expression condition,
Token question,
Expression thenExpression,
@@ -228,7 +233,7 @@
elseExpression as ExpressionImpl);
@override
- Configuration configuration(
+ ConfigurationImpl configuration(
Token ifKeyword,
Token leftParenthesis,
DottedName name,
@@ -246,7 +251,7 @@
libraryUri as StringLiteralImpl);
@override
- ConstructorDeclaration constructorDeclaration(
+ ConstructorDeclarationImpl constructorDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token? externalKeyword,
@@ -276,7 +281,7 @@
body as FunctionBodyImpl);
@override
- ConstructorFieldInitializer constructorFieldInitializer(
+ ConstructorFieldInitializerImpl constructorFieldInitializer(
Token? thisKeyword,
Token? period,
SimpleIdentifier fieldName,
@@ -290,19 +295,19 @@
expression as ExpressionImpl);
@override
- ConstructorName constructorName(
+ ConstructorNameImpl constructorName(
TypeName type, Token? period, SimpleIdentifier? name) =>
ConstructorNameImpl(
type as TypeNameImpl, period, name as SimpleIdentifierImpl?);
@override
- ContinueStatement continueStatement(
+ ContinueStatementImpl continueStatement(
Token continueKeyword, SimpleIdentifier? label, Token semicolon) =>
ContinueStatementImpl(
continueKeyword, label as SimpleIdentifierImpl?, semicolon);
@override
- DeclaredIdentifier declaredIdentifier(
+ DeclaredIdentifierImpl declaredIdentifier(
Comment? comment,
List<Annotation>? metadata,
Token? keyword,
@@ -312,19 +317,22 @@
type as TypeAnnotationImpl?, identifier as SimpleIdentifierImpl);
@override
- DefaultFormalParameter defaultFormalParameter(NormalFormalParameter parameter,
- ParameterKind kind, Token? separator, Expression? defaultValue) =>
+ DefaultFormalParameterImpl defaultFormalParameter(
+ NormalFormalParameter parameter,
+ ParameterKind kind,
+ Token? separator,
+ Expression? defaultValue) =>
DefaultFormalParameterImpl(parameter as NormalFormalParameterImpl, kind,
separator, defaultValue as ExpressionImpl?);
@override
- Comment documentationComment(List<Token> tokens,
+ CommentImpl documentationComment(List<Token> tokens,
[List<CommentReference>? references]) =>
CommentImpl.createDocumentationCommentWithReferences(
tokens, references ?? <CommentReference>[]);
@override
- DoStatement doStatement(
+ DoStatementImpl doStatement(
Token doKeyword,
Statement body,
Token whileKeyword,
@@ -342,33 +350,33 @@
semicolon);
@override
- DottedName dottedName(List<SimpleIdentifier> components) =>
+ DottedNameImpl dottedName(List<SimpleIdentifier> components) =>
DottedNameImpl(components);
@override
- DoubleLiteral doubleLiteral(Token literal, double value) =>
+ DoubleLiteralImpl doubleLiteral(Token literal, double value) =>
DoubleLiteralImpl(literal, value);
@override
- EmptyFunctionBody emptyFunctionBody(Token semicolon) =>
+ EmptyFunctionBodyImpl emptyFunctionBody(Token semicolon) =>
EmptyFunctionBodyImpl(semicolon);
@override
- EmptyStatement emptyStatement(Token semicolon) =>
+ EmptyStatementImpl emptyStatement(Token semicolon) =>
EmptyStatementImpl(semicolon);
@override
- Comment endOfLineComment(List<Token> tokens) =>
+ CommentImpl endOfLineComment(List<Token> tokens) =>
CommentImpl.createEndOfLineComment(tokens);
@override
- EnumConstantDeclaration enumConstantDeclaration(Comment? comment,
+ EnumConstantDeclarationImpl enumConstantDeclaration(Comment? comment,
List<Annotation>? metadata, SimpleIdentifier name) =>
EnumConstantDeclarationImpl(
comment as CommentImpl?, metadata, name as SimpleIdentifierImpl);
@override
- EnumDeclaration enumDeclaration(
+ EnumDeclarationImpl enumDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token enumKeyword,
@@ -380,7 +388,7 @@
name as SimpleIdentifierImpl, leftBracket, constants, rightBracket);
@override
- ExportDirective exportDirective(
+ ExportDirectiveImpl exportDirective(
Comment? comment,
List<Annotation>? metadata,
Token keyword,
@@ -398,22 +406,22 @@
semicolon);
@override
- ExpressionFunctionBody expressionFunctionBody(Token? keyword,
+ ExpressionFunctionBodyImpl expressionFunctionBody(Token? keyword,
Token functionDefinition, Expression expression, Token? semicolon) =>
ExpressionFunctionBodyImpl(
keyword, functionDefinition, expression as ExpressionImpl, semicolon);
@override
- ExpressionStatement expressionStatement(
+ ExpressionStatementImpl expressionStatement(
Expression expression, Token? semicolon) =>
ExpressionStatementImpl(expression as ExpressionImpl, semicolon);
@override
- ExtendsClause extendsClause(Token extendsKeyword, TypeName superclass) =>
+ ExtendsClauseImpl extendsClause(Token extendsKeyword, TypeName superclass) =>
ExtendsClauseImpl(extendsKeyword, superclass as TypeNameImpl);
@override
- ExtensionDeclaration extensionDeclaration(
+ ExtensionDeclarationImpl extensionDeclaration(
{Comment? comment,
List<Annotation>? metadata,
required Token extensionKeyword,
@@ -437,7 +445,7 @@
rightBracket);
@override
- ExtensionOverride extensionOverride(
+ ExtensionOverrideImpl extensionOverride(
{required Identifier extensionName,
TypeArgumentList? typeArguments,
required ArgumentList argumentList}) =>
@@ -447,7 +455,7 @@
argumentList as ArgumentListImpl);
@override
- FieldDeclaration fieldDeclaration2(
+ FieldDeclarationImpl fieldDeclaration2(
{Comment? comment,
List<Annotation>? metadata,
Token? abstractKeyword,
@@ -467,7 +475,7 @@
semicolon);
@override
- FieldFormalParameter fieldFormalParameter2(
+ FieldFormalParameterImpl fieldFormalParameter2(
{Comment? comment,
List<Annotation>? metadata,
Token? covariantKeyword,
@@ -495,7 +503,7 @@
question);
@override
- ForEachPartsWithDeclaration forEachPartsWithDeclaration(
+ ForEachPartsWithDeclarationImpl forEachPartsWithDeclaration(
{required DeclaredIdentifier loopVariable,
required Token inKeyword,
required Expression iterable}) =>
@@ -503,7 +511,7 @@
inKeyword, iterable as ExpressionImpl);
@override
- ForEachPartsWithIdentifier forEachPartsWithIdentifier(
+ ForEachPartsWithIdentifierImpl forEachPartsWithIdentifier(
{required SimpleIdentifier identifier,
required Token inKeyword,
required Expression iterable}) =>
@@ -511,7 +519,7 @@
inKeyword, iterable as ExpressionImpl);
@override
- ForElement forElement(
+ ForElementImpl forElement(
{Token? awaitKeyword,
required Token forKeyword,
required Token leftParenthesis,
@@ -527,7 +535,7 @@
body as CollectionElementImpl);
@override
- FormalParameterList formalParameterList(
+ FormalParameterListImpl formalParameterList(
Token leftParenthesis,
List<FormalParameter> parameters,
Token? leftDelimiter,
@@ -537,7 +545,7 @@
rightDelimiter, rightParenthesis);
@override
- ForPartsWithDeclarations forPartsWithDeclarations(
+ ForPartsWithDeclarationsImpl forPartsWithDeclarations(
{required VariableDeclarationList variables,
required Token leftSeparator,
Expression? condition,
@@ -551,7 +559,7 @@
updaters);
@override
- ForPartsWithExpression forPartsWithExpression(
+ ForPartsWithExpressionImpl forPartsWithExpression(
{Expression? initialization,
required Token leftSeparator,
Expression? condition,
@@ -565,7 +573,7 @@
updaters);
@override
- ForStatement forStatement(
+ ForStatementImpl forStatement(
{Token? awaitKeyword,
required Token forKeyword,
required Token leftParenthesis,
@@ -582,7 +590,7 @@
}
@override
- FunctionDeclaration functionDeclaration(
+ FunctionDeclarationImpl functionDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token? externalKeyword,
@@ -600,27 +608,29 @@
functionExpression as FunctionExpressionImpl);
@override
- FunctionDeclarationStatement functionDeclarationStatement(
+ FunctionDeclarationStatementImpl functionDeclarationStatement(
FunctionDeclaration functionDeclaration) =>
FunctionDeclarationStatementImpl(
functionDeclaration as FunctionDeclarationImpl);
@override
- FunctionExpression functionExpression(TypeParameterList? typeParameters,
+ FunctionExpressionImpl functionExpression(TypeParameterList? typeParameters,
FormalParameterList? parameters, FunctionBody body) =>
FunctionExpressionImpl(typeParameters as TypeParameterListImpl?,
parameters as FormalParameterListImpl?, body as FunctionBodyImpl);
@override
- FunctionExpressionInvocation functionExpressionInvocation(Expression function,
- TypeArgumentList? typeArguments, ArgumentList argumentList) =>
+ FunctionExpressionInvocationImpl functionExpressionInvocation(
+ Expression function,
+ TypeArgumentList? typeArguments,
+ ArgumentList argumentList) =>
FunctionExpressionInvocationImpl(
function as ExpressionImpl,
typeArguments as TypeArgumentListImpl?,
argumentList as ArgumentListImpl);
@override
- FunctionTypeAlias functionTypeAlias(
+ FunctionTypeAliasImpl functionTypeAlias(
Comment? comment,
List<Annotation>? metadata,
Token keyword,
@@ -640,7 +650,7 @@
semicolon);
@override
- FunctionTypedFormalParameter functionTypedFormalParameter2(
+ FunctionTypedFormalParameterImpl functionTypedFormalParameter2(
{Comment? comment,
List<Annotation>? metadata,
Token? covariantKeyword,
@@ -662,7 +672,7 @@
question);
@override
- GenericFunctionType genericFunctionType(
+ GenericFunctionTypeImpl genericFunctionType(
TypeAnnotation? returnType,
Token functionKeyword,
TypeParameterList? typeParameters,
@@ -676,7 +686,7 @@
question: question);
@override
- GenericTypeAlias genericTypeAlias(
+ GenericTypeAliasImpl genericTypeAlias(
Comment? comment,
List<Annotation>? metadata,
Token typedefKeyword,
@@ -696,12 +706,12 @@
semicolon);
@override
- HideCombinator hideCombinator(
+ HideCombinatorImpl hideCombinator(
Token keyword, List<SimpleIdentifier> hiddenNames) =>
HideCombinatorImpl(keyword, hiddenNames);
@override
- IfElement ifElement(
+ IfElementImpl ifElement(
{required Token ifKeyword,
required Token leftParenthesis,
required Expression condition,
@@ -719,7 +729,7 @@
elseElement as CollectionElementImpl?);
@override
- IfStatement ifStatement(
+ IfStatementImpl ifStatement(
Token ifKeyword,
Token leftParenthesis,
Expression condition,
@@ -737,12 +747,12 @@
elseStatement as StatementImpl?);
@override
- ImplementsClause implementsClause(
+ ImplementsClauseImpl implementsClause(
Token implementsKeyword, List<TypeName> interfaces) =>
ImplementsClauseImpl(implementsKeyword, interfaces);
@override
- ImportDirective importDirective(
+ ImportDirectiveImpl importDirective(
Comment? comment,
List<Annotation>? metadata,
Token keyword,
@@ -766,7 +776,7 @@
semicolon);
@override
- IndexExpression indexExpressionForCascade2(
+ IndexExpressionImpl indexExpressionForCascade2(
{required Token period,
Token? question,
required Token leftBracket,
@@ -776,7 +786,7 @@
period, question, leftBracket, index as ExpressionImpl, rightBracket);
@override
- IndexExpression indexExpressionForTarget2(
+ IndexExpressionImpl indexExpressionForTarget2(
{required Expression target,
Token? question,
required Token leftBracket,
@@ -786,7 +796,7 @@
leftBracket, index as ExpressionImpl, rightBracket);
@override
- InstanceCreationExpression instanceCreationExpression(Token? keyword,
+ InstanceCreationExpressionImpl instanceCreationExpression(Token? keyword,
ConstructorName constructorName, ArgumentList argumentList,
{TypeArgumentList? typeArguments}) =>
InstanceCreationExpressionImpl(
@@ -796,35 +806,36 @@
typeArguments: typeArguments as TypeArgumentListImpl?);
@override
- IntegerLiteral integerLiteral(Token literal, int? value) =>
+ IntegerLiteralImpl integerLiteral(Token literal, int? value) =>
IntegerLiteralImpl(literal, value);
@override
- InterpolationExpression interpolationExpression(
+ InterpolationExpressionImpl interpolationExpression(
Token leftBracket, Expression expression, Token? rightBracket) =>
InterpolationExpressionImpl(
leftBracket, expression as ExpressionImpl, rightBracket);
@override
- InterpolationString interpolationString(Token contents, String value) =>
+ InterpolationStringImpl interpolationString(Token contents, String value) =>
InterpolationStringImpl(contents, value);
@override
- IsExpression isExpression(Expression expression, Token isOperator,
+ IsExpressionImpl isExpression(Expression expression, Token isOperator,
Token? notOperator, TypeAnnotation type) =>
IsExpressionImpl(expression as ExpressionImpl, isOperator, notOperator,
type as TypeAnnotationImpl);
@override
- Label label(SimpleIdentifier label, Token colon) =>
+ LabelImpl label(SimpleIdentifier label, Token colon) =>
LabelImpl(label as SimpleIdentifierImpl, colon);
@override
- LabeledStatement labeledStatement(List<Label> labels, Statement statement) =>
+ LabeledStatementImpl labeledStatement(
+ List<Label> labels, Statement statement) =>
LabeledStatementImpl(labels, statement as StatementImpl);
@override
- LibraryDirective libraryDirective(
+ LibraryDirectiveImpl libraryDirective(
Comment? comment,
List<Annotation>? metadata,
Token libraryKeyword,
@@ -834,12 +845,16 @@
name as LibraryIdentifierImpl, semicolon);
@override
- LibraryIdentifier libraryIdentifier(List<SimpleIdentifier> components) =>
+ LibraryIdentifierImpl libraryIdentifier(List<SimpleIdentifier> components) =>
LibraryIdentifierImpl(components);
@override
- ListLiteral listLiteral(Token? constKeyword, TypeArgumentList? typeArguments,
- Token leftBracket, List<CollectionElement> elements, Token rightBracket) {
+ ListLiteralImpl listLiteral(
+ Token? constKeyword,
+ TypeArgumentList? typeArguments,
+ Token leftBracket,
+ List<CollectionElement> elements,
+ Token rightBracket) {
if (elements is List<Expression>) {
return ListLiteralImpl(
constKeyword,
@@ -857,13 +872,13 @@
}
@override
- MapLiteralEntry mapLiteralEntry(
+ MapLiteralEntryImpl mapLiteralEntry(
Expression key, Token separator, Expression value) =>
MapLiteralEntryImpl(
key as ExpressionImpl, separator, value as ExpressionImpl);
@override
- MethodDeclaration methodDeclaration(
+ MethodDeclarationImpl methodDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token? externalKeyword,
@@ -889,7 +904,7 @@
body as FunctionBodyImpl);
@override
- MethodInvocation methodInvocation(
+ MethodInvocationImpl methodInvocation(
Expression? target,
Token? operator,
SimpleIdentifier methodName,
@@ -903,7 +918,7 @@
argumentList as ArgumentListImpl);
@override
- MixinDeclaration mixinDeclaration(
+ MixinDeclarationImpl mixinDeclaration(
Comment? comment,
List<Annotation>? metadata,
Token mixinKeyword,
@@ -927,44 +942,45 @@
rightBracket);
@override
- NamedExpression namedExpression(Label name, Expression expression) =>
+ NamedExpressionImpl namedExpression(Label name, Expression expression) =>
NamedExpressionImpl(name as LabelImpl, expression as ExpressionImpl);
@override
- NativeClause nativeClause(Token nativeKeyword, StringLiteral? name) =>
+ NativeClauseImpl nativeClause(Token nativeKeyword, StringLiteral? name) =>
NativeClauseImpl(nativeKeyword, name as StringLiteralImpl?);
@override
- NativeFunctionBody nativeFunctionBody(
+ NativeFunctionBodyImpl nativeFunctionBody(
Token nativeKeyword, StringLiteral? stringLiteral, Token semicolon) =>
NativeFunctionBodyImpl(
nativeKeyword, stringLiteral as StringLiteralImpl?, semicolon);
@override
- NodeList<E> nodeList<E extends AstNode>(AstNode owner) =>
+ NodeListImpl<E> nodeList<E extends AstNode>(AstNode owner) =>
NodeListImpl<E>(owner as AstNodeImpl);
@override
- NullLiteral nullLiteral(Token literal) => NullLiteralImpl(literal);
+ NullLiteralImpl nullLiteral(Token literal) => NullLiteralImpl(literal);
@override
- OnClause onClause(Token onKeyword, List<TypeName> superclassConstraints) =>
+ OnClauseImpl onClause(
+ Token onKeyword, List<TypeName> superclassConstraints) =>
OnClauseImpl(onKeyword, superclassConstraints);
@override
- ParenthesizedExpression parenthesizedExpression(Token leftParenthesis,
+ ParenthesizedExpressionImpl parenthesizedExpression(Token leftParenthesis,
Expression expression, Token rightParenthesis) =>
ParenthesizedExpressionImpl(
leftParenthesis, expression as ExpressionImpl, rightParenthesis);
@override
- PartDirective partDirective(Comment? comment, List<Annotation>? metadata,
+ PartDirectiveImpl partDirective(Comment? comment, List<Annotation>? metadata,
Token partKeyword, StringLiteral partUri, Token semicolon) =>
PartDirectiveImpl(comment as CommentImpl?, metadata, partKeyword,
partUri as StringLiteralImpl, semicolon);
@override
- PartOfDirective partOfDirective(
+ PartOfDirectiveImpl partOfDirective(
Comment? comment,
List<Annotation>? metadata,
Token partKeyword,
@@ -982,27 +998,27 @@
semicolon);
@override
- PostfixExpression postfixExpression(Expression operand, Token operator) =>
+ PostfixExpressionImpl postfixExpression(Expression operand, Token operator) =>
PostfixExpressionImpl(operand as ExpressionImpl, operator);
@override
- PrefixedIdentifier prefixedIdentifier(
+ PrefixedIdentifierImpl prefixedIdentifier(
SimpleIdentifier prefix, Token period, SimpleIdentifier identifier) =>
PrefixedIdentifierImpl(prefix as SimpleIdentifierImpl, period,
identifier as SimpleIdentifierImpl);
@override
- PrefixExpression prefixExpression(Token operator, Expression operand) =>
+ PrefixExpressionImpl prefixExpression(Token operator, Expression operand) =>
PrefixExpressionImpl(operator, operand as ExpressionImpl);
@override
- PropertyAccess propertyAccess(
+ PropertyAccessImpl propertyAccess(
Expression? target, Token operator, SimpleIdentifier propertyName) =>
PropertyAccessImpl(target as ExpressionImpl?, operator,
propertyName as SimpleIdentifierImpl);
@override
- RedirectingConstructorInvocation redirectingConstructorInvocation(
+ RedirectingConstructorInvocationImpl redirectingConstructorInvocation(
Token thisKeyword,
Token? period,
SimpleIdentifier? constructorName,
@@ -1014,20 +1030,20 @@
argumentList as ArgumentListImpl);
@override
- RethrowExpression rethrowExpression(Token rethrowKeyword) =>
+ RethrowExpressionImpl rethrowExpression(Token rethrowKeyword) =>
RethrowExpressionImpl(rethrowKeyword);
@override
- ReturnStatement returnStatement(
+ ReturnStatementImpl returnStatement(
Token returnKeyword, Expression? expression, Token semicolon) =>
ReturnStatementImpl(
returnKeyword, expression as ExpressionImpl?, semicolon);
@override
- ScriptTag scriptTag(Token scriptTag) => ScriptTagImpl(scriptTag);
+ ScriptTagImpl scriptTag(Token scriptTag) => ScriptTagImpl(scriptTag);
@override
- SetOrMapLiteral setOrMapLiteral(
+ SetOrMapLiteralImpl setOrMapLiteral(
{Token? constKeyword,
TypeArgumentList? typeArguments,
required Token leftBracket,
@@ -1037,12 +1053,12 @@
leftBracket, elements, rightBracket);
@override
- ShowCombinator showCombinator(
+ ShowCombinatorImpl showCombinator(
Token keyword, List<SimpleIdentifier> shownNames) =>
ShowCombinatorImpl(keyword, shownNames);
@override
- SimpleFormalParameter simpleFormalParameter2(
+ SimpleFormalParameterImpl simpleFormalParameter2(
{Comment? comment,
List<Annotation>? metadata,
Token? covariantKeyword,
@@ -1060,7 +1076,8 @@
identifier as SimpleIdentifierImpl?);
@override
- SimpleIdentifier simpleIdentifier(Token token, {bool isDeclaration = false}) {
+ SimpleIdentifierImpl simpleIdentifier(Token token,
+ {bool isDeclaration = false}) {
if (isDeclaration) {
return DeclaredSimpleIdentifier(token);
}
@@ -1068,21 +1085,21 @@
}
@override
- SimpleStringLiteral simpleStringLiteral(Token literal, String value) =>
+ SimpleStringLiteralImpl simpleStringLiteral(Token literal, String value) =>
SimpleStringLiteralImpl(literal, value);
@override
- SpreadElement spreadElement(
+ SpreadElementImpl spreadElement(
{required Token spreadOperator, required Expression expression}) =>
SpreadElementImpl(spreadOperator, expression as ExpressionImpl);
@override
- StringInterpolation stringInterpolation(
+ StringInterpolationImpl stringInterpolation(
List<InterpolationElement> elements) =>
StringInterpolationImpl(elements);
@override
- SuperConstructorInvocation superConstructorInvocation(
+ SuperConstructorInvocationImpl superConstructorInvocation(
Token superKeyword,
Token? period,
SimpleIdentifier? constructorName,
@@ -1094,22 +1111,22 @@
argumentList as ArgumentListImpl);
@override
- SuperExpression superExpression(Token superKeyword) =>
+ SuperExpressionImpl superExpression(Token superKeyword) =>
SuperExpressionImpl(superKeyword);
@override
- SwitchCase switchCase(List<Label> labels, Token keyword,
+ SwitchCaseImpl switchCase(List<Label> labels, Token keyword,
Expression expression, Token colon, List<Statement> statements) =>
SwitchCaseImpl(
labels, keyword, expression as ExpressionImpl, colon, statements);
@override
- SwitchDefault switchDefault(List<Label> labels, Token keyword, Token colon,
- List<Statement> statements) =>
+ SwitchDefaultImpl switchDefault(List<Label> labels, Token keyword,
+ Token colon, List<Statement> statements) =>
SwitchDefaultImpl(labels, keyword, colon, statements);
@override
- SwitchStatement switchStatement(
+ SwitchStatementImpl switchStatement(
Token switchKeyword,
Token leftParenthesis,
Expression expression,
@@ -1127,19 +1144,20 @@
rightBracket);
@override
- SymbolLiteral symbolLiteral(Token poundSign, List<Token> components) =>
+ SymbolLiteralImpl symbolLiteral(Token poundSign, List<Token> components) =>
SymbolLiteralImpl(poundSign, components);
@override
- ThisExpression thisExpression(Token thisKeyword) =>
+ ThisExpressionImpl thisExpression(Token thisKeyword) =>
ThisExpressionImpl(thisKeyword);
@override
- ThrowExpression throwExpression(Token throwKeyword, Expression expression) =>
+ ThrowExpressionImpl throwExpression(
+ Token throwKeyword, Expression expression) =>
ThrowExpressionImpl(throwKeyword, expression as ExpressionImpl);
@override
- TopLevelVariableDeclaration topLevelVariableDeclaration(
+ TopLevelVariableDeclarationImpl topLevelVariableDeclaration(
Comment? comment,
List<Annotation>? metadata,
VariableDeclarationList variableList,
@@ -1153,7 +1171,7 @@
semicolon);
@override
- TryStatement tryStatement(
+ TryStatementImpl tryStatement(
Token tryKeyword,
Block body,
List<CatchClause> catchClauses,
@@ -1163,19 +1181,19 @@
finallyKeyword, finallyBlock as BlockImpl?);
@override
- TypeArgumentList typeArgumentList(Token leftBracket,
+ TypeArgumentListImpl typeArgumentList(Token leftBracket,
List<TypeAnnotation> arguments, Token rightBracket) =>
TypeArgumentListImpl(leftBracket, arguments, rightBracket);
@override
- TypeName typeName(Identifier name, TypeArgumentList? typeArguments,
+ TypeNameImpl typeName(Identifier name, TypeArgumentList? typeArguments,
{Token? question}) =>
TypeNameImpl(
name as IdentifierImpl, typeArguments as TypeArgumentListImpl?,
question: question);
@override
- TypeParameter typeParameter(
+ TypeParameterImpl typeParameter(
Comment? comment,
List<Annotation>? metadata,
SimpleIdentifier name,
@@ -1188,7 +1206,7 @@
extendsKeyword,
bound as TypeAnnotationImpl?);
- TypeParameter typeParameter2(
+ TypeParameterImpl typeParameter2(
{Comment? comment,
List<Annotation>? metadata,
required SimpleIdentifier name,
@@ -1204,18 +1222,18 @@
..varianceKeyword = varianceKeyword;
@override
- TypeParameterList typeParameterList(Token leftBracket,
+ TypeParameterListImpl typeParameterList(Token leftBracket,
List<TypeParameter> typeParameters, Token rightBracket) =>
TypeParameterListImpl(leftBracket, typeParameters, rightBracket);
@override
- VariableDeclaration variableDeclaration(
+ VariableDeclarationImpl variableDeclaration(
SimpleIdentifier name, Token? equals, Expression? initializer) =>
VariableDeclarationImpl(
name as SimpleIdentifierImpl, equals, initializer as ExpressionImpl?);
@override
- VariableDeclarationList variableDeclarationList(
+ VariableDeclarationListImpl variableDeclarationList(
Comment? comment,
List<Annotation>? metadata,
Token? keyword,
@@ -1225,7 +1243,7 @@
keyword, type as TypeAnnotationImpl?, variables);
@override
- VariableDeclarationList variableDeclarationList2(
+ VariableDeclarationListImpl variableDeclarationList2(
{Comment? comment,
List<Annotation>? metadata,
Token? lateKeyword,
@@ -1237,23 +1255,23 @@
}
@override
- VariableDeclarationStatement variableDeclarationStatement(
+ VariableDeclarationStatementImpl variableDeclarationStatement(
VariableDeclarationList variableList, Token semicolon) =>
VariableDeclarationStatementImpl(
variableList as VariableDeclarationListImpl, semicolon);
@override
- WhileStatement whileStatement(Token whileKeyword, Token leftParenthesis,
+ WhileStatementImpl whileStatement(Token whileKeyword, Token leftParenthesis,
Expression condition, Token rightParenthesis, Statement body) =>
WhileStatementImpl(whileKeyword, leftParenthesis,
condition as ExpressionImpl, rightParenthesis, body as StatementImpl);
@override
- WithClause withClause(Token withKeyword, List<TypeName> mixinTypes) =>
+ WithClauseImpl withClause(Token withKeyword, List<TypeName> mixinTypes) =>
WithClauseImpl(withKeyword, mixinTypes);
@override
- YieldStatement yieldStatement(Token yieldKeyword, Token? star,
+ YieldStatementImpl yieldStatement(Token yieldKeyword, Token? star,
Expression expression, Token semicolon) =>
YieldStatementImpl(
yieldKeyword, star, expression as ExpressionImpl, semicolon);
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index abae5f8..33092e5 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -5,7 +5,6 @@
import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/exception/exception.dart';
@@ -112,7 +111,7 @@
astFactory.adjacentStrings(cloneNodeList(node.strings));
@override
- Annotation visitAnnotation(Annotation node) => astFactory.annotation(
+ AnnotationImpl visitAnnotation(Annotation node) => astFactory.annotation(
atSign: cloneToken(node.atSign),
name: cloneNode(node.name),
typeArguments: cloneNullableNode(node.typeArguments),
@@ -205,7 +204,7 @@
@override
ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
- ClassDeclaration copy = astFactory.classDeclaration(
+ var copy = astFactory.classDeclaration(
cloneNullableNode(node.documentationComment),
cloneNodeList(node.metadata),
cloneNullableToken(node.abstractKeyword),
@@ -274,7 +273,7 @@
@override
CompilationUnit visitCompilationUnit(CompilationUnit node) {
- CompilationUnit clone = astFactory.compilationUnit(
+ var clone = astFactory.compilationUnit(
beginToken: cloneToken(node.beginToken),
scriptTag: cloneNullableNode(node.scriptTag),
directives: cloneNodeList(node.directives),
@@ -335,7 +334,7 @@
cloneNode(node.expression));
@override
- ConstructorName visitConstructorName(ConstructorName node) =>
+ ConstructorNameImpl visitConstructorName(ConstructorName node) =>
astFactory.constructorName(cloneNode(node.type),
cloneNullableToken(node.period), cloneNullableNode(node.name));
@@ -415,7 +414,7 @@
cloneNode(node.uri),
cloneNodeList(node.configurations),
cloneNodeList(node.combinators),
- cloneToken(node.semicolon)) as ExportDirectiveImpl;
+ cloneToken(node.semicolon));
directive.selectedUriContent = node.selectedUriContent;
directive.selectedSource = node.selectedSource;
directive.uriSource = node.uriSource;
@@ -669,7 +668,7 @@
cloneNullableToken(node.asKeyword),
cloneNullableNode(node.prefix),
cloneNodeList(node.combinators),
- cloneToken(node.semicolon)) as ImportDirectiveImpl;
+ cloneToken(node.semicolon));
directive.selectedUriContent = node.selectedUriContent;
directive.selectedSource = node.selectedSource;
directive.uriSource = node.uriSource;
@@ -696,17 +695,17 @@
}
@override
- InstanceCreationExpression visitInstanceCreationExpression(
+ InstanceCreationExpressionImpl visitInstanceCreationExpression(
InstanceCreationExpression node) =>
astFactory.instanceCreationExpression(cloneNullableToken(node.keyword),
cloneNode(node.constructorName), cloneNode(node.argumentList));
@override
- IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
+ IntegerLiteralImpl visitIntegerLiteral(IntegerLiteral node) =>
astFactory.integerLiteral(cloneToken(node.literal), node.value);
@override
- InterpolationExpression visitInterpolationExpression(
+ InterpolationExpressionImpl visitInterpolationExpression(
InterpolationExpression node) =>
astFactory.interpolationExpression(cloneToken(node.leftBracket),
cloneNode(node.expression), cloneNullableToken(node.rightBracket));
@@ -744,7 +743,7 @@
astFactory.libraryIdentifier(cloneNodeList(node.components));
@override
- ListLiteral visitListLiteral(ListLiteral node) => astFactory.listLiteral(
+ ListLiteralImpl visitListLiteral(ListLiteral node) => astFactory.listLiteral(
cloneNullableToken(node.constKeyword),
cloneNullableNode(node.typeArguments),
cloneToken(node.leftBracket),
@@ -823,7 +822,7 @@
@override
PartDirective visitPartDirective(PartDirective node) {
- PartDirective directive = astFactory.partDirective(
+ var directive = astFactory.partDirective(
cloneNullableNode(node.documentationComment),
cloneNodeList(node.metadata),
cloneToken(node.partKeyword),
@@ -864,7 +863,7 @@
cloneToken(node.operator), cloneNode(node.propertyName));
@override
- RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
+ RedirectingConstructorInvocationImpl visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) =>
astFactory.redirectingConstructorInvocation(
cloneToken(node.thisKeyword),
@@ -886,7 +885,7 @@
astFactory.scriptTag(cloneToken(node.scriptTag));
@override
- SetOrMapLiteral visitSetOrMapLiteral(SetOrMapLiteral node) {
+ SetOrMapLiteralImpl visitSetOrMapLiteral(SetOrMapLiteral node) {
var result = astFactory.setOrMapLiteral(
constKeyword: cloneNullableToken(node.constKeyword),
typeArguments: cloneNullableNode(node.typeArguments),
@@ -894,9 +893,9 @@
elements: cloneNodeList(node.elements),
rightBracket: cloneToken(node.rightBracket));
if (node.isMap) {
- (result as SetOrMapLiteralImpl).becomeMap();
+ result.becomeMap();
} else if (node.isSet) {
- (result as SetOrMapLiteralImpl).becomeSet();
+ result.becomeSet();
}
return result;
}
@@ -936,7 +935,7 @@
astFactory.stringInterpolation(cloneNodeList(node.elements));
@override
- SuperConstructorInvocation visitSuperConstructorInvocation(
+ SuperConstructorInvocationImpl visitSuperConstructorInvocation(
SuperConstructorInvocation node) =>
astFactory.superConstructorInvocation(
cloneToken(node.superKeyword),
@@ -1013,7 +1012,7 @@
cloneNodeList(node.arguments), cloneToken(node.rightBracket));
@override
- TypeName visitTypeName(TypeName node) => astFactory.typeName(
+ TypeNameImpl visitTypeName(TypeName node) => astFactory.typeName(
cloneNode(node.name), cloneNullableNode(node.typeArguments),
question: cloneNullableToken(node.question));
@@ -1021,7 +1020,7 @@
TypeParameter visitTypeParameter(TypeParameter node) =>
// TODO (kallentu) : Clean up TypeParameterImpl and AstFactoryImpl casting
// once variance is added to the interface.
- (astFactory as AstFactoryImpl).typeParameter2(
+ astFactory.typeParameter2(
comment: cloneNullableNode(node.documentationComment),
metadata: cloneNodeList(node.metadata),
name: cloneNode(node.name),
@@ -2637,14 +2636,14 @@
NodeReplacer(this._oldNode, this._newNode);
@override
- bool visitAdjacentStrings(AdjacentStrings node) {
+ bool visitAdjacentStrings(covariant AdjacentStringsImpl node) {
if (_replaceInList(node.strings)) {
return true;
}
return visitNode(node);
}
- bool visitAnnotatedNode(AnnotatedNode node) {
+ bool visitAnnotatedNode(covariant AnnotatedNodeImpl node) {
if (identical(node.documentationComment, _oldNode)) {
node.documentationComment = _newNode as Comment;
return true;
@@ -2655,12 +2654,12 @@
}
@override
- bool visitAnnotation(Annotation node) {
+ bool visitAnnotation(covariant AnnotationImpl node) {
if (identical(node.arguments, _oldNode)) {
node.arguments = _newNode as ArgumentList;
return true;
} else if (identical(node.typeArguments, _oldNode)) {
- (node as AnnotationImpl).typeArguments = _newNode as TypeArgumentList?;
+ node.typeArguments = _newNode as TypeArgumentList?;
return true;
} else if (identical(node.constructorName, _oldNode)) {
node.constructorName = _newNode as SimpleIdentifier;
@@ -2673,7 +2672,7 @@
}
@override
- bool visitArgumentList(ArgumentList node) {
+ bool visitArgumentList(covariant ArgumentListImpl node) {
if (_replaceInList(node.arguments)) {
return true;
}
@@ -2681,7 +2680,7 @@
}
@override
- bool visitAsExpression(AsExpression node) {
+ bool visitAsExpression(covariant AsExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -2693,7 +2692,7 @@
}
@override
- bool visitAssertInitializer(AssertInitializer node) {
+ bool visitAssertInitializer(covariant AssertInitializerImpl node) {
if (identical(node.condition, _oldNode)) {
node.condition = _newNode as Expression;
return true;
@@ -2706,7 +2705,7 @@
}
@override
- bool visitAssertStatement(AssertStatement node) {
+ bool visitAssertStatement(covariant AssertStatementImpl node) {
if (identical(node.condition, _oldNode)) {
node.condition = _newNode as Expression;
return true;
@@ -2719,7 +2718,7 @@
}
@override
- bool visitAssignmentExpression(AssignmentExpression node) {
+ bool visitAssignmentExpression(covariant AssignmentExpressionImpl node) {
if (identical(node.leftHandSide, _oldNode)) {
node.leftHandSide = _newNode as Expression;
return true;
@@ -2731,7 +2730,7 @@
}
@override
- bool visitAwaitExpression(AwaitExpression node) {
+ bool visitAwaitExpression(covariant AwaitExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -2740,7 +2739,7 @@
}
@override
- bool visitBinaryExpression(BinaryExpression node) {
+ bool visitBinaryExpression(covariant BinaryExpressionImpl node) {
if (identical(node.leftOperand, _oldNode)) {
node.leftOperand = _newNode as Expression;
return true;
@@ -2752,7 +2751,7 @@
}
@override
- bool visitBlock(Block node) {
+ bool visitBlock(covariant BlockImpl node) {
if (_replaceInList(node.statements)) {
return true;
}
@@ -2760,7 +2759,7 @@
}
@override
- bool visitBlockFunctionBody(BlockFunctionBody node) {
+ bool visitBlockFunctionBody(covariant BlockFunctionBodyImpl node) {
if (identical(node.block, _oldNode)) {
node.block = _newNode as Block;
return true;
@@ -2772,7 +2771,7 @@
bool visitBooleanLiteral(BooleanLiteral node) => visitNode(node);
@override
- bool visitBreakStatement(BreakStatement node) {
+ bool visitBreakStatement(covariant BreakStatementImpl node) {
if (identical(node.label, _oldNode)) {
node.label = _newNode as SimpleIdentifier;
return true;
@@ -2781,7 +2780,7 @@
}
@override
- bool visitCascadeExpression(CascadeExpression node) {
+ bool visitCascadeExpression(covariant CascadeExpressionImpl node) {
if (identical(node.target, _oldNode)) {
node.target = _newNode as Expression;
return true;
@@ -2792,7 +2791,7 @@
}
@override
- bool visitCatchClause(CatchClause node) {
+ bool visitCatchClause(covariant CatchClauseImpl node) {
if (identical(node.exceptionType, _oldNode)) {
node.exceptionType = _newNode as TypeAnnotation;
return true;
@@ -2807,7 +2806,7 @@
}
@override
- bool visitClassDeclaration(ClassDeclaration node) {
+ bool visitClassDeclaration(covariant ClassDeclarationImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -2833,7 +2832,7 @@
}
@override
- bool visitClassTypeAlias(ClassTypeAlias node) {
+ bool visitClassTypeAlias(covariant ClassTypeAliasImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -2854,7 +2853,7 @@
}
@override
- bool visitComment(Comment node) {
+ bool visitComment(covariant CommentImpl node) {
if (_replaceInList(node.references)) {
return true;
}
@@ -2862,7 +2861,7 @@
}
@override
- bool visitCommentReference(CommentReference node) {
+ bool visitCommentReference(covariant CommentReferenceImpl node) {
if (identical(node.identifier, _oldNode)) {
node.identifier = _newNode as Identifier;
return true;
@@ -2871,7 +2870,7 @@
}
@override
- bool visitCompilationUnit(CompilationUnit node) {
+ bool visitCompilationUnit(covariant CompilationUnitImpl node) {
if (identical(node.scriptTag, _oldNode)) {
node.scriptTag = _newNode as ScriptTag;
return true;
@@ -2884,7 +2883,7 @@
}
@override
- bool visitConditionalExpression(ConditionalExpression node) {
+ bool visitConditionalExpression(covariant ConditionalExpressionImpl node) {
if (identical(node.condition, _oldNode)) {
node.condition = _newNode as Expression;
return true;
@@ -2899,7 +2898,7 @@
}
@override
- bool visitConfiguration(Configuration node) {
+ bool visitConfiguration(covariant ConfigurationImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as DottedName;
return true;
@@ -2914,7 +2913,7 @@
}
@override
- bool visitConstructorDeclaration(ConstructorDeclaration node) {
+ bool visitConstructorDeclaration(covariant ConstructorDeclarationImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as Identifier;
return true;
@@ -2937,7 +2936,8 @@
}
@override
- bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+ bool visitConstructorFieldInitializer(
+ covariant ConstructorFieldInitializerImpl node) {
if (identical(node.fieldName, _oldNode)) {
node.fieldName = _newNode as SimpleIdentifier;
return true;
@@ -2949,7 +2949,7 @@
}
@override
- bool visitConstructorName(ConstructorName node) {
+ bool visitConstructorName(covariant ConstructorNameImpl node) {
if (identical(node.type, _oldNode)) {
node.type = _newNode as TypeName;
return true;
@@ -2961,7 +2961,7 @@
}
@override
- bool visitContinueStatement(ContinueStatement node) {
+ bool visitContinueStatement(covariant ContinueStatementImpl node) {
if (identical(node.label, _oldNode)) {
node.label = _newNode as SimpleIdentifier;
return true;
@@ -2970,7 +2970,7 @@
}
@override
- bool visitDeclaredIdentifier(DeclaredIdentifier node) {
+ bool visitDeclaredIdentifier(covariant DeclaredIdentifierImpl node) {
if (identical(node.type, _oldNode)) {
node.type = _newNode as TypeAnnotation;
return true;
@@ -2982,7 +2982,7 @@
}
@override
- bool visitDefaultFormalParameter(DefaultFormalParameter node) {
+ bool visitDefaultFormalParameter(covariant DefaultFormalParameterImpl node) {
if (identical(node.parameter, _oldNode)) {
node.parameter = _newNode as NormalFormalParameter;
return true;
@@ -2994,7 +2994,7 @@
}
@override
- bool visitDoStatement(DoStatement node) {
+ bool visitDoStatement(covariant DoStatementImpl node) {
if (identical(node.body, _oldNode)) {
node.body = _newNode as Statement;
return true;
@@ -3006,7 +3006,7 @@
}
@override
- bool visitDottedName(DottedName node) {
+ bool visitDottedName(covariant DottedNameImpl node) {
if (_replaceInList(node.components)) {
return true;
}
@@ -3023,7 +3023,8 @@
bool visitEmptyStatement(EmptyStatement node) => visitNode(node);
@override
- bool visitEnumConstantDeclaration(EnumConstantDeclaration node) {
+ bool visitEnumConstantDeclaration(
+ covariant EnumConstantDeclarationImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -3032,7 +3033,7 @@
}
@override
- bool visitEnumDeclaration(EnumDeclaration node) {
+ bool visitEnumDeclaration(covariant EnumDeclarationImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -3043,11 +3044,11 @@
}
@override
- bool visitExportDirective(ExportDirective node) =>
+ bool visitExportDirective(covariant ExportDirectiveImpl node) =>
visitNamespaceDirective(node);
@override
- bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
+ bool visitExpressionFunctionBody(covariant ExpressionFunctionBodyImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3056,7 +3057,7 @@
}
@override
- bool visitExpressionStatement(ExpressionStatement node) {
+ bool visitExpressionStatement(covariant ExpressionStatementImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3065,7 +3066,7 @@
}
@override
- bool visitExtendsClause(ExtendsClause node) {
+ bool visitExtendsClause(covariant ExtendsClauseImpl node) {
if (identical(node.superclass, _oldNode)) {
node.superclass = _newNode as TypeName;
return true;
@@ -3074,22 +3075,20 @@
}
@override
- bool visitExtensionDeclaration(ExtensionDeclaration node) {
+ bool visitExtensionDeclaration(covariant ExtensionDeclarationImpl node) {
if (identical(node.documentationComment, _oldNode)) {
node.documentationComment = _newNode as Comment;
return true;
} else if (_replaceInList(node.metadata)) {
return true;
} else if (identical(node.name, _oldNode)) {
- (node as ExtensionDeclarationImpl).name = _newNode as SimpleIdentifier;
+ node.name = _newNode as SimpleIdentifier;
return true;
} else if (identical(node.typeParameters, _oldNode)) {
- (node as ExtensionDeclarationImpl).typeParameters =
- _newNode as TypeParameterList;
+ node.typeParameters = _newNode as TypeParameterList;
return true;
} else if (identical(node.extendedType, _oldNode)) {
- (node as ExtensionDeclarationImpl).extendedType =
- _newNode as TypeAnnotation;
+ node.extendedType = _newNode as TypeAnnotation;
return true;
} else if (_replaceInList(node.members)) {
return true;
@@ -3114,7 +3113,7 @@
}
@override
- bool visitFieldDeclaration(FieldDeclaration node) {
+ bool visitFieldDeclaration(covariant FieldDeclarationImpl node) {
if (identical(node.fields, _oldNode)) {
node.fields = _newNode as VariableDeclarationList;
return true;
@@ -3123,7 +3122,7 @@
}
@override
- bool visitFieldFormalParameter(FieldFormalParameter node) {
+ bool visitFieldFormalParameter(covariant FieldFormalParameterImpl node) {
if (identical(node.type, _oldNode)) {
node.type = _newNode as TypeAnnotation;
return true;
@@ -3175,7 +3174,7 @@
}
@override
- bool visitFormalParameterList(FormalParameterList node) {
+ bool visitFormalParameterList(covariant FormalParameterListImpl node) {
if (_replaceInList(node.parameters)) {
return true;
}
@@ -3183,13 +3182,13 @@
}
@override
- bool visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
+ bool visitForPartsWithDeclarations(
+ covariant ForPartsWithDeclarationsImpl node) {
if (identical(node.variables, _oldNode)) {
- (node as ForPartsWithDeclarationsImpl).variables =
- _newNode as VariableDeclarationList;
+ node.variables = _newNode as VariableDeclarationList;
return true;
} else if (identical(node.condition, _oldNode)) {
- (node as ForPartsWithDeclarationsImpl).condition = _newNode as Expression;
+ node.condition = _newNode as Expression;
return true;
} else if (_replaceInList(node.updaters)) {
return true;
@@ -3198,13 +3197,12 @@
}
@override
- bool visitForPartsWithExpression(ForPartsWithExpression node) {
+ bool visitForPartsWithExpression(covariant ForPartsWithExpressionImpl node) {
if (identical(node.initialization, _oldNode)) {
- (node as ForPartsWithExpressionImpl).initialization =
- _newNode as Expression;
+ node.initialization = _newNode as Expression;
return true;
} else if (identical(node.condition, _oldNode)) {
- (node as ForPartsWithExpressionImpl).condition = _newNode as Expression;
+ node.condition = _newNode as Expression;
return true;
} else if (_replaceInList(node.updaters)) {
return true;
@@ -3225,7 +3223,7 @@
}
@override
- bool visitFunctionDeclaration(FunctionDeclaration node) {
+ bool visitFunctionDeclaration(covariant FunctionDeclarationImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as TypeAnnotation;
return true;
@@ -3240,7 +3238,8 @@
}
@override
- bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
+ bool visitFunctionDeclarationStatement(
+ covariant FunctionDeclarationStatementImpl node) {
if (identical(node.functionDeclaration, _oldNode)) {
node.functionDeclaration = _newNode as FunctionDeclaration;
return true;
@@ -3249,7 +3248,7 @@
}
@override
- bool visitFunctionExpression(FunctionExpression node) {
+ bool visitFunctionExpression(covariant FunctionExpressionImpl node) {
if (identical(node.parameters, _oldNode)) {
node.parameters = _newNode as FormalParameterList;
return true;
@@ -3261,7 +3260,8 @@
}
@override
- bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+ bool visitFunctionExpressionInvocation(
+ covariant FunctionExpressionInvocationImpl node) {
if (identical(node.function, _oldNode)) {
node.function = _newNode as Expression;
return true;
@@ -3273,7 +3273,7 @@
}
@override
- bool visitFunctionTypeAlias(FunctionTypeAlias node) {
+ bool visitFunctionTypeAlias(covariant FunctionTypeAliasImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as TypeAnnotation;
return true;
@@ -3291,7 +3291,8 @@
}
@override
- bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+ bool visitFunctionTypedFormalParameter(
+ covariant FunctionTypedFormalParameterImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as TypeAnnotation;
return true;
@@ -3303,7 +3304,7 @@
}
@override
- bool? visitGenericFunctionType(GenericFunctionType node) {
+ bool? visitGenericFunctionType(covariant GenericFunctionTypeImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as TypeAnnotation;
return true;
@@ -3336,7 +3337,7 @@
}
@override
- bool visitHideCombinator(HideCombinator node) {
+ bool visitHideCombinator(covariant HideCombinatorImpl node) {
if (_replaceInList(node.hiddenNames)) {
return true;
}
@@ -3359,7 +3360,7 @@
}
@override
- bool visitIfStatement(IfStatement node) {
+ bool visitIfStatement(covariant IfStatementImpl node) {
if (identical(node.condition, _oldNode)) {
node.condition = _newNode as Expression;
return true;
@@ -3374,7 +3375,7 @@
}
@override
- bool visitImplementsClause(ImplementsClause node) {
+ bool visitImplementsClause(covariant ImplementsClauseImpl node) {
if (_replaceInList(node.interfaces)) {
return true;
}
@@ -3382,7 +3383,7 @@
}
@override
- bool visitImportDirective(ImportDirective node) {
+ bool visitImportDirective(covariant ImportDirectiveImpl node) {
if (identical(node.prefix, _oldNode)) {
node.prefix = _newNode as SimpleIdentifier;
return true;
@@ -3391,7 +3392,7 @@
}
@override
- bool visitIndexExpression(IndexExpression node) {
+ bool visitIndexExpression(covariant IndexExpressionImpl node) {
if (identical(node.target, _oldNode)) {
node.target = _newNode as Expression;
return true;
@@ -3403,7 +3404,8 @@
}
@override
- bool visitInstanceCreationExpression(InstanceCreationExpression node) {
+ bool visitInstanceCreationExpression(
+ covariant InstanceCreationExpressionImpl node) {
if (identical(node.constructorName, _oldNode)) {
node.constructorName = _newNode as ConstructorName;
return true;
@@ -3418,7 +3420,8 @@
bool visitIntegerLiteral(IntegerLiteral node) => visitNode(node);
@override
- bool visitInterpolationExpression(InterpolationExpression node) {
+ bool visitInterpolationExpression(
+ covariant InterpolationExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3430,7 +3433,7 @@
bool visitInterpolationString(InterpolationString node) => visitNode(node);
@override
- bool visitIsExpression(IsExpression node) {
+ bool visitIsExpression(covariant IsExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3442,7 +3445,7 @@
}
@override
- bool visitLabel(Label node) {
+ bool visitLabel(covariant LabelImpl node) {
if (identical(node.label, _oldNode)) {
node.label = _newNode as SimpleIdentifier;
return true;
@@ -3451,7 +3454,7 @@
}
@override
- bool visitLabeledStatement(LabeledStatement node) {
+ bool visitLabeledStatement(covariant LabeledStatementImpl node) {
if (identical(node.statement, _oldNode)) {
node.statement = _newNode as Statement;
return true;
@@ -3462,7 +3465,7 @@
}
@override
- bool visitLibraryDirective(LibraryDirective node) {
+ bool visitLibraryDirective(covariant LibraryDirectiveImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as LibraryIdentifier;
return true;
@@ -3471,7 +3474,7 @@
}
@override
- bool visitLibraryIdentifier(LibraryIdentifier node) {
+ bool visitLibraryIdentifier(covariant LibraryIdentifierImpl node) {
if (_replaceInList(node.components)) {
return true;
}
@@ -3479,7 +3482,7 @@
}
@override
- bool visitListLiteral(ListLiteral node) {
+ bool visitListLiteral(covariant ListLiteralImpl node) {
if (_replaceInList(node.elements)) {
return true;
}
@@ -3487,7 +3490,7 @@
}
@override
- bool visitMapLiteralEntry(MapLiteralEntry node) {
+ bool visitMapLiteralEntry(covariant MapLiteralEntryImpl node) {
if (identical(node.key, _oldNode)) {
node.key = _newNode as Expression;
return true;
@@ -3499,7 +3502,7 @@
}
@override
- bool visitMethodDeclaration(MethodDeclaration node) {
+ bool visitMethodDeclaration(covariant MethodDeclarationImpl node) {
if (identical(node.returnType, _oldNode)) {
node.returnType = _newNode as TypeAnnotation;
return true;
@@ -3517,7 +3520,7 @@
}
@override
- bool visitMethodInvocation(MethodInvocation node) {
+ bool visitMethodInvocation(covariant MethodInvocationImpl node) {
if (identical(node.target, _oldNode)) {
node.target = _newNode as Expression;
return true;
@@ -3532,7 +3535,7 @@
}
@override
- bool visitMixinDeclaration(MixinDeclaration node) {
+ bool visitMixinDeclaration(covariant MixinDeclarationImpl node) {
if (identical(node.documentationComment, _oldNode)) {
node.documentationComment = _newNode as Comment;
return true;
@@ -3542,15 +3545,13 @@
node.name = _newNode as SimpleIdentifier;
return true;
} else if (identical(node.typeParameters, _oldNode)) {
- (node as MixinDeclarationImpl).typeParameters =
- _newNode as TypeParameterList;
+ node.typeParameters = _newNode as TypeParameterList;
return true;
} else if (identical(node.onClause, _oldNode)) {
- (node as MixinDeclarationImpl).onClause = _newNode as OnClause;
+ node.onClause = _newNode as OnClause;
return true;
} else if (identical(node.implementsClause, _oldNode)) {
- (node as MixinDeclarationImpl).implementsClause =
- _newNode as ImplementsClause;
+ node.implementsClause = _newNode as ImplementsClause;
return true;
} else if (_replaceInList(node.members)) {
return true;
@@ -3559,7 +3560,7 @@
}
@override
- bool visitNamedExpression(NamedExpression node) {
+ bool visitNamedExpression(covariant NamedExpressionImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as Label;
return true;
@@ -3570,7 +3571,7 @@
return visitNode(node);
}
- bool visitNamespaceDirective(NamespaceDirective node) {
+ bool visitNamespaceDirective(covariant NamespaceDirectiveImpl node) {
if (_replaceInList(node.combinators)) {
return true;
}
@@ -3578,7 +3579,7 @@
}
@override
- bool visitNativeClause(NativeClause node) {
+ bool visitNativeClause(covariant NativeClauseImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as StringLiteral;
return true;
@@ -3587,7 +3588,7 @@
}
@override
- bool visitNativeFunctionBody(NativeFunctionBody node) {
+ bool visitNativeFunctionBody(covariant NativeFunctionBodyImpl node) {
if (identical(node.stringLiteral, _oldNode)) {
node.stringLiteral = _newNode as StringLiteral;
return true;
@@ -3599,7 +3600,7 @@
throw ArgumentError("The old node is not a child of it's parent");
}
- bool visitNormalFormalParameter(NormalFormalParameter node) {
+ bool visitNormalFormalParameter(covariant NormalFormalParameterImpl node) {
if (identical(node.documentationComment, _oldNode)) {
node.documentationComment = _newNode as Comment;
return true;
@@ -3616,7 +3617,7 @@
bool visitNullLiteral(NullLiteral node) => visitNode(node);
@override
- bool visitOnClause(OnClause node) {
+ bool visitOnClause(covariant OnClauseImpl node) {
if (_replaceInList(node.superclassConstraints)) {
return true;
}
@@ -3624,7 +3625,8 @@
}
@override
- bool visitParenthesizedExpression(ParenthesizedExpression node) {
+ bool visitParenthesizedExpression(
+ covariant ParenthesizedExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3633,10 +3635,11 @@
}
@override
- bool visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
+ bool visitPartDirective(covariant PartDirectiveImpl node) =>
+ visitUriBasedDirective(node);
@override
- bool visitPartOfDirective(PartOfDirective node) {
+ bool visitPartOfDirective(covariant PartOfDirectiveImpl node) {
if (identical(node.libraryName, _oldNode)) {
node.libraryName = _newNode as LibraryIdentifier;
return true;
@@ -3645,7 +3648,7 @@
}
@override
- bool visitPostfixExpression(PostfixExpression node) {
+ bool visitPostfixExpression(covariant PostfixExpressionImpl node) {
if (identical(node.operand, _oldNode)) {
node.operand = _newNode as Expression;
return true;
@@ -3654,7 +3657,7 @@
}
@override
- bool visitPrefixedIdentifier(PrefixedIdentifier node) {
+ bool visitPrefixedIdentifier(covariant PrefixedIdentifierImpl node) {
if (identical(node.prefix, _oldNode)) {
node.prefix = _newNode as SimpleIdentifier;
return true;
@@ -3666,7 +3669,7 @@
}
@override
- bool visitPrefixExpression(PrefixExpression node) {
+ bool visitPrefixExpression(covariant PrefixExpressionImpl node) {
if (identical(node.operand, _oldNode)) {
node.operand = _newNode as Expression;
return true;
@@ -3675,7 +3678,7 @@
}
@override
- bool visitPropertyAccess(PropertyAccess node) {
+ bool visitPropertyAccess(covariant PropertyAccessImpl node) {
if (identical(node.target, _oldNode)) {
node.target = _newNode as Expression;
return true;
@@ -3688,7 +3691,7 @@
@override
bool visitRedirectingConstructorInvocation(
- RedirectingConstructorInvocation node) {
+ covariant RedirectingConstructorInvocationImpl node) {
if (identical(node.constructorName, _oldNode)) {
node.constructorName = _newNode as SimpleIdentifier;
return true;
@@ -3703,7 +3706,7 @@
bool visitRethrowExpression(RethrowExpression node) => visitNode(node);
@override
- bool visitReturnStatement(ReturnStatement node) {
+ bool visitReturnStatement(covariant ReturnStatementImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3715,7 +3718,7 @@
bool visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
@override
- bool visitSetOrMapLiteral(SetOrMapLiteral node) {
+ bool visitSetOrMapLiteral(covariant SetOrMapLiteralImpl node) {
if (_replaceInList(node.elements)) {
return true;
}
@@ -3723,7 +3726,7 @@
}
@override
- bool visitShowCombinator(ShowCombinator node) {
+ bool visitShowCombinator(covariant ShowCombinatorImpl node) {
if (_replaceInList(node.shownNames)) {
return true;
}
@@ -3731,7 +3734,7 @@
}
@override
- bool visitSimpleFormalParameter(SimpleFormalParameter node) {
+ bool visitSimpleFormalParameter(covariant SimpleFormalParameterImpl node) {
if (identical(node.type, _oldNode)) {
node.type = _newNode as TypeAnnotation;
return true;
@@ -3755,7 +3758,7 @@
}
@override
- bool visitStringInterpolation(StringInterpolation node) {
+ bool visitStringInterpolation(covariant StringInterpolationImpl node) {
if (_replaceInList(node.elements)) {
return true;
}
@@ -3763,7 +3766,8 @@
}
@override
- bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+ bool visitSuperConstructorInvocation(
+ covariant SuperConstructorInvocationImpl node) {
if (identical(node.constructorName, _oldNode)) {
node.constructorName = _newNode as SimpleIdentifier;
return true;
@@ -3775,10 +3779,11 @@
}
@override
- bool visitSuperExpression(SuperExpression node) => visitNode(node);
+ bool visitSuperExpression(covariant SuperExpressionImpl node) =>
+ visitNode(node);
@override
- bool visitSwitchCase(SwitchCase node) {
+ bool visitSwitchCase(covariant SwitchCaseImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3787,9 +3792,10 @@
}
@override
- bool visitSwitchDefault(SwitchDefault node) => visitSwitchMember(node);
+ bool visitSwitchDefault(covariant SwitchDefaultImpl node) =>
+ visitSwitchMember(node);
- bool visitSwitchMember(SwitchMember node) {
+ bool visitSwitchMember(covariant SwitchMemberImpl node) {
if (_replaceInList(node.labels)) {
return true;
} else if (_replaceInList(node.statements)) {
@@ -3799,7 +3805,7 @@
}
@override
- bool visitSwitchStatement(SwitchStatement node) {
+ bool visitSwitchStatement(covariant SwitchStatementImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3816,7 +3822,7 @@
bool visitThisExpression(ThisExpression node) => visitNode(node);
@override
- bool visitThrowExpression(ThrowExpression node) {
+ bool visitThrowExpression(covariant ThrowExpressionImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3825,7 +3831,8 @@
}
@override
- bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+ bool visitTopLevelVariableDeclaration(
+ covariant TopLevelVariableDeclarationImpl node) {
if (identical(node.variables, _oldNode)) {
node.variables = _newNode as VariableDeclarationList;
return true;
@@ -3834,7 +3841,7 @@
}
@override
- bool visitTryStatement(TryStatement node) {
+ bool visitTryStatement(covariant TryStatementImpl node) {
if (identical(node.body, _oldNode)) {
node.body = _newNode as Block;
return true;
@@ -3848,14 +3855,14 @@
}
@override
- bool visitTypeArgumentList(TypeArgumentList node) {
+ bool visitTypeArgumentList(covariant TypeArgumentListImpl node) {
if (_replaceInList(node.arguments)) {
return true;
}
return visitNode(node);
}
- bool visitTypedLiteral(TypedLiteral node) {
+ bool visitTypedLiteral(covariant TypedLiteralImpl node) {
if (identical(node.typeArguments, _oldNode)) {
node.typeArguments = _newNode as TypeArgumentList;
return true;
@@ -3864,7 +3871,7 @@
}
@override
- bool visitTypeName(TypeName node) {
+ bool visitTypeName(covariant TypeNameImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as Identifier;
return true;
@@ -3876,7 +3883,7 @@
}
@override
- bool visitTypeParameter(TypeParameter node) {
+ bool visitTypeParameter(covariant TypeParameterImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -3888,14 +3895,14 @@
}
@override
- bool visitTypeParameterList(TypeParameterList node) {
+ bool visitTypeParameterList(covariant TypeParameterListImpl node) {
if (_replaceInList(node.typeParameters)) {
return true;
}
return visitNode(node);
}
- bool visitUriBasedDirective(UriBasedDirective node) {
+ bool visitUriBasedDirective(covariant UriBasedDirectiveImpl node) {
if (identical(node.uri, _oldNode)) {
node.uri = _newNode as StringLiteral;
return true;
@@ -3904,7 +3911,7 @@
}
@override
- bool visitVariableDeclaration(VariableDeclaration node) {
+ bool visitVariableDeclaration(covariant VariableDeclarationImpl node) {
if (identical(node.name, _oldNode)) {
node.name = _newNode as SimpleIdentifier;
return true;
@@ -3916,7 +3923,8 @@
}
@override
- bool visitVariableDeclarationList(VariableDeclarationList node) {
+ bool visitVariableDeclarationList(
+ covariant VariableDeclarationListImpl node) {
if (identical(node.type, _oldNode)) {
node.type = _newNode as TypeAnnotation;
return true;
@@ -3927,7 +3935,8 @@
}
@override
- bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
+ bool visitVariableDeclarationStatement(
+ covariant VariableDeclarationStatementImpl node) {
if (identical(node.variables, _oldNode)) {
node.variables = _newNode as VariableDeclarationList;
return true;
@@ -3936,7 +3945,7 @@
}
@override
- bool visitWhileStatement(WhileStatement node) {
+ bool visitWhileStatement(covariant WhileStatementImpl node) {
if (identical(node.condition, _oldNode)) {
node.condition = _newNode as Expression;
return true;
@@ -3948,7 +3957,7 @@
}
@override
- bool visitWithClause(WithClause node) {
+ bool visitWithClause(covariant WithClauseImpl node) {
if (_replaceInList(node.mixinTypes)) {
return true;
}
@@ -3956,7 +3965,7 @@
}
@override
- bool visitYieldStatement(YieldStatement node) {
+ bool visitYieldStatement(covariant YieldStatementImpl node) {
if (identical(node.expression, _oldNode)) {
node.expression = _newNode as Expression;
return true;
@@ -3964,7 +3973,7 @@
return visitNode(node);
}
- bool _replaceInList(NodeList list) {
+ bool _replaceInList(NodeListImpl list) {
int count = list.length;
for (int i = 0; i < count; i++) {
if (identical(_oldNode, list[i])) {
@@ -4004,7 +4013,7 @@
@override
bool visitAdjacentStrings(AdjacentStrings node) {
- AdjacentStrings toNode = _toNode as AdjacentStrings;
+ var toNode = _toNode as AdjacentStringsImpl;
if (_isEqualNodeLists(node.strings, toNode.strings)) {
toNode.staticType = node.staticType;
return true;
@@ -4014,7 +4023,7 @@
@override
bool visitAnnotation(Annotation node) {
- Annotation toNode = _toNode as Annotation;
+ var toNode = _toNode as AnnotationImpl;
if (_and(
_isEqualTokens(node.atSign, toNode.atSign),
_isEqualNodes(node.name, toNode.name),
@@ -4030,7 +4039,7 @@
@override
bool visitArgumentList(ArgumentList node) {
- ArgumentList toNode = _toNode as ArgumentList;
+ var toNode = _toNode as ArgumentListImpl;
return _and(
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodeLists(node.arguments, toNode.arguments),
@@ -4039,7 +4048,7 @@
@override
bool visitAsExpression(AsExpression node) {
- AsExpression toNode = _toNode as AsExpression;
+ var toNode = _toNode as AsExpressionImpl;
if (_and(
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.asOperator, toNode.asOperator),
@@ -4052,7 +4061,7 @@
@override
bool visitAssertInitializer(AssertInitializer node) {
- AssertInitializer toNode = _toNode as AssertInitializer;
+ var toNode = _toNode as AssertInitializerImpl;
return _and(
_isEqualTokens(node.assertKeyword, toNode.assertKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -4064,7 +4073,7 @@
@override
bool visitAssertStatement(AssertStatement node) {
- AssertStatement toNode = _toNode as AssertStatement;
+ var toNode = _toNode as AssertStatementImpl;
return _and(
_isEqualTokens(node.assertKeyword, toNode.assertKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -4077,7 +4086,7 @@
@override
bool visitAssignmentExpression(AssignmentExpression node) {
- AssignmentExpression toNode = _toNode as AssignmentExpression;
+ var toNode = _toNode as AssignmentExpressionImpl;
if (_and(
_isEqualNodes(node.leftHandSide, toNode.leftHandSide),
_isEqualTokens(node.operator, toNode.operator),
@@ -4091,7 +4100,7 @@
@override
bool visitAwaitExpression(AwaitExpression node) {
- AwaitExpression toNode = _toNode as AwaitExpression;
+ var toNode = _toNode as AwaitExpressionImpl;
if (_and(_isEqualTokens(node.awaitKeyword, toNode.awaitKeyword),
_isEqualNodes(node.expression, toNode.expression))) {
toNode.staticType = node.staticType;
@@ -4102,7 +4111,7 @@
@override
bool visitBinaryExpression(BinaryExpression node) {
- BinaryExpression toNode = _toNode as BinaryExpression;
+ var toNode = _toNode as BinaryExpressionImpl;
if (_and(
_isEqualNodes(node.leftOperand, toNode.leftOperand),
_isEqualTokens(node.operator, toNode.operator),
@@ -4116,7 +4125,7 @@
@override
bool visitBlock(Block node) {
- Block toNode = _toNode as Block;
+ var toNode = _toNode as BlockImpl;
return _and(
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.statements, toNode.statements),
@@ -4125,13 +4134,13 @@
@override
bool visitBlockFunctionBody(BlockFunctionBody node) {
- BlockFunctionBody toNode = _toNode as BlockFunctionBody;
+ var toNode = _toNode as BlockFunctionBodyImpl;
return _isEqualNodes(node.block, toNode.block);
}
@override
bool visitBooleanLiteral(BooleanLiteral node) {
- BooleanLiteral toNode = _toNode as BooleanLiteral;
+ var toNode = _toNode as BooleanLiteralImpl;
if (_and(_isEqualTokens(node.literal, toNode.literal),
node.value == toNode.value)) {
toNode.staticType = node.staticType;
@@ -4142,7 +4151,7 @@
@override
bool visitBreakStatement(BreakStatement node) {
- BreakStatement toNode = _toNode as BreakStatement;
+ var toNode = _toNode as BreakStatementImpl;
if (_and(
_isEqualTokens(node.breakKeyword, toNode.breakKeyword),
_isEqualNodes(node.label, toNode.label),
@@ -4155,7 +4164,7 @@
@override
bool visitCascadeExpression(CascadeExpression node) {
- CascadeExpression toNode = _toNode as CascadeExpression;
+ var toNode = _toNode as CascadeExpressionImpl;
if (_and(_isEqualNodes(node.target, toNode.target),
_isEqualNodeLists(node.cascadeSections, toNode.cascadeSections))) {
toNode.staticType = node.staticType;
@@ -4166,7 +4175,7 @@
@override
bool visitCatchClause(CatchClause node) {
- CatchClause toNode = _toNode as CatchClause;
+ var toNode = _toNode as CatchClauseImpl;
return _and(
_isEqualTokens(node.onKeyword, toNode.onKeyword),
_isEqualNodes(node.exceptionType, toNode.exceptionType),
@@ -4181,7 +4190,7 @@
@override
bool visitClassDeclaration(ClassDeclaration node) {
- ClassDeclaration toNode = _toNode as ClassDeclaration;
+ var toNode = _toNode as ClassDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4199,7 +4208,7 @@
@override
bool visitClassTypeAlias(ClassTypeAlias node) {
- ClassTypeAlias toNode = _toNode as ClassTypeAlias;
+ var toNode = _toNode as ClassTypeAliasImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4216,20 +4225,20 @@
@override
bool visitComment(Comment node) {
- Comment toNode = _toNode as Comment;
+ var toNode = _toNode as CommentImpl;
return _isEqualNodeLists(node.references, toNode.references);
}
@override
bool visitCommentReference(CommentReference node) {
- CommentReference toNode = _toNode as CommentReference;
+ var toNode = _toNode as CommentReferenceImpl;
return _and(_isEqualTokens(node.newKeyword, toNode.newKeyword),
_isEqualNodes(node.identifier, toNode.identifier));
}
@override
bool visitCompilationUnit(CompilationUnit node) {
- CompilationUnit toNode = _toNode as CompilationUnit;
+ var toNode = _toNode as CompilationUnitImpl;
if (_and(
_isEqualTokens(node.beginToken, toNode.beginToken),
_isEqualNodes(node.scriptTag, toNode.scriptTag),
@@ -4244,7 +4253,7 @@
@override
bool visitConditionalExpression(ConditionalExpression node) {
- ConditionalExpression toNode = _toNode as ConditionalExpression;
+ var toNode = _toNode as ConditionalExpressionImpl;
if (_and(
_isEqualNodes(node.condition, toNode.condition),
_isEqualTokens(node.question, toNode.question),
@@ -4259,7 +4268,7 @@
@override
bool visitConfiguration(Configuration node) {
- Configuration toNode = _toNode as Configuration;
+ var toNode = _toNode as ConfigurationImpl;
if (_and(
_isEqualTokens(node.ifKeyword, toNode.ifKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -4298,7 +4307,7 @@
@override
bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
- ConstructorFieldInitializer toNode = _toNode as ConstructorFieldInitializer;
+ var toNode = _toNode as ConstructorFieldInitializerImpl;
return _and(
_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
_isEqualTokens(node.period, toNode.period),
@@ -4309,7 +4318,7 @@
@override
bool visitConstructorName(ConstructorName node) {
- ConstructorName toNode = _toNode as ConstructorName;
+ var toNode = _toNode as ConstructorNameImpl;
if (_and(
_isEqualNodes(node.type, toNode.type),
_isEqualTokens(node.period, toNode.period),
@@ -4322,7 +4331,7 @@
@override
bool visitContinueStatement(ContinueStatement node) {
- ContinueStatement toNode = _toNode as ContinueStatement;
+ var toNode = _toNode as ContinueStatementImpl;
if (_and(
_isEqualTokens(node.continueKeyword, toNode.continueKeyword),
_isEqualNodes(node.label, toNode.label),
@@ -4335,7 +4344,7 @@
@override
bool visitDeclaredIdentifier(DeclaredIdentifier node) {
- DeclaredIdentifier toNode = _toNode as DeclaredIdentifier;
+ var toNode = _toNode as DeclaredIdentifierImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4356,7 +4365,7 @@
@override
bool visitDoStatement(DoStatement node) {
- DoStatement toNode = _toNode as DoStatement;
+ var toNode = _toNode as DoStatementImpl;
return _and(
_isEqualTokens(node.doKeyword, toNode.doKeyword),
_isEqualNodes(node.body, toNode.body),
@@ -4369,13 +4378,13 @@
@override
bool visitDottedName(DottedName node) {
- DottedName toNode = _toNode as DottedName;
+ var toNode = _toNode as DottedNameImpl;
return _isEqualNodeLists(node.components, toNode.components);
}
@override
bool visitDoubleLiteral(DoubleLiteral node) {
- DoubleLiteral toNode = _toNode as DoubleLiteral;
+ var toNode = _toNode as DoubleLiteralImpl;
if (_and(_isEqualTokens(node.literal, toNode.literal),
node.value == toNode.value)) {
toNode.staticType = node.staticType;
@@ -4386,19 +4395,19 @@
@override
bool visitEmptyFunctionBody(EmptyFunctionBody node) {
- EmptyFunctionBody toNode = _toNode as EmptyFunctionBody;
+ var toNode = _toNode as EmptyFunctionBodyImpl;
return _isEqualTokens(node.semicolon, toNode.semicolon);
}
@override
bool visitEmptyStatement(EmptyStatement node) {
- EmptyStatement toNode = _toNode as EmptyStatement;
+ var toNode = _toNode as EmptyStatementImpl;
return _isEqualTokens(node.semicolon, toNode.semicolon);
}
@override
bool visitEnumConstantDeclaration(EnumConstantDeclaration node) {
- EnumConstantDeclaration toNode = _toNode as EnumConstantDeclaration;
+ var toNode = _toNode as EnumConstantDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4407,7 +4416,7 @@
@override
bool visitEnumDeclaration(EnumDeclaration node) {
- EnumDeclaration toNode = _toNode as EnumDeclaration;
+ var toNode = _toNode as EnumDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4420,7 +4429,7 @@
@override
bool visitExportDirective(ExportDirective node) {
- ExportDirective toNode = _toNode as ExportDirective;
+ var toNode = _toNode as ExportDirectiveImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4436,7 +4445,7 @@
@override
bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
- ExpressionFunctionBody toNode = _toNode as ExpressionFunctionBody;
+ var toNode = _toNode as ExpressionFunctionBodyImpl;
return _and(
_isEqualTokens(node.functionDefinition, toNode.functionDefinition),
_isEqualNodes(node.expression, toNode.expression),
@@ -4445,21 +4454,21 @@
@override
bool visitExpressionStatement(ExpressionStatement node) {
- ExpressionStatement toNode = _toNode as ExpressionStatement;
+ var toNode = _toNode as ExpressionStatementImpl;
return _and(_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.semicolon, toNode.semicolon));
}
@override
bool visitExtendsClause(ExtendsClause node) {
- ExtendsClause toNode = _toNode as ExtendsClause;
+ var toNode = _toNode as ExtendsClauseImpl;
return _and(_isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
_isEqualNodes(node.superclass, toNode.superclass));
}
@override
bool visitExtensionDeclaration(ExtensionDeclaration node) {
- ExtensionDeclaration toNode = _toNode as ExtensionDeclaration;
+ var toNode = _toNode as ExtensionDeclarationImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4478,7 +4487,7 @@
@override
bool visitExtensionOverride(ExtensionOverride node) {
- ExtensionOverride toNode = _toNode as ExtensionOverride;
+ var toNode = _toNode as ExtensionOverrideImpl;
return _and(
_isEqualNodes(node.extensionName, toNode.extensionName),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
@@ -4487,7 +4496,7 @@
@override
bool visitFieldDeclaration(FieldDeclaration node) {
- FieldDeclaration toNode = _toNode as FieldDeclaration;
+ var toNode = _toNode as FieldDeclarationImpl;
return _and(
_isEqualTokens(node.abstractKeyword, toNode.abstractKeyword),
_isEqualNodes(node.documentationComment, toNode.documentationComment),
@@ -4500,7 +4509,7 @@
@override
bool visitFieldFormalParameter(FieldFormalParameter node) {
- FieldFormalParameter toNode = _toNode as FieldFormalParameter;
+ var toNode = _toNode as FieldFormalParameterImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4513,7 +4522,7 @@
@override
bool visitForEachPartsWithDeclaration(ForEachPartsWithDeclaration node) {
- ForEachPartsWithDeclaration toNode = _toNode as ForEachPartsWithDeclaration;
+ var toNode = _toNode as ForEachPartsWithDeclarationImpl;
return _and(
_isEqualNodes(node.loopVariable, toNode.loopVariable),
_isEqualTokens(node.inKeyword, toNode.inKeyword),
@@ -4522,7 +4531,7 @@
@override
bool visitForEachPartsWithIdentifier(ForEachPartsWithIdentifier node) {
- ForEachPartsWithIdentifier toNode = _toNode as ForEachPartsWithIdentifier;
+ var toNode = _toNode as ForEachPartsWithIdentifierImpl;
return _and(
_isEqualNodes(node.identifier, toNode.identifier),
_isEqualTokens(node.inKeyword, toNode.inKeyword),
@@ -4531,7 +4540,7 @@
@override
bool visitForElement(ForElement node) {
- ForElement toNode = _toNode as ForElement;
+ var toNode = _toNode as ForElementImpl;
return _and(
_isEqualTokens(node.awaitKeyword, toNode.awaitKeyword),
_isEqualTokens(node.forKeyword, toNode.forKeyword),
@@ -4543,7 +4552,7 @@
@override
bool visitFormalParameterList(FormalParameterList node) {
- FormalParameterList toNode = _toNode as FormalParameterList;
+ var toNode = _toNode as FormalParameterListImpl;
return _and(
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodeLists(node.parameters, toNode.parameters),
@@ -4554,7 +4563,7 @@
@override
bool visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
- ForPartsWithDeclarations toNode = _toNode as ForPartsWithDeclarations;
+ var toNode = _toNode as ForPartsWithDeclarationsImpl;
return _and(
_isEqualNodes(node.variables, toNode.variables),
_isEqualTokens(node.leftSeparator, toNode.leftSeparator),
@@ -4565,7 +4574,7 @@
@override
bool visitForPartsWithExpression(ForPartsWithExpression node) {
- ForPartsWithExpression toNode = _toNode as ForPartsWithExpression;
+ var toNode = _toNode as ForPartsWithExpressionImpl;
return _and(
_isEqualNodes(node.initialization, toNode.initialization),
_isEqualTokens(node.leftSeparator, toNode.leftSeparator),
@@ -4576,7 +4585,7 @@
@override
bool visitForStatement(ForStatement node) {
- ForStatement toNode = _toNode as ForStatement;
+ var toNode = _toNode as ForStatementImpl;
return _and(
_isEqualTokens(node.awaitKeyword, toNode.awaitKeyword),
_isEqualTokens(node.forKeyword, toNode.forKeyword),
@@ -4588,7 +4597,7 @@
@override
bool visitFunctionDeclaration(FunctionDeclaration node) {
- FunctionDeclaration toNode = _toNode as FunctionDeclaration;
+ var toNode = _toNode as FunctionDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4620,8 +4629,7 @@
@override
bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
- FunctionExpressionInvocation toNode =
- _toNode as FunctionExpressionInvocation;
+ var toNode = _toNode as FunctionExpressionInvocationImpl;
if (_and(
_isEqualNodes(node.function, toNode.function),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
@@ -4636,7 +4644,7 @@
@override
bool visitFunctionTypeAlias(FunctionTypeAlias node) {
- FunctionTypeAlias toNode = _toNode as FunctionTypeAlias;
+ var toNode = _toNode as FunctionTypeAliasImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4662,7 +4670,7 @@
@override
bool visitGenericFunctionType(GenericFunctionType node) {
- GenericFunctionTypeImpl toNode = _toNode as GenericFunctionTypeImpl;
+ var toNode = _toNode as GenericFunctionTypeImpl;
if (_and(
_isEqualNodes(node.returnType, toNode.returnType),
_isEqualTokens(node.functionKeyword, toNode.functionKeyword),
@@ -4677,7 +4685,7 @@
@override
bool visitGenericTypeAlias(GenericTypeAlias node) {
- GenericTypeAliasImpl toNode = _toNode as GenericTypeAliasImpl;
+ var toNode = _toNode as GenericTypeAliasImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4694,14 +4702,14 @@
@override
bool visitHideCombinator(HideCombinator node) {
- HideCombinator toNode = _toNode as HideCombinator;
+ var toNode = _toNode as HideCombinatorImpl;
return _and(_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodeLists(node.hiddenNames, toNode.hiddenNames));
}
@override
bool visitIfElement(IfElement node) {
- IfElement toNode = _toNode as IfElement;
+ var toNode = _toNode as IfElementImpl;
return _and(
_isEqualTokens(node.ifKeyword, toNode.ifKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -4714,7 +4722,7 @@
@override
bool visitIfStatement(IfStatement node) {
- IfStatement toNode = _toNode as IfStatement;
+ var toNode = _toNode as IfStatementImpl;
return _and(
_isEqualTokens(node.ifKeyword, toNode.ifKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -4727,7 +4735,7 @@
@override
bool visitImplementsClause(ImplementsClause node) {
- ImplementsClause toNode = _toNode as ImplementsClause;
+ var toNode = _toNode as ImplementsClauseImpl;
return _and(
_isEqualTokens(node.implementsKeyword, toNode.implementsKeyword),
_isEqualNodeLists(node.interfaces, toNode.interfaces));
@@ -4735,7 +4743,7 @@
@override
bool visitImportDirective(ImportDirective node) {
- ImportDirective toNode = _toNode as ImportDirective;
+ var toNode = _toNode as ImportDirectiveImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4753,7 +4761,7 @@
@override
bool visitIndexExpression(IndexExpression node) {
- IndexExpression toNode = _toNode as IndexExpression;
+ var toNode = _toNode as IndexExpressionImpl;
if (_and(
_isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.leftBracket, toNode.leftBracket),
@@ -4768,7 +4776,7 @@
@override
bool visitInstanceCreationExpression(InstanceCreationExpression node) {
- InstanceCreationExpression toNode = _toNode as InstanceCreationExpression;
+ var toNode = _toNode as InstanceCreationExpressionImpl;
if (_and(
_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodes(node.constructorName, toNode.constructorName),
@@ -4781,7 +4789,7 @@
@override
bool visitIntegerLiteral(IntegerLiteral node) {
- IntegerLiteral toNode = _toNode as IntegerLiteral;
+ var toNode = _toNode as IntegerLiteralImpl;
if (_and(_isEqualTokens(node.literal, toNode.literal),
node.value == toNode.value)) {
toNode.staticType = node.staticType;
@@ -4792,7 +4800,7 @@
@override
bool visitInterpolationExpression(InterpolationExpression node) {
- InterpolationExpression toNode = _toNode as InterpolationExpression;
+ var toNode = _toNode as InterpolationExpressionImpl;
return _and(
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodes(node.expression, toNode.expression),
@@ -4801,14 +4809,14 @@
@override
bool visitInterpolationString(InterpolationString node) {
- InterpolationString toNode = _toNode as InterpolationString;
+ var toNode = _toNode as InterpolationStringImpl;
return _and(_isEqualTokens(node.contents, toNode.contents),
node.value == toNode.value);
}
@override
bool visitIsExpression(IsExpression node) {
- IsExpression toNode = _toNode as IsExpression;
+ var toNode = _toNode as IsExpressionImpl;
if (_and(
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.isOperator, toNode.isOperator),
@@ -4822,21 +4830,21 @@
@override
bool visitLabel(Label node) {
- Label toNode = _toNode as Label;
+ var toNode = _toNode as LabelImpl;
return _and(_isEqualNodes(node.label, toNode.label),
_isEqualTokens(node.colon, toNode.colon));
}
@override
bool visitLabeledStatement(LabeledStatement node) {
- LabeledStatement toNode = _toNode as LabeledStatement;
+ var toNode = _toNode as LabeledStatementImpl;
return _and(_isEqualNodeLists(node.labels, toNode.labels),
_isEqualNodes(node.statement, toNode.statement));
}
@override
bool visitLibraryDirective(LibraryDirective node) {
- LibraryDirective toNode = _toNode as LibraryDirective;
+ var toNode = _toNode as LibraryDirectiveImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4851,7 +4859,7 @@
@override
bool visitLibraryIdentifier(LibraryIdentifier node) {
- LibraryIdentifier toNode = _toNode as LibraryIdentifier;
+ var toNode = _toNode as LibraryIdentifierImpl;
if (_isEqualNodeLists(node.components, toNode.components)) {
toNode.staticType = node.staticType;
return true;
@@ -4861,7 +4869,7 @@
@override
bool visitListLiteral(ListLiteral node) {
- ListLiteral toNode = _toNode as ListLiteral;
+ var toNode = _toNode as ListLiteralImpl;
if (_and(
_isEqualTokens(node.constKeyword, toNode.constKeyword),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
@@ -4876,7 +4884,7 @@
@override
bool visitMapLiteralEntry(MapLiteralEntry node) {
- MapLiteralEntry toNode = _toNode as MapLiteralEntry;
+ var toNode = _toNode as MapLiteralEntryImpl;
return _and(
_isEqualNodes(node.key, toNode.key),
_isEqualTokens(node.separator, toNode.separator),
@@ -4885,7 +4893,7 @@
@override
bool visitMethodDeclaration(MethodDeclaration node) {
- MethodDeclaration toNode = _toNode as MethodDeclaration;
+ var toNode = _toNode as MethodDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4901,7 +4909,7 @@
@override
bool visitMethodInvocation(MethodInvocation node) {
- MethodInvocation toNode = _toNode as MethodInvocation;
+ var toNode = _toNode as MethodInvocationImpl;
if (_and(
_isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.operator, toNode.operator),
@@ -4917,7 +4925,7 @@
@override
bool visitMixinDeclaration(MixinDeclaration node) {
- MixinDeclaration toNode = _toNode as MixinDeclaration;
+ var toNode = _toNode as MixinDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -4933,7 +4941,7 @@
@override
bool visitNamedExpression(NamedExpression node) {
- NamedExpression toNode = _toNode as NamedExpression;
+ var toNode = _toNode as NamedExpressionImpl;
if (_and(_isEqualNodes(node.name, toNode.name),
_isEqualNodes(node.expression, toNode.expression))) {
toNode.staticType = node.staticType;
@@ -4944,14 +4952,14 @@
@override
bool visitNativeClause(NativeClause node) {
- NativeClause toNode = _toNode as NativeClause;
+ var toNode = _toNode as NativeClauseImpl;
return _and(_isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
_isEqualNodes(node.name, toNode.name));
}
@override
bool visitNativeFunctionBody(NativeFunctionBody node) {
- NativeFunctionBody toNode = _toNode as NativeFunctionBody;
+ var toNode = _toNode as NativeFunctionBodyImpl;
return _and(
_isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
_isEqualNodes(node.stringLiteral, toNode.stringLiteral),
@@ -4960,7 +4968,7 @@
@override
bool visitNullLiteral(NullLiteral node) {
- NullLiteral toNode = _toNode as NullLiteral;
+ var toNode = _toNode as NullLiteralImpl;
if (_isEqualTokens(node.literal, toNode.literal)) {
toNode.staticType = node.staticType;
return true;
@@ -4970,7 +4978,7 @@
@override
bool visitOnClause(OnClause node) {
- OnClause toNode = _toNode as OnClause;
+ var toNode = _toNode as OnClauseImpl;
return _and(
_isEqualTokens(node.onKeyword, toNode.onKeyword),
_isEqualNodeLists(
@@ -4979,7 +4987,7 @@
@override
bool visitParenthesizedExpression(ParenthesizedExpression node) {
- ParenthesizedExpression toNode = _toNode as ParenthesizedExpression;
+ var toNode = _toNode as ParenthesizedExpressionImpl;
if (_and(
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.expression, toNode.expression),
@@ -4992,7 +5000,7 @@
@override
bool visitPartDirective(PartDirective node) {
- PartDirective toNode = _toNode as PartDirective;
+ var toNode = _toNode as PartDirectiveImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -5007,7 +5015,7 @@
@override
bool visitPartOfDirective(PartOfDirective node) {
- PartOfDirective toNode = _toNode as PartOfDirective;
+ var toNode = _toNode as PartOfDirectiveImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -5023,7 +5031,7 @@
@override
bool visitPostfixExpression(PostfixExpression node) {
- PostfixExpression toNode = _toNode as PostfixExpression;
+ var toNode = _toNode as PostfixExpressionImpl;
if (_and(_isEqualNodes(node.operand, toNode.operand),
_isEqualTokens(node.operator, toNode.operator))) {
toNode.staticElement = node.staticElement;
@@ -5035,7 +5043,7 @@
@override
bool visitPrefixedIdentifier(PrefixedIdentifier node) {
- PrefixedIdentifier toNode = _toNode as PrefixedIdentifier;
+ var toNode = _toNode as PrefixedIdentifierImpl;
if (_and(
_isEqualNodes(node.prefix, toNode.prefix),
_isEqualTokens(node.period, toNode.period),
@@ -5048,7 +5056,7 @@
@override
bool visitPrefixExpression(PrefixExpression node) {
- PrefixExpression toNode = _toNode as PrefixExpression;
+ var toNode = _toNode as PrefixExpressionImpl;
if (_and(_isEqualTokens(node.operator, toNode.operator),
_isEqualNodes(node.operand, toNode.operand))) {
toNode.staticElement = node.staticElement;
@@ -5060,7 +5068,7 @@
@override
bool visitPropertyAccess(PropertyAccess node) {
- PropertyAccess toNode = _toNode as PropertyAccess;
+ var toNode = _toNode as PropertyAccessImpl;
if (_and(
_isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.operator, toNode.operator),
@@ -5074,8 +5082,7 @@
@override
bool visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) {
- RedirectingConstructorInvocation toNode =
- _toNode as RedirectingConstructorInvocation;
+ var toNode = _toNode as RedirectingConstructorInvocationImpl;
if (_and(
_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
_isEqualTokens(node.period, toNode.period),
@@ -5089,7 +5096,7 @@
@override
bool visitRethrowExpression(RethrowExpression node) {
- RethrowExpression toNode = _toNode as RethrowExpression;
+ var toNode = _toNode as RethrowExpressionImpl;
if (_isEqualTokens(node.rethrowKeyword, toNode.rethrowKeyword)) {
toNode.staticType = node.staticType;
return true;
@@ -5099,7 +5106,7 @@
@override
bool visitReturnStatement(ReturnStatement node) {
- ReturnStatement toNode = _toNode as ReturnStatement;
+ var toNode = _toNode as ReturnStatementImpl;
return _and(
_isEqualTokens(node.returnKeyword, toNode.returnKeyword),
_isEqualNodes(node.expression, toNode.expression),
@@ -5108,13 +5115,13 @@
@override
bool visitScriptTag(ScriptTag node) {
- ScriptTag toNode = _toNode as ScriptTag;
+ var toNode = _toNode as ScriptTagImpl;
return _isEqualTokens(node.scriptTag, toNode.scriptTag);
}
@override
bool visitSetOrMapLiteral(SetOrMapLiteral node) {
- SetOrMapLiteral toNode = _toNode as SetOrMapLiteral;
+ var toNode = _toNode as SetOrMapLiteralImpl;
if (_and(
_isEqualTokens(node.constKeyword, toNode.constKeyword),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
@@ -5129,22 +5136,21 @@
@override
bool visitShowCombinator(ShowCombinator node) {
- ShowCombinator toNode = _toNode as ShowCombinator;
+ var toNode = _toNode as ShowCombinatorImpl;
return _and(_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodeLists(node.shownNames, toNode.shownNames));
}
@override
bool visitSimpleFormalParameter(SimpleFormalParameter node) {
- SimpleFormalParameter toNode = _toNode as SimpleFormalParameter;
+ var toNode = _toNode as SimpleFormalParameterImpl;
if (_and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodes(node.type, toNode.type),
_isEqualNodes(node.identifier, toNode.identifier))) {
- (toNode as SimpleFormalParameterImpl).declaredElement =
- node.declaredElement;
+ toNode.declaredElement = node.declaredElement;
return true;
}
return false;
@@ -5152,12 +5158,11 @@
@override
bool visitSimpleIdentifier(SimpleIdentifier node) {
- SimpleIdentifier toNode = _toNode as SimpleIdentifier;
+ var toNode = _toNode as SimpleIdentifierImpl;
if (_isEqualTokens(node.token, toNode.token)) {
toNode.staticElement = node.staticElement;
toNode.staticType = node.staticType;
- (toNode as SimpleIdentifierImpl).tearOffTypeArgumentTypes =
- node.tearOffTypeArgumentTypes;
+ toNode.tearOffTypeArgumentTypes = node.tearOffTypeArgumentTypes;
return true;
}
return false;
@@ -5165,7 +5170,7 @@
@override
bool visitSimpleStringLiteral(SimpleStringLiteral node) {
- SimpleStringLiteral toNode = _toNode as SimpleStringLiteral;
+ var toNode = _toNode as SimpleStringLiteralImpl;
if (_and(_isEqualTokens(node.literal, toNode.literal),
node.value == toNode.value)) {
toNode.staticType = node.staticType;
@@ -5176,14 +5181,14 @@
@override
bool visitSpreadElement(SpreadElement node) {
- SpreadElement toNode = _toNode as SpreadElement;
+ var toNode = _toNode as SpreadElementImpl;
return _and(_isEqualTokens(node.spreadOperator, toNode.spreadOperator),
_isEqualNodes(node.expression, toNode.expression));
}
@override
bool visitStringInterpolation(StringInterpolation node) {
- StringInterpolation toNode = _toNode as StringInterpolation;
+ var toNode = _toNode as StringInterpolationImpl;
if (_isEqualNodeLists(node.elements, toNode.elements)) {
toNode.staticType = node.staticType;
return true;
@@ -5193,7 +5198,7 @@
@override
bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
- SuperConstructorInvocation toNode = _toNode as SuperConstructorInvocation;
+ var toNode = _toNode as SuperConstructorInvocationImpl;
if (_and(
_isEqualTokens(node.superKeyword, toNode.superKeyword),
_isEqualTokens(node.period, toNode.period),
@@ -5207,7 +5212,7 @@
@override
bool visitSuperExpression(SuperExpression node) {
- SuperExpression toNode = _toNode as SuperExpression;
+ var toNode = _toNode as SuperExpressionImpl;
if (_isEqualTokens(node.superKeyword, toNode.superKeyword)) {
toNode.staticType = node.staticType;
return true;
@@ -5217,7 +5222,7 @@
@override
bool visitSwitchCase(SwitchCase node) {
- SwitchCase toNode = _toNode as SwitchCase;
+ var toNode = _toNode as SwitchCaseImpl;
return _and(
_isEqualNodeLists(node.labels, toNode.labels),
_isEqualTokens(node.keyword, toNode.keyword),
@@ -5228,7 +5233,7 @@
@override
bool visitSwitchDefault(SwitchDefault node) {
- SwitchDefault toNode = _toNode as SwitchDefault;
+ var toNode = _toNode as SwitchDefaultImpl;
return _and(
_isEqualNodeLists(node.labels, toNode.labels),
_isEqualTokens(node.keyword, toNode.keyword),
@@ -5238,7 +5243,7 @@
@override
bool visitSwitchStatement(SwitchStatement node) {
- SwitchStatement toNode = _toNode as SwitchStatement;
+ var toNode = _toNode as SwitchStatementImpl;
return _and(
_isEqualTokens(node.switchKeyword, toNode.switchKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -5251,7 +5256,7 @@
@override
bool visitSymbolLiteral(SymbolLiteral node) {
- SymbolLiteral toNode = _toNode as SymbolLiteral;
+ var toNode = _toNode as SymbolLiteralImpl;
if (_and(_isEqualTokens(node.poundSign, toNode.poundSign),
_isEqualTokenLists(node.components, toNode.components))) {
toNode.staticType = node.staticType;
@@ -5262,7 +5267,7 @@
@override
bool visitThisExpression(ThisExpression node) {
- ThisExpression toNode = _toNode as ThisExpression;
+ var toNode = _toNode as ThisExpressionImpl;
if (_isEqualTokens(node.thisKeyword, toNode.thisKeyword)) {
toNode.staticType = node.staticType;
return true;
@@ -5272,7 +5277,7 @@
@override
bool visitThrowExpression(ThrowExpression node) {
- ThrowExpression toNode = _toNode as ThrowExpression;
+ var toNode = _toNode as ThrowExpressionImpl;
if (_and(_isEqualTokens(node.throwKeyword, toNode.throwKeyword),
_isEqualNodes(node.expression, toNode.expression))) {
toNode.staticType = node.staticType;
@@ -5283,7 +5288,7 @@
@override
bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
- TopLevelVariableDeclaration toNode = _toNode as TopLevelVariableDeclaration;
+ var toNode = _toNode as TopLevelVariableDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -5294,7 +5299,7 @@
@override
bool visitTryStatement(TryStatement node) {
- TryStatement toNode = _toNode as TryStatement;
+ var toNode = _toNode as TryStatementImpl;
return _and(
_isEqualTokens(node.tryKeyword, toNode.tryKeyword),
_isEqualNodes(node.body, toNode.body),
@@ -5305,7 +5310,7 @@
@override
bool visitTypeArgumentList(TypeArgumentList node) {
- TypeArgumentList toNode = _toNode as TypeArgumentList;
+ var toNode = _toNode as TypeArgumentListImpl;
return _and(
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.arguments, toNode.arguments),
@@ -5314,7 +5319,7 @@
@override
bool visitTypeName(TypeName node) {
- TypeName toNode = _toNode as TypeName;
+ var toNode = _toNode as TypeNameImpl;
if (_and(
_isEqualNodes(node.name, toNode.name),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
@@ -5327,7 +5332,7 @@
@override
bool visitTypeParameter(TypeParameter node) {
- TypeParameter toNode = _toNode as TypeParameter;
+ var toNode = _toNode as TypeParameterImpl;
// TODO (kallentu) : Clean up TypeParameterImpl casting once variance is
// added to the interface.
return _and(
@@ -5335,14 +5340,14 @@
_isEqualNodeLists(node.metadata, toNode.metadata),
_isEqualNodes(node.name, toNode.name),
_isEqualTokens((node as TypeParameterImpl).varianceKeyword,
- (toNode as TypeParameterImpl).varianceKeyword),
+ toNode.varianceKeyword),
_isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
_isEqualNodes(node.bound, toNode.bound));
}
@override
bool visitTypeParameterList(TypeParameterList node) {
- TypeParameterList toNode = _toNode as TypeParameterList;
+ var toNode = _toNode as TypeParameterListImpl;
return _and(
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.typeParameters, toNode.typeParameters),
@@ -5351,7 +5356,7 @@
@override
bool visitVariableDeclaration(VariableDeclaration node) {
- VariableDeclaration toNode = _toNode as VariableDeclaration;
+ var toNode = _toNode as VariableDeclarationImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -5362,7 +5367,7 @@
@override
bool visitVariableDeclarationList(VariableDeclarationList node) {
- VariableDeclarationList toNode = _toNode as VariableDeclarationList;
+ var toNode = _toNode as VariableDeclarationListImpl;
return _and(
_isEqualNodes(node.documentationComment, toNode.documentationComment),
_isEqualNodeLists(node.metadata, toNode.metadata),
@@ -5381,7 +5386,7 @@
@override
bool visitWhileStatement(WhileStatement node) {
- WhileStatement toNode = _toNode as WhileStatement;
+ var toNode = _toNode as WhileStatementImpl;
return _and(
_isEqualTokens(node.whileKeyword, toNode.whileKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -5392,14 +5397,14 @@
@override
bool visitWithClause(WithClause node) {
- WithClause toNode = _toNode as WithClause;
+ var toNode = _toNode as WithClauseImpl;
return _and(_isEqualTokens(node.withKeyword, toNode.withKeyword),
_isEqualNodeLists(node.mixinTypes, toNode.mixinTypes));
}
@override
bool visitYieldStatement(YieldStatement node) {
- YieldStatement toNode = _toNode as YieldStatement;
+ var toNode = _toNode as YieldStatementImpl;
return _and(
_isEqualTokens(node.yieldKeyword, toNode.yieldKeyword),
_isEqualNodes(node.expression, toNode.expression),
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index 89ce0ba..d8536a9 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -5,7 +5,6 @@
import 'dart:collection';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -14,6 +13,7 @@
import 'package:analyzer/dart/element/type_provider.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/constant/from_environment_evaluator.dart';
import 'package:analyzer/src/dart/constant/has_type_parameter_reference.dart';
import 'package:analyzer/src/dart/constant/potentially_constant.dart';
diff --git a/pkg/analyzer/lib/src/dart/constant/utilities.dart b/pkg/analyzer/lib/src/dart/constant/utilities.dart
index 4325063..2da1246 100644
--- a/pkg/analyzer/lib/src/dart/constant/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/constant/utilities.dart
@@ -23,15 +23,15 @@
ConstantAstCloner() : super(true);
@override
- Annotation visitAnnotation(Annotation node) {
- Annotation annotation = super.visitAnnotation(node);
+ AnnotationImpl visitAnnotation(Annotation node) {
+ var annotation = super.visitAnnotation(node);
annotation.element = node.element;
return annotation;
}
@override
- ConstructorName visitConstructorName(ConstructorName node) {
- ConstructorName name = super.visitConstructorName(node);
+ ConstructorNameImpl visitConstructorName(ConstructorName node) {
+ var name = super.visitConstructorName(node);
name.staticElement = node.staticElement;
return name;
}
@@ -45,10 +45,9 @@
}
@override
- InstanceCreationExpression visitInstanceCreationExpression(
+ InstanceCreationExpressionImpl visitInstanceCreationExpression(
InstanceCreationExpression node) {
- InstanceCreationExpression expression =
- super.visitInstanceCreationExpression(node);
+ var expression = super.visitInstanceCreationExpression(node);
if (node.keyword == null) {
if (node.isConst) {
expression.keyword = KeywordToken(Keyword.CONST, node.offset);
@@ -60,15 +59,15 @@
}
@override
- IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
- IntegerLiteral integer = super.visitIntegerLiteral(node);
+ IntegerLiteralImpl visitIntegerLiteral(IntegerLiteral node) {
+ var integer = super.visitIntegerLiteral(node);
integer.staticType = node.staticType;
return integer;
}
@override
- ListLiteral visitListLiteral(ListLiteral node) {
- ListLiteral literal = super.visitListLiteral(node);
+ ListLiteralImpl visitListLiteral(ListLiteral node) {
+ var literal = super.visitListLiteral(node);
literal.staticType = node.staticType;
if (node.constKeyword == null && node.isConst) {
literal.constKeyword = KeywordToken(Keyword.CONST, node.offset);
@@ -91,17 +90,16 @@
}
@override
- RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
+ RedirectingConstructorInvocationImpl visitRedirectingConstructorInvocation(
RedirectingConstructorInvocation node) {
- RedirectingConstructorInvocation invocation =
- super.visitRedirectingConstructorInvocation(node);
+ var invocation = super.visitRedirectingConstructorInvocation(node);
invocation.staticElement = node.staticElement;
return invocation;
}
@override
- SetOrMapLiteral visitSetOrMapLiteral(SetOrMapLiteral node) {
- SetOrMapLiteral literal = super.visitSetOrMapLiteral(node);
+ SetOrMapLiteralImpl visitSetOrMapLiteral(SetOrMapLiteral node) {
+ var literal = super.visitSetOrMapLiteral(node);
literal.staticType = node.staticType;
if (node.constKeyword == null && node.isConst) {
literal.constKeyword = KeywordToken(Keyword.CONST, node.offset);
@@ -119,17 +117,16 @@
}
@override
- SuperConstructorInvocation visitSuperConstructorInvocation(
+ SuperConstructorInvocationImpl visitSuperConstructorInvocation(
SuperConstructorInvocation node) {
- SuperConstructorInvocation invocation =
- super.visitSuperConstructorInvocation(node);
+ var invocation = super.visitSuperConstructorInvocation(node);
invocation.staticElement = node.staticElement;
return invocation;
}
@override
- TypeName visitTypeName(TypeName node) {
- TypeName typeName = super.visitTypeName(node);
+ TypeNameImpl visitTypeName(TypeName node) {
+ var typeName = super.visitTypeName(node);
typeName.type = node.type;
return typeName;
}
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 45df3f4..e0f5421 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -454,9 +454,9 @@
ClassElementImpl.forLinkedNode(CompilationUnitElementImpl enclosing,
Reference reference, AstNode linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
- if (linkedNode is ClassDeclaration) {
+ if (linkedNode is ClassDeclarationImpl) {
linkedNode.name.staticElement = this;
- } else if (linkedNode is ClassTypeAlias) {
+ } else if (linkedNode is ClassTypeAliasImpl) {
linkedNode.name.staticElement = this;
}
hasBeenInferred = !linkedContext!.isLinking;
@@ -1235,7 +1235,8 @@
if (linkedNode != null) {
var containerRef = reference!.getChild('@enum');
var linkedNode = this.linkedNode as CompilationUnit;
- _enums = linkedNode.declarations.whereType<EnumDeclaration>().map((node) {
+ _enums =
+ linkedNode.declarations.whereType<EnumDeclarationImpl>().map((node) {
var name = node.name.name;
var reference = containerRef.getChild(name);
var element = node.declaredElement;
@@ -1302,7 +1303,7 @@
if (linkedNode != null) {
var containerRef = reference!.getChild('@function');
return _functions = linkedContext!.unit_withDeclarations.declarations
- .whereType<FunctionDeclaration>()
+ .whereType<FunctionDeclarationImpl>()
.where((node) => !node.isGetter && !node.isSetter)
.map((node) {
var name = node.name.name;
@@ -1374,7 +1375,8 @@
var linkedNode = this.linkedNode as CompilationUnit;
var containerRef = reference!.getChild('@mixin');
var declarations = linkedNode.declarations;
- return _mixins = declarations.whereType<MixinDeclaration>().map((node) {
+ return _mixins =
+ declarations.whereType<MixinDeclarationImpl>().map((node) {
var name = node.name.name;
var reference = containerRef.getChild(name);
var element = node.declaredElement as MixinElementImpl?;
@@ -2177,8 +2179,8 @@
DefaultFieldFormalParameterElementImpl(String name, int nameOffset)
: super(name, nameOffset);
- DefaultFieldFormalParameterElementImpl.forLinkedNode(
- ElementImpl enclosing, Reference? reference, FormalParameter linkedNode)
+ DefaultFieldFormalParameterElementImpl.forLinkedNode(ElementImpl enclosing,
+ Reference? reference, FormalParameterImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode);
}
@@ -2190,8 +2192,8 @@
DefaultParameterElementImpl(String? name, int nameOffset)
: super(name, nameOffset);
- DefaultParameterElementImpl.forLinkedNode(
- ElementImpl enclosing, Reference? reference, FormalParameter linkedNode)
+ DefaultParameterElementImpl.forLinkedNode(ElementImpl enclosing,
+ Reference? reference, FormalParameterImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode);
}
@@ -3210,7 +3212,7 @@
EnumElementImpl(String name, int offset) : super(name, offset);
EnumElementImpl.forLinkedNode(CompilationUnitElementImpl enclosing,
- Reference reference, EnumDeclaration linkedNode)
+ Reference reference, EnumDeclarationImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
linkedNode.name.staticElement = this;
}
@@ -3441,9 +3443,9 @@
ExecutableElementImpl.forLinkedNode(
ElementImpl enclosing, Reference reference, AstNode? linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
- if (linkedNode is MethodDeclaration) {
+ if (linkedNode is MethodDeclarationImpl) {
linkedNode.name.staticElement = this;
- } else if (linkedNode is FunctionDeclaration) {
+ } else if (linkedNode is FunctionDeclarationImpl) {
linkedNode.name.staticElement = this;
}
}
@@ -3690,7 +3692,7 @@
ExportElementImpl(int offset) : super(null, offset);
ExportElementImpl.forLinkedNode(
- LibraryElementImpl enclosing, ExportDirective linkedNode)
+ LibraryElementImpl enclosing, ExportDirectiveImpl linkedNode)
: super.forLinkedNode(enclosing, null, linkedNode) {
linkedNode.element = this;
}
@@ -4106,7 +4108,7 @@
FieldElementImpl.forLinkedNode(
ElementImpl enclosing, Reference reference, AstNode linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
- if (linkedNode is VariableDeclaration) {
+ if (linkedNode is VariableDeclarationImpl) {
linkedNode.name.staticElement = this;
}
if (!linkedNode.isSynthetic) {
@@ -4210,8 +4212,8 @@
FieldFormalParameterElementImpl(String name, int nameOffset)
: super(name, nameOffset);
- FieldFormalParameterElementImpl.forLinkedNode(
- ElementImpl enclosing, Reference? reference, FormalParameter linkedNode)
+ FieldFormalParameterElementImpl.forLinkedNode(ElementImpl enclosing,
+ Reference? reference, FormalParameterImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode);
@override
@@ -4262,7 +4264,7 @@
FunctionElementImpl(String name, int offset) : super(name, offset);
FunctionElementImpl.forLinkedNode(ElementImpl enclosing, Reference reference,
- FunctionDeclaration linkedNode)
+ FunctionDeclarationImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
linkedNode.name.staticElement = this;
}
@@ -4604,7 +4606,7 @@
ImportElementImpl(int offset) : super(null, offset);
ImportElementImpl.forLinkedNode(
- LibraryElementImpl enclosing, ImportDirective linkedNode)
+ LibraryElementImpl enclosing, ImportDirectiveImpl linkedNode)
: super.forLinkedNode(enclosing, null, linkedNode) {
linkedNode.element = this;
}
@@ -5415,7 +5417,7 @@
MethodElementImpl(String name, int offset) : super(name, offset);
MethodElementImpl.forLinkedNode(TypeParameterizedElementMixin enclosingClass,
- Reference reference, MethodDeclaration linkedNode)
+ Reference reference, MethodDeclarationImpl linkedNode)
: super.forLinkedNode(enclosingClass, reference, linkedNode) {
linkedNode.name.staticElement = this;
}
@@ -5497,7 +5499,7 @@
MixinElementImpl(String name, int offset) : super(name, offset);
MixinElementImpl.forLinkedNode(CompilationUnitElementImpl enclosing,
- Reference reference, MixinDeclaration linkedNode)
+ Reference reference, MixinDeclarationImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
linkedNode.name.staticElement = this;
}
@@ -6005,15 +6007,15 @@
/// [nameOffset].
ParameterElementImpl(String? name, int nameOffset) : super(name, nameOffset);
- ParameterElementImpl.forLinkedNode(
- ElementImpl enclosing, Reference? reference, FormalParameter linkedNode)
+ ParameterElementImpl.forLinkedNode(ElementImpl enclosing,
+ Reference? reference, FormalParameterImpl linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
assert(linkedNode.isNamed || reference == null);
FormalParameterImpl.setDeclaredElement(linkedNode, this);
}
factory ParameterElementImpl.forLinkedNodeFactory(
- ElementImpl enclosing, Reference? reference, FormalParameter node) {
+ ElementImpl enclosing, Reference? reference, FormalParameterImpl node) {
if (node is FieldFormalParameter) {
return FieldFormalParameterElementImpl.forLinkedNode(
enclosing,
@@ -6190,8 +6192,9 @@
if (typeParameters == null) {
return _typeParameters = const [];
}
- return _typeParameters =
- typeParameters.typeParameters.map<TypeParameterElement>((node) {
+ return _typeParameters = typeParameters.typeParameters
+ .cast<TypeParameterImpl>()
+ .map<TypeParameterElement>((node) {
var element = node.declaredElement;
element ??= TypeParameterElementImpl.forLinkedNode(this, node);
return element;
@@ -6243,7 +6246,7 @@
return element;
}
- if (node is DefaultFormalParameter) {
+ if (node is DefaultFormalParameterImpl) {
NormalFormalParameter parameterNode = node.parameter;
Reference? reference;
if (node.isNamed) {
@@ -6265,7 +6268,8 @@
);
}
} else {
- return ParameterElementImpl.forLinkedNodeFactory(enclosing, null, node);
+ return ParameterElementImpl.forLinkedNodeFactory(
+ enclosing, null, node as FormalParameterImpl);
}
}).toList();
}
@@ -6885,7 +6889,7 @@
TopLevelVariableElementImpl.forLinkedNode(
ElementImpl enclosing, Reference reference, AstNode linkedNode)
: super.forLinkedNode(enclosing, reference, linkedNode) {
- if (linkedNode is VariableDeclaration) {
+ if (linkedNode is VariableDeclarationImpl) {
linkedNode.name.staticElement = this;
}
if (!linkedNode.isSynthetic) {
@@ -6968,9 +6972,9 @@
Reference reference,
TypeAlias linkedNode,
) : super.forLinkedNode(enclosingUnit, reference, linkedNode) {
- var nameNode = linkedNode is FunctionTypeAlias
+ var nameNode = linkedNode is FunctionTypeAliasImpl
? linkedNode.name
- : (linkedNode as GenericTypeAlias).name;
+ : (linkedNode as GenericTypeAliasImpl).name;
nameNode.staticElement = this;
}
@@ -7223,7 +7227,7 @@
TypeParameterElementImpl(String name, int offset) : super(name, offset);
TypeParameterElementImpl.forLinkedNode(
- ElementImpl enclosing, TypeParameter linkedNode)
+ ElementImpl enclosing, TypeParameterImpl linkedNode)
: super.forLinkedNode(enclosing, null, linkedNode) {
linkedNode.name.staticElement = this;
}
@@ -7364,8 +7368,9 @@
if (typeParameters == null) {
return _typeParameterElements = const [];
}
- return _typeParameterElements =
- typeParameters.typeParameters.map<TypeParameterElement>((node) {
+ return _typeParameterElements = typeParameters.typeParameters
+ .cast<TypeParameterImpl>()
+ .map<TypeParameterElement>((node) {
var element = node.declaredElement;
element ??= TypeParameterElementImpl.forLinkedNode(this, node);
return element;
diff --git a/pkg/analyzer/lib/src/dart/micro/library_analyzer.dart b/pkg/analyzer/lib/src/dart/micro/library_analyzer.dart
index dad5a81..2886408 100644
--- a/pkg/analyzer/lib/src/dart/micro/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/micro/library_analyzer.dart
@@ -106,7 +106,7 @@
required OperationPerformanceImpl performance,
}) {
var forCompletion = completionPath != null;
- var units = <FileState, CompilationUnit>{};
+ var units = <FileState, CompilationUnitImpl>{};
// Parse all files.
performance.run('parse', (performance) {
@@ -485,7 +485,7 @@
}
/// Return a parsed unresolved [CompilationUnit].
- CompilationUnit _parse({
+ CompilationUnitImpl _parse({
required FileState file,
required OperationPerformanceImpl performance,
}) {
@@ -495,7 +495,7 @@
performance.getDataInt('length').add(content.length);
AnalysisErrorListener errorListener = _getErrorListener(file);
- CompilationUnit unit = file.parse(errorListener, content);
+ var unit = file.parse(errorListener, content);
LineInfo lineInfo = unit.lineInfo!;
_fileToLineInfo[file] = lineInfo;
@@ -505,7 +505,7 @@
}
void _resolveDirectives(
- Map<FileState, CompilationUnit> units,
+ Map<FileState, CompilationUnitImpl> units,
String? completionPath,
) {
if (completionPath != null) {
@@ -540,7 +540,7 @@
return;
}
- CompilationUnit definingCompilationUnit = units[_library]!;
+ var definingCompilationUnit = units[_library]!;
definingCompilationUnit.element = _libraryElement.definingCompilationUnit;
bool matchNodeElement(Directive node, Element element) {
@@ -551,13 +551,13 @@
LibraryIdentifier? libraryNameNode;
var seenPartSources = <Source>{};
- var directivesToResolve = <Directive>[];
+ var directivesToResolve = <DirectiveImpl>[];
int partIndex = 0;
for (Directive directive in definingCompilationUnit.directives) {
- if (directive is LibraryDirective) {
+ if (directive is LibraryDirectiveImpl) {
libraryNameNode = directive.name;
directivesToResolve.add(directive);
- } else if (directive is ImportDirective) {
+ } else if (directive is ImportDirectiveImpl) {
for (ImportElement importElement in _libraryElement.imports) {
if (matchNodeElement(directive, importElement)) {
directive.element = importElement;
@@ -570,7 +570,7 @@
}
}
}
- } else if (directive is ExportDirective) {
+ } else if (directive is ExportDirectiveImpl) {
for (ExportElement exportElement in _libraryElement.exports) {
if (matchNodeElement(directive, exportElement)) {
directive.element = exportElement;
@@ -583,11 +583,11 @@
}
}
}
- } else if (directive is PartDirective) {
+ } else if (directive is PartDirectiveImpl) {
StringLiteral partUri = directive.uri;
FileState partFile = _library.partedFiles[partIndex];
- CompilationUnit partUnit = units[partFile]!;
+ var partUnit = units[partFile]!;
CompilationUnitElement partElement = _libraryElement.parts[partIndex];
partUnit.element = partElement;
directive.element = partElement;
@@ -652,7 +652,7 @@
//
// Resolve the relevant directives to the library element.
//
- for (Directive directive in directivesToResolve) {
+ for (var directive in directivesToResolve) {
directive.element = _libraryElement;
}
@@ -753,8 +753,8 @@
}
void _resolveUriBasedDirectives(FileState file, CompilationUnit unit) {
- for (Directive directive in unit.directives) {
- if (directive is UriBasedDirective) {
+ for (var directive in unit.directives) {
+ if (directive is UriBasedDirectiveImpl) {
StringLiteral uriLiteral = directive.uri;
var uriContent = uriLiteral.stringValue?.trim();
directive.uriContent = uriContent;
diff --git a/pkg/analyzer/lib/src/dart/micro/library_graph.dart b/pkg/analyzer/lib/src/dart/micro/library_graph.dart
index eba5e3b..376a4c6 100644
--- a/pkg/analyzer/lib/src/dart/micro/library_graph.dart
+++ b/pkg/analyzer/lib/src/dart/micro/library_graph.dart
@@ -175,7 +175,8 @@
_libraryCycle = cycle;
}
- CompilationUnit parse(AnalysisErrorListener errorListener, String content) {
+ CompilationUnitImpl parse(
+ AnalysisErrorListener errorListener, String content) {
CharSequenceReader reader = CharSequenceReader(content);
Scanner scanner = Scanner(source, reader, errorListener)
..configureFeatures(
@@ -196,7 +197,7 @@
featureSet: scanner.featureSet,
);
parser.enableOptionalNewAndConst = true;
- CompilationUnit unit = parser.parseCompilationUnit(token);
+ var unit = parser.parseCompilationUnit(token);
unit.lineInfo = lineInfo;
// StringToken uses a static instance of StringCanonicalizer, so we need
@@ -204,8 +205,7 @@
StringToken.canonicalizer.clear();
// TODO(scheglov) Use actual versions.
- var unitImpl = unit as CompilationUnitImpl;
- unitImpl.languageVersion = LibraryLanguageVersion(
+ unit.languageVersion = LibraryLanguageVersion(
package: ExperimentStatus.currentVersion,
override: null,
);
diff --git a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
index fbbd960..7294a2a 100644
--- a/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/annotation_resolver.dart
@@ -6,6 +6,7 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/constant/utilities.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -22,7 +23,7 @@
ErrorReporter get _errorReporter => _resolver.errorReporter;
- void resolve(Annotation node) {
+ void resolve(AnnotationImpl node) {
AstNode parent = node.parent;
_resolve1(node);
@@ -63,10 +64,10 @@
);
}
- void _resolve1(Annotation node) {
+ void _resolve1(AnnotationImpl node) {
var nodeName = node.name;
- if (nodeName is PrefixedIdentifier) {
+ if (nodeName is PrefixedIdentifierImpl) {
var prefix = nodeName.prefix;
var identifier = nodeName.identifier;
@@ -111,7 +112,7 @@
identifier.staticElement = element;
}
} else {
- var identifier = nodeName as SimpleIdentifier;
+ var identifier = nodeName as SimpleIdentifierImpl;
var resolver = PropertyElementResolver(_resolver);
var result = resolver.resolveSimpleIdentifier(
@@ -136,7 +137,7 @@
}
void _resolveAnnotationConstructorInvocationArguments(
- Annotation annotation, ConstructorElement constructor) {
+ AnnotationImpl annotation, ConstructorElement constructor) {
var argumentList = annotation.arguments;
// error will be reported in ConstantVerifier
if (argumentList == null) {
@@ -150,12 +151,12 @@
}
/// Continues resolution of the given [annotation].
- void _resolveAnnotationElement(Annotation annotation) {
+ void _resolveAnnotationElement(AnnotationImpl annotation) {
late final SimpleIdentifier nameNode1;
- SimpleIdentifier? nameNode2;
+ SimpleIdentifierImpl? nameNode2;
{
Identifier annName = annotation.name;
- if (annName is PrefixedIdentifier) {
+ if (annName is PrefixedIdentifierImpl) {
nameNode1 = annName.prefix;
nameNode2 = annName.identifier;
} else {
@@ -163,7 +164,7 @@
nameNode2 = null;
}
}
- SimpleIdentifier? nameNode3 = annotation.constructorName;
+ SimpleIdentifierImpl? nameNode3 = annotation.constructorName;
ConstructorElement? constructor;
bool undefined = false;
//
diff --git a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
index 26596c8..a2428b1 100644
--- a/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/ast_rewrite.dart
@@ -3,11 +3,12 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/scope.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/error/codes.dart';
@@ -109,7 +110,7 @@
);
}
}
- } else if (target is PrefixedIdentifier) {
+ } else if (target is PrefixedIdentifierImpl) {
// Possible case: p.C.n()
var prefixElement = nameScope.lookup(target.prefix.name).getter;
target.prefix.staticElement = prefixElement;
diff --git a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
index ecc92f7..7fd4b29 100644
--- a/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/binary_expression_resolver.dart
@@ -78,7 +78,7 @@
///
/// TODO(scheglov) this is duplicate
void _analyzeLeastUpperBoundTypes(
- Expression node, DartType staticType1, DartType staticType2) {
+ ExpressionImpl node, DartType staticType1, DartType staticType2) {
var staticType = _typeSystem.getLeastUpperBound(staticType1, staticType2);
staticType = _resolver.toLegacyTypeIfOptOut(staticType);
@@ -264,7 +264,7 @@
}
void _resolveUserDefinableElement(
- BinaryExpression node,
+ BinaryExpressionImpl node,
String methodName, {
bool promoteLeftTypeToNonNull = false,
}) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart
index 3b2ef9e..abb6f0a 100644
--- a/pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/function_expression_resolver.dart
@@ -5,6 +5,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/element/type_system.dart';
@@ -34,7 +35,7 @@
TypeSystemImpl get _typeSystem => _resolver.typeSystem;
- void resolve(FunctionExpression node) {
+ void resolve(FunctionExpressionImpl node) {
var isFunctionDeclaration = node.parent is FunctionDeclaration;
var body = node.body;
@@ -174,7 +175,7 @@
}).toList());
}
- void _resolve2(FunctionExpression node) {
+ void _resolve2(FunctionExpressionImpl node) {
var functionElement = node.declaredElement as ExecutableElementImpl;
if (_shouldUpdateReturnType(node)) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
index e825a4a..1ee93cf 100644
--- a/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/invocation_inference_helper.dart
@@ -85,10 +85,10 @@
/// This takes into account both the context type, as well as information from
/// the argument types.
void inferGenericInvocationExpression(
- InvocationExpression node,
+ InvocationExpressionImpl node,
DartType? type,
) {
- ArgumentList arguments = node.argumentList;
+ var arguments = node.argumentList;
var freshType = _getFreshType(type);
var inferred = inferGenericInvoke(
@@ -180,7 +180,7 @@
/// @param type the static type of the node
///
/// TODO(scheglov) this is duplication
- void recordStaticType(Expression expression, DartType type) {
+ void recordStaticType(ExpressionImpl expression, DartType type) {
var hooks = _migrationResolutionHooks;
if (hooks != null) {
type = hooks.modifyExpressionType(expression, type);
@@ -325,7 +325,7 @@
required FunctionType rawType,
required DartType? contextType,
required TypeArgumentList? typeArgumentList,
- required ArgumentList argumentList,
+ required ArgumentListImpl argumentList,
required bool isConst,
required AstNode errorNode,
}) {
@@ -426,7 +426,7 @@
}
void _setCorrespondingParameters(
- ArgumentList argumentList,
+ ArgumentListImpl argumentList,
FunctionType invokeType,
) {
var parameters = ResolverVisitor.resolveArgumentsToParameters(
diff --git a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
index b0d3816..77429cb 100644
--- a/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/method_invocation_resolver.dart
@@ -3,11 +3,11 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/scope.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
@@ -83,7 +83,7 @@
void resolve(MethodInvocationImpl node) {
_invocation = node;
- SimpleIdentifier nameNode = node.methodName;
+ var nameNode = node.methodName;
String name = nameNode.name;
_currentName = Name(_definingLibraryUri, name);
@@ -210,7 +210,7 @@
}
}
- void _reportInvocationOfNonFunction(MethodInvocation node) {
+ void _reportInvocationOfNonFunction(MethodInvocationImpl node) {
_setDynamicResolution(node, setNameTypeToDynamic: false);
_resolver.errorReporter.reportErrorForNode(
CompileTimeErrorCode.INVOCATION_OF_NON_FUNCTION,
@@ -239,7 +239,7 @@
}
void _reportUndefinedFunction(
- MethodInvocation node, {
+ MethodInvocationImpl node, {
required String? prefix,
required String name,
}) {
@@ -257,7 +257,7 @@
}
void _reportUndefinedMethod(
- MethodInvocation node, String name, ClassElement typeReference) {
+ MethodInvocationImpl node, String name, ClassElement typeReference) {
_setDynamicResolution(node);
_resolver.errorReporter.reportErrorForNode(
CompileTimeErrorCode.UNDEFINED_METHOD,
@@ -266,7 +266,7 @@
);
}
- void _reportUseOfVoidType(MethodInvocation node, AstNode errorNode) {
+ void _reportUseOfVoidType(MethodInvocationImpl node, AstNode errorNode) {
_setDynamicResolution(node);
_resolver.errorReporter.reportErrorForNode(
CompileTimeErrorCode.USE_OF_VOID_RESULT,
@@ -276,7 +276,7 @@
/// [InvocationExpression.staticInvokeType] has been set for the [node].
/// Use it to set context for arguments, and resolve them.
- void _resolveArguments(MethodInvocation node) {
+ void _resolveArguments(MethodInvocationImpl node) {
// TODO(scheglov) This is bad, don't write raw type, carry it
_inferenceHelper.inferArgumentTypesForInvocation(
node,
@@ -285,7 +285,7 @@
node.argumentList.accept(_resolver);
}
- void _resolveArguments_finishInference(MethodInvocation node) {
+ void _resolveArguments_finishInference(MethodInvocationImpl node) {
_resolveArguments(node);
// TODO(scheglov) This is bad, don't put / get raw FunctionType this way.
@@ -318,8 +318,8 @@
return null;
}
- void _resolveExtensionMember(MethodInvocation node, Identifier receiver,
- ExtensionElement extension, SimpleIdentifier nameNode, String name) {
+ void _resolveExtensionMember(MethodInvocationImpl node, Identifier receiver,
+ ExtensionElement extension, SimpleIdentifierImpl nameNode, String name) {
var getter = extension.getGetter(name);
if (getter != null) {
getter = _resolver.toLegacyElement(getter);
@@ -346,8 +346,8 @@
);
}
- void _resolveExtensionOverride(MethodInvocation node,
- ExtensionOverride override, SimpleIdentifier nameNode, String name) {
+ void _resolveExtensionOverride(MethodInvocationImpl node,
+ ExtensionOverride override, SimpleIdentifierImpl nameNode, String name) {
var result = _extensionResolver.getOverrideMember(override, name);
var member = _resolver.toLegacyElement(result.getter);
@@ -385,7 +385,7 @@
_setResolution(node, member.type);
}
- void _resolveReceiverDynamicBounded(MethodInvocation node) {
+ void _resolveReceiverDynamicBounded(MethodInvocationImpl node) {
var nameNode = node.methodName;
var objectElement = _typeSystem.typeProvider.objectElement;
@@ -415,10 +415,10 @@
}
void _resolveReceiverFunctionBounded(
- MethodInvocation node,
+ MethodInvocationImpl node,
Expression receiver,
DartType receiverType,
- SimpleIdentifier nameNode,
+ SimpleIdentifierImpl nameNode,
String name,
) {
if (name == FunctionElement.CALL_METHOD_NAME) {
@@ -441,7 +441,7 @@
}
void _resolveReceiverNever(
- MethodInvocation node,
+ MethodInvocationImpl node,
Expression receiver,
DartType receiverType,
) {
@@ -492,7 +492,7 @@
}
void _resolveReceiverNull(
- MethodInvocation node, SimpleIdentifier nameNode, String name) {
+ MethodInvocationImpl node, SimpleIdentifierImpl nameNode, String name) {
var element = nameScope.lookup(name).getter;
if (element != null) {
element = _resolver.toLegacyElement(element);
@@ -543,8 +543,8 @@
);
}
- void _resolveReceiverPrefix(MethodInvocation node, PrefixElement prefix,
- SimpleIdentifier nameNode, String name) {
+ void _resolveReceiverPrefix(MethodInvocationImpl node, PrefixElement prefix,
+ SimpleIdentifierImpl nameNode, String name) {
// Note: prefix?.bar is reported as an error in ElementResolver.
if (name == FunctionElement.LOAD_LIBRARY_NAME) {
@@ -584,8 +584,8 @@
);
}
- void _resolveReceiverSuper(MethodInvocation node, SuperExpression receiver,
- SimpleIdentifier nameNode, String name) {
+ void _resolveReceiverSuper(MethodInvocationImpl node,
+ SuperExpression receiver, SimpleIdentifierImpl nameNode, String name) {
var enclosingClass = _resolver.enclosingClass;
if (SuperContext.of(receiver) != SuperContext.valid) {
_setDynamicResolution(node);
@@ -633,10 +633,10 @@
}
void _resolveReceiverType({
- required MethodInvocation node,
+ required MethodInvocationImpl node,
required Expression? receiver,
required DartType receiverType,
- required SimpleIdentifier nameNode,
+ required SimpleIdentifierImpl nameNode,
required String name,
required Expression receiverErrorNode,
}) {
@@ -688,8 +688,8 @@
}
}
- void _resolveReceiverTypeLiteral(MethodInvocation node, ClassElement receiver,
- SimpleIdentifier nameNode, String name) {
+ void _resolveReceiverTypeLiteral(MethodInvocationImpl node,
+ ClassElement receiver, SimpleIdentifierImpl nameNode, String name) {
if (node.isCascaded) {
receiver = _typeType.element;
}
@@ -728,18 +728,19 @@
/// an [InterfaceType]. So, it should be represented as instead as a
/// [FunctionExpressionInvocation].
void _rewriteAsFunctionExpressionInvocation(
- MethodInvocation node,
+ MethodInvocationImpl node,
DartType getterReturnType,
) {
var targetType = _resolveTypeParameter(getterReturnType);
node.methodName.staticType = targetType;
- Expression functionExpression;
+ ExpressionImpl functionExpression;
var target = node.target;
if (target == null) {
functionExpression = node.methodName;
} else {
- if (target is SimpleIdentifier && target.staticElement is PrefixElement) {
+ if (target is SimpleIdentifierImpl &&
+ target.staticElement is PrefixElement) {
functionExpression = astFactory.prefixedIdentifier(
target,
node.operator!,
@@ -768,7 +769,7 @@
_resolver.flowAnalysis?.transferTestData(node, invocation);
}
- void _setDynamicResolution(MethodInvocation node,
+ void _setDynamicResolution(MethodInvocationImpl node,
{bool setNameTypeToDynamic = true}) {
if (setNameTypeToDynamic) {
node.methodName.staticType = _dynamicType;
@@ -794,7 +795,7 @@
}
}
- void _setResolution(MethodInvocation node, DartType type) {
+ void _setResolution(MethodInvocationImpl node, DartType type) {
// TODO(scheglov) We need this for StaticTypeAnalyzer to run inference.
// But it seems weird. Do we need to know the raw type of a function?!
node.methodName.staticType = type;
@@ -805,8 +806,7 @@
}
if (type is FunctionType) {
- _inferenceHelper.resolveMethodInvocation(
- node: node as MethodInvocationImpl, rawType: type);
+ _inferenceHelper.resolveMethodInvocation(node: node, rawType: type);
return;
}
@@ -821,7 +821,8 @@
/// this method resolver. If we rewrite a [MethodInvocation] node, this
/// method will return the resulting [FunctionExpressionInvocation], so
/// that the resolver visitor will know to continue resolving this new node.
- static FunctionExpressionInvocation? getRewriteResult(MethodInvocation node) {
+ static FunctionExpressionInvocation? getRewriteResult(
+ MethodInvocationImpl node) {
return node.getProperty(_rewriteResultKey);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
index 39ae692..e8adbbb 100644
--- a/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/postfix_expression_resolver.dart
@@ -118,7 +118,7 @@
}
}
- void _resolve1(PostfixExpression node, DartType receiverType) {
+ void _resolve1(PostfixExpressionImpl node, DartType receiverType) {
Expression operand = node.operand;
if (identical(receiverType, NeverTypeImpl.instance)) {
@@ -155,7 +155,7 @@
}
}
- void _resolve2(PostfixExpression node, DartType receiverType) {
+ void _resolve2(PostfixExpressionImpl node, DartType receiverType) {
Expression operand = node.operand;
if (identical(receiverType, NeverTypeImpl.instance)) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart
index 60ee85e..99ed1ac 100644
--- a/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/prefix_expression_resolver.dart
@@ -131,7 +131,7 @@
/// @param type the static type of the node
///
/// TODO(scheglov) this is duplicate
- void _recordStaticType(Expression expression, DartType type) {
+ void _recordStaticType(ExpressionImpl expression, DartType type) {
_inferenceHelper.recordStaticType(expression, type);
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart
index 56da5f9..b24466b 100644
--- a/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/prefixed_identifier_resolver.dart
@@ -5,6 +5,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/element/type_provider.dart';
@@ -22,7 +23,7 @@
TypeProviderImpl get _typeProvider => _resolver.typeProvider;
- void resolve(PrefixedIdentifier node) {
+ void resolve(PrefixedIdentifierImpl node) {
node.prefix.accept(_resolver);
var resolver = PropertyElementResolver(_resolver);
@@ -140,19 +141,19 @@
/// @param type the static type of the node
///
/// TODO(scheglov) this is duplicate
- void _recordStaticType(Expression expression, DartType type) {
+ void _recordStaticType(ExpressionImpl expression, DartType type) {
_inferenceHelper.recordStaticType(expression, type);
}
/// TODO(scheglov) this is duplicate
- void _setExtensionIdentifierType(Identifier node) {
- if (node is SimpleIdentifier && node.inDeclarationContext()) {
+ void _setExtensionIdentifierType(IdentifierImpl node) {
+ if (node is SimpleIdentifierImpl && node.inDeclarationContext()) {
return;
}
var parent = node.parent;
- if (parent is PrefixedIdentifier && parent.identifier == node) {
+ if (parent is PrefixedIdentifierImpl && parent.identifier == node) {
node = parent;
parent = node.parent;
}
@@ -160,7 +161,7 @@
if (parent is CommentReference ||
parent is ExtensionOverride && parent.extensionName == node ||
parent is MethodInvocation && parent.target == node ||
- parent is PrefixedIdentifier && parent.prefix == node ||
+ parent is PrefixedIdentifierImpl && parent.prefix == node ||
parent is PropertyAccess && parent.target == node) {
return;
}
@@ -171,7 +172,7 @@
[node.name],
);
- if (node is PrefixedIdentifier) {
+ if (node is PrefixedIdentifierImpl) {
node.identifier.staticType = DynamicTypeImpl.instance;
node.staticType = DynamicTypeImpl.instance;
} else if (node is SimpleIdentifier) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
index 250d438..49c88e6 100644
--- a/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/resolution_visitor.dart
@@ -156,7 +156,7 @@
}
@override
- void visitCatchClause(CatchClause node) {
+ void visitCatchClause(covariant CatchClauseImpl node) {
var exceptionTypeNode = node.exceptionType;
exceptionTypeNode?.accept(this);
@@ -210,7 +210,7 @@
}
@override
- void visitClassDeclaration(ClassDeclaration node) {
+ void visitClassDeclaration(covariant ClassDeclarationImpl node) {
ClassElementImpl element = _elementWalker!.getClass();
node.name.staticElement = element;
_typeNameResolver.enclosingClass = element;
@@ -246,7 +246,7 @@
}
@override
- void visitClassTypeAlias(ClassTypeAlias node) {
+ void visitClassTypeAlias(covariant ClassTypeAliasImpl node) {
ClassElementImpl element = _elementWalker!.getClass();
node.name.staticElement = element;
_typeNameResolver.enclosingClass = element;
@@ -304,7 +304,7 @@
}
@override
- void visitDeclaredIdentifier(DeclaredIdentifier node) {
+ void visitDeclaredIdentifier(covariant DeclaredIdentifierImpl node) {
var nameNode = node.identifier;
var element = LocalVariableElementImpl(nameNode.name, nameNode.offset);
_elementHolder.enclose(element);
@@ -329,8 +329,8 @@
@override
void visitDefaultFormalParameter(covariant DefaultFormalParameterImpl node) {
- NormalFormalParameter normalParameter = node.parameter;
- SimpleIdentifier? nameNode = normalParameter.identifier;
+ var normalParameter = node.parameter;
+ var nameNode = normalParameter.identifier;
ParameterElementImpl element;
if (_elementWalker != null) {
@@ -352,7 +352,7 @@
element.isFinal = node.isFinal;
element.parameterKind = node.kind;
- if (normalParameter is SimpleFormalParameter &&
+ if (normalParameter is SimpleFormalParameterImpl &&
normalParameter.type == null) {
element.hasImplicitType = true;
}
@@ -377,7 +377,8 @@
}
@override
- void visitEnumConstantDeclaration(EnumConstantDeclaration node) {
+ void visitEnumConstantDeclaration(
+ covariant EnumConstantDeclarationImpl node) {
var element = _elementWalker!.getVariable();
node.name.staticElement = element;
@@ -386,7 +387,7 @@
}
@override
- void visitEnumDeclaration(EnumDeclaration node) {
+ void visitEnumDeclaration(covariant EnumDeclarationImpl node) {
EnumElementImpl element = _elementWalker!.getEnum();
node.name.staticElement = element;
@@ -499,7 +500,7 @@
}
@override
- void visitFunctionDeclaration(FunctionDeclaration node) {
+ void visitFunctionDeclaration(covariant FunctionDeclarationImpl node) {
ExecutableElementImpl element;
if (_elementWalker != null) {
element = node.isGetter || node.isSetter
@@ -525,7 +526,7 @@
}
}
- var expression = node.functionExpression as FunctionExpressionImpl;
+ var expression = node.functionExpression;
expression.declaredElement = element;
node.metadata.accept(this);
@@ -564,7 +565,8 @@
}
@override
- void visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
+ void visitFunctionDeclarationStatement(
+ covariant FunctionDeclarationStatementImpl node) {
if (!_hasLocalElementsBuilt(node)) {
_buildLocalFunctionElement(node);
}
@@ -604,7 +606,7 @@
}
@override
- void visitFunctionTypeAlias(FunctionTypeAlias node) {
+ void visitFunctionTypeAlias(covariant FunctionTypeAliasImpl node) {
var element = _elementWalker!.getTypedef();
node.name.staticElement = element;
@@ -629,7 +631,7 @@
if (node.parent is DefaultFormalParameter) {
element = node.declaredElement as ParameterElementImpl;
} else {
- SimpleIdentifier nameNode = node.identifier;
+ var nameNode = node.identifier;
if (_elementWalker != null) {
element = _elementWalker!.getParameter();
} else {
@@ -717,7 +719,7 @@
}
@override
- void visitGenericTypeAlias(GenericTypeAlias node) {
+ void visitGenericTypeAlias(covariant GenericTypeAliasImpl node) {
var element = _elementWalker!.getTypedef();
node.name.staticElement = element;
@@ -774,13 +776,14 @@
_setElementAnnotations(node.metadata, node.element!.metadata);
} else {
for (var annotation in node.metadata) {
+ annotation as AnnotationImpl;
annotation.elementAnnotation = ElementAnnotationImpl(_unitElement);
}
}
}
@override
- void visitMethodDeclaration(MethodDeclaration node) {
+ void visitMethodDeclaration(covariant MethodDeclarationImpl node) {
ExecutableElementImpl element = node.isGetter || node.isSetter
? _elementWalker!.getAccessor()
: _elementWalker!.getFunction();
@@ -818,7 +821,7 @@
}
@override
- void visitMixinDeclaration(MixinDeclaration node) {
+ void visitMixinDeclaration(covariant MixinDeclarationImpl node) {
var element = _elementWalker!.getMixin();
node.name.staticElement = element;
@@ -916,7 +919,7 @@
}
@override
- void visitTypeName(TypeName node) {
+ void visitTypeName(covariant TypeNameImpl node) {
node.typeArguments?.accept(this);
_typeNameResolver.nameScope = _nameScope;
@@ -944,7 +947,7 @@
}
@override
- void visitVariableDeclaration(VariableDeclaration node) {
+ void visitVariableDeclaration(covariant VariableDeclarationImpl node) {
var initializerNode = node.initializer;
VariableElementImpl element;
@@ -1007,7 +1010,8 @@
/// element holder.
void _buildLabelElements(
List<Label> labels, bool onSwitchStatement, bool onSwitchMember) {
- for (Label label in labels) {
+ for (var label in labels) {
+ label as LabelImpl;
var labelName = label.label;
var element = LabelElementImpl(
labelName.name,
@@ -1022,7 +1026,7 @@
void _buildLocalElements(List<Statement> statements) {
for (var statement in statements) {
- if (statement is FunctionDeclarationStatement) {
+ if (statement is FunctionDeclarationStatementImpl) {
_buildLocalFunctionElement(statement);
} else if (statement is VariableDeclarationStatement) {
_buildLocalVariableElements(statement.variables);
@@ -1030,7 +1034,8 @@
}
}
- void _buildLocalFunctionElement(FunctionDeclarationStatement statement) {
+ void _buildLocalFunctionElement(
+ covariant FunctionDeclarationStatementImpl statement) {
var node = statement.functionDeclaration;
var nameNode = node.name;
var element = FunctionElementImpl(nameNode.name, nameNode.offset);
@@ -1044,6 +1049,7 @@
var isFinal = variableList.isFinal;
var isLate = variableList.isLate;
for (var variable in variableList.variables) {
+ variable as VariableDeclarationImpl;
var variableName = variable.name;
LocalVariableElementImpl element;
@@ -1075,6 +1081,7 @@
if (typeParameterList == null) return;
for (var typeParameter in typeParameterList.typeParameters) {
+ typeParameter as TypeParameterImpl;
var name = typeParameter.name;
TypeParameterElementImpl element;
@@ -1099,9 +1106,10 @@
if (annotations.isEmpty) {
return const <ElementAnnotation>[];
}
- return annotations.map((Annotation a) {
+ return annotations.map((annotation) {
+ annotation as AnnotationImpl;
var elementAnnotation = ElementAnnotationImpl(_unitElement);
- a.elementAnnotation = elementAnnotation;
+ annotation.elementAnnotation = elementAnnotation;
return elementAnnotation;
}).toList();
}
@@ -1178,7 +1186,7 @@
/// The flag [asClass] specifies if the type will be used as a class, so mixin
/// declarations are not valid (they declare interfaces and mixins, but not
/// classes).
- void _resolveType(TypeName typeName, ErrorCode errorCode,
+ void _resolveType(TypeNameImpl typeName, ErrorCode errorCode,
{bool asClass = false}) {
_typeNameResolver.classHierarchy_typeName = typeName;
visitTypeName(typeName);
@@ -1212,8 +1220,8 @@
/// @param dynamicTypeError the error to produce if the type name is "dynamic"
/// @return an array containing all of the types that were resolved.
void _resolveTypes(NodeList<TypeName> typeNames, ErrorCode errorCode) {
- for (TypeName typeName in typeNames) {
- _resolveType(typeName, errorCode);
+ for (var typeName in typeNames) {
+ _resolveType(typeName as TypeNameImpl, errorCode);
}
}
@@ -1223,7 +1231,7 @@
for (var typeName in clause.mixinTypes) {
_typeNameResolver.withClause_typeName = typeName;
_resolveType(
- typeName,
+ typeName as TypeNameImpl,
CompileTimeErrorCode.MIXIN_OF_NON_CLASS,
);
_typeNameResolver.withClause_typeName = null;
@@ -1287,7 +1295,7 @@
);
}
for (int i = 0; i < nodeCount; i++) {
- nodes[i].elementAnnotation = annotations[i];
+ (nodes[i] as AnnotationImpl).elementAnnotation = annotations[i];
}
}
}
diff --git a/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart
index 9cb37d0..fb7dbb0 100644
--- a/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/simple_identifier_resolver.dart
@@ -7,6 +7,7 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/element/type_provider.dart';
@@ -29,7 +30,7 @@
TypeProviderImpl get _typeProvider => _resolver.typeProvider;
- void resolve(SimpleIdentifier node) {
+ void resolve(SimpleIdentifierImpl node) {
if (node.inDeclarationContext()) {
return;
}
@@ -110,7 +111,7 @@
/// @param type the static type of the node
///
/// TODO(scheglov) this is duplicate
- void _recordStaticType(Expression expression, DartType type) {
+ void _recordStaticType(ExpressionImpl expression, DartType type) {
var hooks = _resolver.migrationResolutionHooks;
if (hooks != null) {
type = hooks.modifyExpressionType(expression, type);
@@ -122,7 +123,7 @@
}
}
- void _resolve1(SimpleIdentifier node) {
+ void _resolve1(SimpleIdentifierImpl node) {
//
// Synthetic identifiers have been already reported during parsing.
//
@@ -213,7 +214,7 @@
node.staticElement = element;
}
- void _resolve2(SimpleIdentifier node) {
+ void _resolve2(SimpleIdentifierImpl node) {
var element = node.staticElement;
if (element is ExtensionElement) {
@@ -260,14 +261,14 @@
}
/// TODO(scheglov) this is duplicate
- void _setExtensionIdentifierType(Identifier node) {
- if (node is SimpleIdentifier && node.inDeclarationContext()) {
+ void _setExtensionIdentifierType(IdentifierImpl node) {
+ if (node is SimpleIdentifierImpl && node.inDeclarationContext()) {
return;
}
var parent = node.parent;
- if (parent is PrefixedIdentifier && parent.identifier == node) {
+ if (parent is PrefixedIdentifierImpl && parent.identifier == node) {
node = parent;
parent = node.parent;
}
@@ -275,7 +276,7 @@
if (parent is CommentReference ||
parent is ExtensionOverride && parent.extensionName == node ||
parent is MethodInvocation && parent.target == node ||
- parent is PrefixedIdentifier && parent.prefix == node ||
+ parent is PrefixedIdentifierImpl && parent.prefix == node ||
parent is PropertyAccess && parent.target == node) {
return;
}
@@ -286,7 +287,7 @@
[node.name],
);
- if (node is PrefixedIdentifier) {
+ if (node is PrefixedIdentifierImpl) {
node.identifier.staticType = DynamicTypeImpl.instance;
node.staticType = DynamicTypeImpl.instance;
} else if (node is SimpleIdentifier) {
diff --git a/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart
index c019b77..fe60568 100644
--- a/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/type_name_resolver.dart
@@ -64,11 +64,11 @@
/// given [node] is resolved, all its children must be already resolved.
///
/// The client must set [nameScope] before calling [resolveTypeName].
- void resolveTypeName(TypeName node) {
+ void resolveTypeName(TypeNameImpl node) {
rewriteResult = null;
var typeIdentifier = node.name;
- if (typeIdentifier is PrefixedIdentifier) {
+ if (typeIdentifier is PrefixedIdentifierImpl) {
var prefix = typeIdentifier.prefix;
var prefixName = prefix.name;
var prefixElement = nameScope.lookup(prefixName).getter;
@@ -101,7 +101,7 @@
);
node.type = dynamicType;
} else {
- var nameNode = typeIdentifier as SimpleIdentifier;
+ var nameNode = typeIdentifier as SimpleIdentifierImpl;
var name = nameNode.name;
if (name == 'void') {
@@ -271,7 +271,7 @@
}
}
- void _resolveToElement(TypeName node, Element? element) {
+ void _resolveToElement(TypeNameImpl node, Element? element) {
if (element == null) {
node.type = dynamicType;
if (!nameScope.shouldIgnoreUndefined(node.name)) {
@@ -294,11 +294,12 @@
/// will be a [PrefixElement]. But when we resolved the `prefix` it turned
/// out to be a [ClassElement], so it is probably a `Class.constructor`.
void _rewriteToConstructorName(
- TypeName node,
+ TypeNameImpl node,
PrefixedIdentifier typeIdentifier,
) {
var constructorName = node.parent;
- if (constructorName is ConstructorName && constructorName.name == null) {
+ if (constructorName is ConstructorNameImpl &&
+ constructorName.name == null) {
var classIdentifier = typeIdentifier.prefix;
var constructorIdentifier = typeIdentifier.identifier;
diff --git a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
index e873a1b..8e659b2 100644
--- a/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/typed_literal_resolver.dart
@@ -70,7 +70,7 @@
: NullabilitySuffix.star;
}
- void resolveListLiteral(ListLiteral node) {
+ void resolveListLiteral(ListLiteralImpl node) {
InterfaceType? listType;
var typeArguments = node.typeArguments?.arguments;
@@ -644,7 +644,7 @@
/// @param type the static type of the node
///
/// TODO(scheglov) Inline this.
- void _recordStaticType(Expression expression, DartType type) {
+ void _recordStaticType(ExpressionImpl expression, DartType type) {
expression.staticType = type;
// if (type == null) {
// expression.staticType = _dynamicType;
@@ -656,7 +656,7 @@
// }
}
- void _resolveListLiteral2(ListLiteral node) {
+ void _resolveListLiteral2(ListLiteralImpl node) {
var typeArguments = node.typeArguments?.arguments;
// If we have explicit arguments, use them.
@@ -691,7 +691,7 @@
_recordStaticType(node, listDynamicType);
}
- void _resolveSetOrMapLiteral2(SetOrMapLiteral node) {
+ void _resolveSetOrMapLiteral2(SetOrMapLiteralImpl node) {
var typeArguments = node.typeArguments?.arguments;
// If we have type arguments, use them.
@@ -699,7 +699,7 @@
// ResolverVisitor._fromTypeArguments
if (typeArguments != null) {
if (typeArguments.length == 1) {
- (node as SetOrMapLiteralImpl).becomeSet();
+ node.becomeSet();
var elementType = typeArguments[0].type!;
_recordStaticType(
node,
@@ -710,7 +710,7 @@
);
return;
} else if (typeArguments.length == 2) {
- (node as SetOrMapLiteralImpl).becomeMap();
+ node.becomeMap();
var keyType = typeArguments[0].type!;
var valueType = typeArguments[1].type!;
_recordStaticType(
@@ -730,10 +730,10 @@
// The literal is ambiguous, and further analysis won't resolve the
// ambiguity. Leave it as neither a set nor a map.
} else if (literalType.element == _typeProvider.mapElement) {
- (node as SetOrMapLiteralImpl).becomeMap();
+ node.becomeMap();
} else {
assert(literalType.element == _typeProvider.setElement);
- (node as SetOrMapLiteralImpl).becomeSet();
+ node.becomeSet();
}
if (_strictInference &&
_getSetOrMapElements(node).isEmpty &&
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 3718053..9b9b7af 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -54,8 +54,6 @@
import 'package:_fe_analyzer_shared/src/scanner/token_constants.dart';
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory;
-import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard;
import 'package:analyzer/dart/ast/token.dart' show Token, TokenType;
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/dart/analysis/experiments.dart';
@@ -64,8 +62,13 @@
ClassDeclarationImpl,
CompilationUnitImpl,
ExtensionDeclarationImpl,
+ ImportDirectiveImpl,
+ MethodInvocationImpl,
MixinDeclarationImpl,
+ SimpleIdentifierImpl,
+ TypeArgumentListImpl,
TypeParameterImpl;
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/fasta/error_converter.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:analyzer/src/summary2/ast_binary_tokens.dart';
@@ -76,7 +79,7 @@
/// A parser listener that builds the analyzer's AST structure.
class AstBuilder extends StackListener {
- final AstFactory ast = standard.astFactory;
+ final AstFactoryImpl ast = astFactory;
final FastaErrorReporter errorReporter;
final Uri fileUri;
@@ -248,7 +251,7 @@
leftBracket: Tokens.OPEN_CURLY_BRACKET,
rightBracket: Tokens.CLOSE_CURLY_BRACKET,
members: [],
- ) as ExtensionDeclarationImpl;
+ );
declarations.add(extensionDeclaration!);
}
@@ -517,7 +520,7 @@
} else {
push(ast.propertyAccess(receiver, dot, identifierOrInvoke));
}
- } else if (identifierOrInvoke is MethodInvocation) {
+ } else if (identifierOrInvoke is MethodInvocationImpl) {
assert(identifierOrInvoke.target == null);
identifierOrInvoke
..target = receiver
@@ -537,9 +540,9 @@
}
void doInvocation(
- TypeArgumentList? typeArguments, MethodInvocation arguments) {
+ TypeArgumentList? typeArguments, MethodInvocationImpl arguments) {
var receiver = pop() as Expression;
- if (receiver is SimpleIdentifier) {
+ if (receiver is SimpleIdentifierImpl) {
arguments.methodName = receiver;
if (typeArguments != null) {
arguments.typeArguments = typeArguments;
@@ -1023,7 +1026,7 @@
directives: directives,
declarations: declarations,
endToken: endToken,
- featureSet: _featureSet) as CompilationUnitImpl;
+ featureSet: _featureSet);
push(unit);
}
@@ -2515,7 +2518,7 @@
Tokens.OPEN_CURLY_BRACKET, // leftBracket
<ClassMember>[],
Tokens.CLOSE_CURLY_BRACKET, // rightBracket
- ) as ClassDeclarationImpl;
+ );
classDeclaration!.nativeClause = nativeClause;
declarations.add(classDeclaration!);
@@ -3146,7 +3149,7 @@
Tokens.OPEN_CURLY_BRACKET, // leftBracket
<ClassMember>[],
Tokens.CLOSE_CURLY_BRACKET, // rightBracket
- ) as MixinDeclarationImpl;
+ );
declarations.add(mixinDeclaration!);
}
@@ -3320,7 +3323,7 @@
var implementsClause = pop(NullValue.IdentifierList) as ImplementsClause?;
var withClause = pop(NullValue.WithClause) as WithClause?;
var extendsClause = pop(NullValue.ExtendsClause) as ExtendsClause?;
- var declaration = declarations.last as ClassDeclaration;
+ var declaration = declarations.last as ClassDeclarationImpl;
if (extendsClause != null) {
if (declaration.extendsClause?.superclass == null) {
declaration.extendsClause = extendsClause;
@@ -3354,7 +3357,7 @@
var prefix = pop(NullValue.Prefix) as SimpleIdentifier?;
var configurations = pop() as List<Configuration>?;
- var directive = directives.last as ImportDirective;
+ var directive = directives.last as ImportDirectiveImpl;
if (combinators != null) {
directive.combinators.addAll(combinators);
}
@@ -3406,8 +3409,8 @@
void handleSend(Token beginToken, Token endToken) {
debugEvent("Send");
- var arguments = pop() as MethodInvocation?;
- var typeArguments = pop() as TypeArgumentList?;
+ var arguments = pop() as MethodInvocationImpl?;
+ var typeArguments = pop() as TypeArgumentListImpl?;
if (arguments != null) {
doInvocation(typeArguments, arguments);
} else {
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 48c3f46..7b163a73 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -120,7 +120,7 @@
TypeProviderImpl get _typeProvider => _resolver.typeProvider;
@override
- void visitBreakStatement(BreakStatement node) {
+ void visitBreakStatement(covariant BreakStatementImpl node) {
node.target = _lookupBreakOrContinueTarget(node, node.label, false);
}
@@ -135,9 +135,9 @@
}
@override
- void visitCommentReference(CommentReference node) {
- Identifier identifier = node.identifier;
- if (identifier is SimpleIdentifier) {
+ void visitCommentReference(covariant CommentReferenceImpl node) {
+ var identifier = node.identifier;
+ if (identifier is SimpleIdentifierImpl) {
var element = _resolveSimpleIdentifier(identifier);
if (element == null) {
// TODO(brianwilkerson) Report this error?
@@ -163,12 +163,12 @@
}
}
}
- } else if (identifier is PrefixedIdentifier) {
- SimpleIdentifier prefix = identifier.prefix;
+ } else if (identifier is PrefixedIdentifierImpl) {
+ var prefix = identifier.prefix;
var prefixElement = _resolveSimpleIdentifier(prefix);
prefix.staticElement = prefixElement;
- SimpleIdentifier name = identifier.identifier;
+ var name = identifier.identifier;
if (prefixElement == null) {
// resolver.reportError(CompileTimeErrorCode.UNDEFINED_IDENTIFIER, prefix, prefix.getName());
@@ -235,15 +235,16 @@
}
@override
- void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
- SimpleIdentifier fieldName = node.fieldName;
+ void visitConstructorFieldInitializer(
+ covariant ConstructorFieldInitializerImpl node) {
+ var fieldName = node.fieldName;
ClassElement enclosingClass = _resolver.enclosingClass!;
var fieldElement = enclosingClass.getField(fieldName.name);
fieldName.staticElement = fieldElement;
}
@override
- void visitConstructorName(ConstructorName node) {
+ void visitConstructorName(covariant ConstructorNameImpl node) {
DartType type = node.type.type!;
if (type.isDynamic) {
// Nothing to do.
@@ -276,7 +277,7 @@
}
@override
- void visitContinueStatement(ContinueStatement node) {
+ void visitContinueStatement(covariant ContinueStatementImpl node) {
node.target = _lookupBreakOrContinueTarget(node, node.label, true);
}
@@ -344,7 +345,7 @@
}
@override
- void visitImportDirective(ImportDirective node) {
+ void visitImportDirective(covariant ImportDirectiveImpl node) {
var prefixNode = node.prefix;
if (prefixNode != null) {
String prefixName = prefixNode.name;
@@ -370,9 +371,10 @@
}
@override
- void visitInstanceCreationExpression(InstanceCreationExpression node) {
+ void visitInstanceCreationExpression(
+ covariant InstanceCreationExpressionImpl node) {
var invokedConstructor = node.constructorName.staticElement;
- ArgumentList argumentList = node.argumentList;
+ var argumentList = node.argumentList;
var parameters =
_resolveArgumentsToFunction(argumentList, invokedConstructor);
if (parameters != null) {
@@ -407,7 +409,7 @@
@override
void visitRedirectingConstructorInvocation(
- RedirectingConstructorInvocation node) {
+ covariant RedirectingConstructorInvocationImpl node) {
var enclosingClass = _resolver.enclosingClass;
if (enclosingClass == null) {
// TODO(brianwilkerson) Report this error.
@@ -429,7 +431,7 @@
name.staticElement = element;
}
node.staticElement = element;
- ArgumentList argumentList = node.argumentList;
+ var argumentList = node.argumentList;
var parameters = _resolveArgumentsToFunction(argumentList, element);
if (parameters != null) {
argumentList.correspondingStaticParameters = parameters;
@@ -442,7 +444,8 @@
}
@override
- void visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+ void visitSuperConstructorInvocation(
+ covariant SuperConstructorInvocationImpl node) {
var enclosingClass = _resolver.enclosingClass;
if (enclosingClass == null) {
// TODO(brianwilkerson) Report this error.
@@ -491,7 +494,7 @@
_resolver.nameScope.shouldIgnoreUndefined(superclassName)) {
return;
}
- ArgumentList argumentList = node.argumentList;
+ var argumentList = node.argumentList;
var parameters = _resolveArgumentsToFunction(argumentList, element);
if (parameters != null) {
argumentList.correspondingStaticParameters = parameters;
@@ -532,7 +535,7 @@
/// that statement (if any). The flag [isContinue] is `true` if the node being
/// visited is a continue statement.
AstNode? _lookupBreakOrContinueTarget(
- AstNode parentNode, SimpleIdentifier? labelNode, bool isContinue) {
+ AstNode parentNode, SimpleIdentifierImpl? labelNode, bool isContinue) {
if (labelNode == null) {
return _resolver.implicitLabelScope.getTarget(isContinue);
} else {
@@ -611,7 +614,8 @@
} else {
names = (combinator as ShowCombinator).shownNames;
}
- for (SimpleIdentifier name in names) {
+ for (var name in names) {
+ name as SimpleIdentifierImpl;
String nameStr = name.name;
var element = namespace.get(nameStr) ?? namespace.get("$nameStr=");
if (element != null) {
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 99e3884..a00a27d 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -10,6 +10,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
@@ -186,14 +187,14 @@
Expression parseBitwiseXorExpression() => parseExpression2();
- CompilationUnit parseCompilationUnit(Token token) {
+ CompilationUnitImpl parseCompilationUnit(Token token) {
currentToken = token;
return parseCompilationUnit2();
}
- CompilationUnit parseCompilationUnit2() {
+ CompilationUnitImpl parseCompilationUnit2() {
currentToken = fastaParser.parseUnit(currentToken);
- return astBuilder.pop() as CompilationUnit;
+ return astBuilder.pop() as CompilationUnitImpl;
}
Expression parseConditionalExpression() => parseExpression2();
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 581f6e1..5f3f78f 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -583,7 +583,8 @@
/// If we reached a null-shorting termination, and the [node] has null
/// shorting, make the type of the [node] nullable.
- void nullShortingTermination(Expression node, {bool discardType = false}) {
+ void nullShortingTermination(ExpressionImpl node,
+ {bool discardType = false}) {
if (!_isNonNullableByDefault) return;
if (identical(_unfinishedNullShorts.last, node)) {
@@ -858,7 +859,7 @@
}
@override
- void visitAnnotation(Annotation node) {
+ void visitAnnotation(covariant AnnotationImpl node) {
AstNode parent = node.parent;
if (identical(parent, _enclosingClassDeclaration) ||
identical(parent, _enclosingFunctionTypeAlias) ||
@@ -1030,7 +1031,7 @@
}
@override
- void visitCascadeExpression(CascadeExpression node) {
+ void visitCascadeExpression(covariant CascadeExpressionImpl node) {
InferenceContext.setTypeFromNode(node.target, node);
node.target.accept(this);
@@ -1493,7 +1494,7 @@
}
@override
- void visitFunctionExpression(FunctionExpression node) {
+ void visitFunctionExpression(covariant FunctionExpressionImpl node) {
var outerFunction = _enclosingFunction;
_enclosingFunction = node.declaredElement!;
@@ -1630,7 +1631,7 @@
}
@override
- void visitIndexExpression(IndexExpression node) {
+ void visitIndexExpression(covariant IndexExpressionImpl node) {
node.target?.accept(this);
startNullAwareIndexExpression(node);
@@ -1661,7 +1662,8 @@
}
@override
- void visitInstanceCreationExpression(InstanceCreationExpression node) {
+ void visitInstanceCreationExpression(
+ covariant InstanceCreationExpressionImpl node) {
node.constructorName.accept(this);
_inferArgumentTypesForInstanceCreate(node);
node.argumentList.accept(this);
@@ -1689,7 +1691,7 @@
void visitLibraryIdentifier(LibraryIdentifier node) {}
@override
- void visitListLiteral(ListLiteral node) {
+ void visitListLiteral(covariant ListLiteralImpl node) {
checkUnreachableNode(node);
_typedLiteralResolver.resolveListLiteral(node);
}
@@ -1730,14 +1732,14 @@
}
@override
- void visitMethodInvocation(MethodInvocation node) {
+ void visitMethodInvocation(covariant MethodInvocationImpl node) {
var target = node.target;
target?.accept(this);
if (_migratableAstInfoProvider.isMethodInvocationNullAware(node)) {
var flow = flowAnalysis?.flow;
if (flow != null) {
- if (target is SimpleIdentifier &&
+ if (target is SimpleIdentifierImpl &&
target.staticElement is ClassElement) {
// `?.` to access static methods is equivalent to `.`, so do nothing.
} else {
@@ -1817,7 +1819,7 @@
}
@override
- void visitPrefixedIdentifier(PrefixedIdentifier node) {
+ void visitPrefixedIdentifier(covariant PrefixedIdentifierImpl node) {
_prefixedIdentifierResolver.resolve(node);
}
@@ -1827,7 +1829,7 @@
}
@override
- void visitPropertyAccess(PropertyAccess node) {
+ void visitPropertyAccess(covariant PropertyAccessImpl node) {
node.target?.accept(this);
startNullAwarePropertyAccess(node);
@@ -1905,7 +1907,7 @@
void visitShowCombinator(ShowCombinator node) {}
@override
- void visitSimpleIdentifier(SimpleIdentifier node) {
+ void visitSimpleIdentifier(covariant SimpleIdentifierImpl node) {
SimpleIdentifierResolver(this, flowAnalysis).resolve(node);
}
@@ -2161,8 +2163,9 @@
return false;
}
- void _inferArgumentTypesForInstanceCreate(InstanceCreationExpression node) {
- ConstructorName constructor = node.constructorName;
+ void _inferArgumentTypesForInstanceCreate(
+ covariant InstanceCreationExpressionImpl node) {
+ var constructor = node.constructorName;
TypeName classTypeName = constructor.type;
// if (classTypeName == null) {
// return;
@@ -2199,7 +2202,7 @@
isConst: node.isConst, errorNode: node.constructorName);
if (inferred != null) {
- ArgumentList arguments = node.argumentList;
+ var arguments = node.argumentList;
InferenceContext.setType(arguments, inferred);
// Fix up the parameter elements based on inferred method.
arguments.correspondingStaticParameters =
@@ -2305,8 +2308,8 @@
Expression? firstUnresolvedArgument;
for (int i = 0; i < argumentCount; i++) {
Expression argument = arguments[i];
- if (argument is NamedExpression) {
- SimpleIdentifier nameNode = argument.name.label;
+ if (argument is NamedExpressionImpl) {
+ var nameNode = argument.name.label;
String name = nameNode.name;
var element = namedParameters != null ? namedParameters[name] : null;
if (element == null) {
@@ -2393,7 +2396,7 @@
migrationResolutionHooks);
@override
- void visitConditionalExpression(ConditionalExpression node) {
+ void visitConditionalExpression(covariant ConditionalExpressionImpl node) {
var conditionalKnownValue =
_migrationResolutionHooks.getConditionalKnownValue(node);
if (conditionalKnownValue == null) {
@@ -3230,7 +3233,7 @@
}
@override
- void visitSimpleIdentifier(SimpleIdentifier node) {
+ void visitSimpleIdentifier(covariant SimpleIdentifierImpl node) {
// Ignore if already resolved - declaration or type.
if (node.inDeclarationContext()) {
return;
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 9ca8628..45632ba 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -76,7 +76,7 @@
/// @param type the static type of the node
///
/// TODO(scheglov) this is duplication
- void recordStaticType(Expression expression, DartType type) {
+ void recordStaticType(ExpressionImpl expression, DartType type) {
var hooks = _migrationResolutionHooks;
if (hooks != null) {
type = hooks.modifyExpressionType(expression, type);
@@ -91,7 +91,7 @@
/// The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is
/// `String`.</blockquote>
@override
- void visitAdjacentStrings(AdjacentStrings node) {
+ void visitAdjacentStrings(covariant AdjacentStringsImpl node) {
recordStaticType(node, _typeProvider.stringType);
}
@@ -102,7 +102,7 @@
///
/// The static type of a cast expression <i>e as T</i> is <i>T</i>.</blockquote>
@override
- void visitAsExpression(AsExpression node) {
+ void visitAsExpression(covariant AsExpressionImpl node) {
recordStaticType(node, _getType(node.type));
}
@@ -111,7 +111,7 @@
/// The static type of [the expression "await e"] is flatten(T) where T is
/// the static type of e.
@override
- void visitAwaitExpression(AwaitExpression node) {
+ void visitAwaitExpression(covariant AwaitExpressionImpl node) {
var resultType = node.expression.typeOrThrow;
resultType = _typeSystem.flatten(resultType);
recordStaticType(node, resultType);
@@ -120,7 +120,7 @@
/// The Dart Language Specification, 12.4: <blockquote>The static type of a boolean literal is
/// bool.</blockquote>
@override
- void visitBooleanLiteral(BooleanLiteral node) {
+ void visitBooleanLiteral(covariant BooleanLiteralImpl node) {
recordStaticType(node, _typeProvider.boolType);
}
@@ -128,7 +128,7 @@
/// of the form <i>e..suffix</i> is equivalent to the expression <i>(t) {t.suffix; return
/// t;}(e)</i>.</blockquote>
@override
- void visitCascadeExpression(CascadeExpression node) {
+ void visitCascadeExpression(covariant CascadeExpressionImpl node) {
recordStaticType(node, node.target.typeOrThrow);
}
@@ -140,14 +140,14 @@
/// The static type of <i>c</i> is the least upper bound of the static type of <i>e<sub>2</sub></i>
/// and the static type of <i>e<sub>3</sub></i>.</blockquote>
@override
- void visitConditionalExpression(ConditionalExpression node) {
+ void visitConditionalExpression(covariant ConditionalExpressionImpl node) {
_analyzeLeastUpperBound(node, node.thenExpression, node.elseExpression);
}
/// The Dart Language Specification, 12.3: <blockquote>The static type of a literal double is
/// double.</blockquote>
@override
- void visitDoubleLiteral(DoubleLiteral node) {
+ void visitDoubleLiteral(covariant DoubleLiteralImpl node) {
recordStaticType(node, _typeProvider.doubleType);
}
@@ -195,7 +195,8 @@
/// expression of either the form <i>const T.id(a<sub>1</sub>, …, a<sub>n</sub>)</i> or the
/// form <i>const T(a<sub>1</sub>, …, a<sub>n</sub>)</i> is <i>T</i>. </blockquote>
@override
- void visitInstanceCreationExpression(InstanceCreationExpression node) {
+ void visitInstanceCreationExpression(
+ covariant InstanceCreationExpressionImpl node) {
_inferInstanceCreationExpression(node);
recordStaticType(node, node.constructorName.type.type!);
}
@@ -234,7 +235,7 @@
///
/// The static type of an is-expression is `bool`.</blockquote>
@override
- void visitIsExpression(IsExpression node) {
+ void visitIsExpression(covariant IsExpressionImpl node) {
recordStaticType(node, _typeProvider.boolType);
}
@@ -244,7 +245,7 @@
}
@override
- void visitNamedExpression(NamedExpression node) {
+ void visitNamedExpression(covariant NamedExpressionImpl node) {
Expression expression = node.expression;
recordStaticType(node, expression.typeOrThrow);
}
@@ -252,12 +253,13 @@
/// The Dart Language Specification, 12.2: <blockquote>The static type of `null` is bottom.
/// </blockquote>
@override
- void visitNullLiteral(NullLiteral node) {
+ void visitNullLiteral(covariant NullLiteralImpl node) {
recordStaticType(node, _typeProvider.nullType);
}
@override
- void visitParenthesizedExpression(ParenthesizedExpression node) {
+ void visitParenthesizedExpression(
+ covariant ParenthesizedExpressionImpl node) {
Expression expression = node.expression;
recordStaticType(node, expression.typeOrThrow);
}
@@ -265,26 +267,26 @@
/// The Dart Language Specification, 12.9: <blockquote>The static type of a rethrow expression is
/// bottom.</blockquote>
@override
- void visitRethrowExpression(RethrowExpression node) {
+ void visitRethrowExpression(covariant RethrowExpressionImpl node) {
recordStaticType(node, _typeProvider.bottomType);
}
/// The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is
/// `String`.</blockquote>
@override
- void visitSimpleStringLiteral(SimpleStringLiteral node) {
+ void visitSimpleStringLiteral(covariant SimpleStringLiteralImpl node) {
recordStaticType(node, _typeProvider.stringType);
}
/// The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is
/// `String`.</blockquote>
@override
- void visitStringInterpolation(StringInterpolation node) {
+ void visitStringInterpolation(covariant StringInterpolationImpl node) {
recordStaticType(node, _typeProvider.stringType);
}
@override
- void visitSuperExpression(SuperExpression node) {
+ void visitSuperExpression(covariant SuperExpressionImpl node) {
var thisType = _resolver.thisType;
_resolver.flowAnalysis?.flow?.thisOrSuper(node, thisType ?? _dynamicType);
if (thisType == null ||
@@ -298,14 +300,14 @@
}
@override
- void visitSymbolLiteral(SymbolLiteral node) {
+ void visitSymbolLiteral(covariant SymbolLiteralImpl node) {
recordStaticType(node, _typeProvider.symbolType);
}
/// The Dart Language Specification, 12.10: <blockquote>The static type of `this` is the
/// interface of the immediately enclosing class.</blockquote>
@override
- void visitThisExpression(ThisExpression node) {
+ void visitThisExpression(covariant ThisExpressionImpl node) {
var thisType = _resolver.thisType;
_resolver.flowAnalysis?.flow?.thisOrSuper(node, thisType ?? _dynamicType);
if (thisType == null) {
@@ -320,14 +322,14 @@
/// The Dart Language Specification, 12.8: <blockquote>The static type of a throw expression is
/// bottom.</blockquote>
@override
- void visitThrowExpression(ThrowExpression node) {
+ void visitThrowExpression(covariant ThrowExpressionImpl node) {
recordStaticType(node, _typeProvider.bottomType);
}
/// Set the static type of [node] to be the least upper bound of the static
/// types of subexpressions [expr1] and [expr2].
void _analyzeLeastUpperBound(
- Expression node, Expression expr1, Expression expr2) {
+ ExpressionImpl node, Expression expr1, Expression expr2) {
var staticType1 = expr1.typeOrThrow;
var staticType2 = expr2.typeOrThrow;
@@ -337,7 +339,7 @@
/// Set the static type of [node] to be the least upper bound of the static
/// types [staticType1] and [staticType2].
void _analyzeLeastUpperBoundTypes(
- Expression node, DartType staticType1, DartType staticType2) {
+ ExpressionImpl node, DartType staticType1, DartType staticType2) {
DartType staticType =
_typeSystem.getLeastUpperBound(staticType1, staticType2);
@@ -359,8 +361,8 @@
/// Given an instance creation of a possibly generic type, infer the type
/// arguments using the current context type as well as the argument types.
- void _inferInstanceCreationExpression(InstanceCreationExpression node) {
- ConstructorName constructor = node.constructorName;
+ void _inferInstanceCreationExpression(InstanceCreationExpressionImpl node) {
+ var constructor = node.constructorName;
var originalElement = constructor.staticElement;
// If the constructor is generic, we'll have a ConstructorMember that
// substitutes in type arguments (possibly `dynamic`) from earlier in
@@ -387,7 +389,7 @@
FunctionType constructorType = constructorToGenericFunctionType(rawElement);
- ArgumentList arguments = node.argumentList;
+ var arguments = node.argumentList;
var inferred = _resolver.inferenceHelper.inferGenericInvoke(
node,
constructorType,
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 2815129..7a9229d 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_test_factory.dart
@@ -4,10 +4,10 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/generated/testing/token_factory.dart';
@@ -27,13 +27,13 @@
/// such as using 'identifier' rather than 'prefixedIdentifier', or 'integer'
/// rather than 'integerLiteral'.
class AstTestFactory {
- static AdjacentStrings adjacentStrings(List<StringLiteral> strings) =>
+ static AdjacentStringsImpl adjacentStrings(List<StringLiteral> strings) =>
astFactory.adjacentStrings(strings);
- static Annotation annotation(Identifier name) => astFactory.annotation(
+ static AnnotationImpl annotation(Identifier name) => astFactory.annotation(
atSign: TokenFactory.tokenFromType(TokenType.AT), name: name);
- static Annotation annotation2(Identifier name,
+ static AnnotationImpl annotation2(Identifier name,
SimpleIdentifier? constructorName, ArgumentList arguments,
{TypeArgumentList? typeArguments}) =>
astFactory.annotation(
@@ -46,16 +46,17 @@
constructorName: constructorName,
arguments: arguments);
- static ArgumentList argumentList([List<Expression> arguments = const []]) =>
+ static ArgumentListImpl argumentList(
+ [List<Expression> arguments = const []]) =>
astFactory.argumentList(TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
arguments, TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
- static AsExpression asExpression(
+ static AsExpressionImpl asExpression(
Expression expression, TypeAnnotation type) =>
astFactory.asExpression(
expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
- static AssertInitializer assertInitializer(
+ static AssertInitializerImpl assertInitializer(
Expression condition, Expression message) =>
astFactory.assertInitializer(
TokenFactory.tokenFromKeyword(Keyword.ASSERT),
@@ -65,7 +66,7 @@
message,
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
- static AssertStatement assertStatement(Expression condition,
+ static AssertStatementImpl assertStatement(Expression condition,
[Expression? message]) =>
astFactory.assertStatement(
TokenFactory.tokenFromKeyword(Keyword.ASSERT),
@@ -76,19 +77,19 @@
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static AssignmentExpression assignmentExpression(Expression leftHandSide,
+ static AssignmentExpressionImpl assignmentExpression(Expression leftHandSide,
TokenType operator, Expression rightHandSide) =>
astFactory.assignmentExpression(
leftHandSide, TokenFactory.tokenFromType(operator), rightHandSide);
- static BlockFunctionBody asyncBlockFunctionBody(
+ static BlockFunctionBodyImpl asyncBlockFunctionBody(
[List<Statement> statements = const []]) =>
astFactory.blockFunctionBody(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
null,
block(statements));
- static ExpressionFunctionBody asyncExpressionFunctionBody(
+ static ExpressionFunctionBodyImpl asyncExpressionFunctionBody(
Expression expression) =>
astFactory.expressionFunctionBody(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
@@ -96,52 +97,54 @@
expression,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static BlockFunctionBody asyncGeneratorBlockFunctionBody(
+ static BlockFunctionBodyImpl asyncGeneratorBlockFunctionBody(
[List<Statement> statements = const []]) =>
astFactory.blockFunctionBody(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
TokenFactory.tokenFromType(TokenType.STAR),
block(statements));
- static AwaitExpression awaitExpression(Expression expression) =>
+ static AwaitExpressionImpl awaitExpression(Expression expression) =>
astFactory.awaitExpression(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "await"),
expression);
- static BinaryExpression binaryExpression(Expression leftOperand,
+ static BinaryExpressionImpl binaryExpression(Expression leftOperand,
TokenType operator, Expression rightOperand) =>
astFactory.binaryExpression(
leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
- static Block block([List<Statement> statements = const []]) =>
+ static BlockImpl block([List<Statement> statements = const []]) =>
astFactory.block(
TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
statements,
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static BlockFunctionBody blockFunctionBody(Block block) =>
+ static BlockFunctionBodyImpl blockFunctionBody(Block block) =>
astFactory.blockFunctionBody(null, null, block);
- static BlockFunctionBody blockFunctionBody2(
+ static BlockFunctionBodyImpl blockFunctionBody2(
[List<Statement> statements = const []]) =>
astFactory.blockFunctionBody(null, null, block(statements));
- static BooleanLiteral booleanLiteral(bool value) => astFactory.booleanLiteral(
- value
- ? TokenFactory.tokenFromKeyword(Keyword.TRUE)
- : TokenFactory.tokenFromKeyword(Keyword.FALSE),
- value);
+ static BooleanLiteralImpl booleanLiteral(
+ bool value) =>
+ astFactory.booleanLiteral(
+ value
+ ? TokenFactory.tokenFromKeyword(Keyword.TRUE)
+ : TokenFactory.tokenFromKeyword(Keyword.FALSE),
+ value);
- static BreakStatement breakStatement() => astFactory.breakStatement(
+ static BreakStatementImpl breakStatement() => astFactory.breakStatement(
TokenFactory.tokenFromKeyword(Keyword.BREAK),
null,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static BreakStatement breakStatement2(String label) =>
+ static BreakStatementImpl breakStatement2(String label) =>
astFactory.breakStatement(TokenFactory.tokenFromKeyword(Keyword.BREAK),
identifier3(label), TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static IndexExpression cascadedIndexExpression(Expression index) =>
+ static IndexExpressionImpl cascadedIndexExpression(Expression index) =>
astFactory.indexExpressionForCascade2(
period: TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
leftBracket:
@@ -150,7 +153,7 @@
rightBracket:
TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
- static MethodInvocation cascadedMethodInvocation(String methodName,
+ static MethodInvocationImpl cascadedMethodInvocation(String methodName,
[List<Expression> arguments = const []]) =>
astFactory.methodInvocation(
null,
@@ -159,38 +162,38 @@
null,
argumentList(arguments));
- static PropertyAccess cascadedPropertyAccess(String propertyName) =>
+ static PropertyAccessImpl cascadedPropertyAccess(String propertyName) =>
astFactory.propertyAccess(
null,
TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
identifier3(propertyName));
- static CascadeExpression cascadeExpression(Expression target,
+ static CascadeExpressionImpl cascadeExpression(Expression target,
[List<Expression> cascadeSections = const []]) {
var cascade = astFactory.cascadeExpression(target, cascadeSections);
cascade.target.endToken.next = cascadeSections.first.beginToken;
return cascade;
}
- static CatchClause catchClause(String exceptionParameter,
+ static CatchClauseImpl catchClause(String exceptionParameter,
[List<Statement> statements = const []]) =>
catchClause5(null, exceptionParameter, null, statements);
- static CatchClause catchClause2(
+ static CatchClauseImpl catchClause2(
String exceptionParameter, String stackTraceParameter,
[List<Statement> statements = const []]) =>
catchClause5(null, exceptionParameter, stackTraceParameter, statements);
- static CatchClause catchClause3(TypeAnnotation exceptionType,
+ static CatchClauseImpl catchClause3(TypeAnnotation exceptionType,
[List<Statement> statements = const []]) =>
catchClause5(exceptionType, null, null, statements);
- static CatchClause catchClause4(
+ static CatchClauseImpl catchClause4(
TypeAnnotation exceptionType, String exceptionParameter,
[List<Statement> statements = const []]) =>
catchClause5(exceptionType, exceptionParameter, null, statements);
- static CatchClause catchClause5(TypeAnnotation? exceptionType,
+ static CatchClauseImpl catchClause5(TypeAnnotation? exceptionType,
String? exceptionParameter, String? stackTraceParameter,
[List<Statement> statements = const []]) =>
astFactory.catchClause(
@@ -214,7 +217,7 @@
: TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
block(statements));
- static ClassDeclaration classDeclaration(
+ static ClassDeclarationImpl classDeclaration(
Keyword? abstractKeyword,
String name,
TypeParameterList? typeParameters,
@@ -238,7 +241,7 @@
members,
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static ClassTypeAlias classTypeAlias(
+ static ClassTypeAliasImpl classTypeAlias(
String name,
TypeParameterList? typeParameters,
Keyword? abstractKeyword,
@@ -260,31 +263,32 @@
implementsClause,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static CompilationUnit compilationUnit() => compilationUnit8(null, [], []);
+ static CompilationUnitImpl compilationUnit() =>
+ compilationUnit8(null, [], []);
- static CompilationUnit compilationUnit2(
+ static CompilationUnitImpl compilationUnit2(
List<CompilationUnitMember> declarations) =>
compilationUnit8(null, [], declarations);
- static CompilationUnit compilationUnit3(List<Directive> directives) =>
+ static CompilationUnitImpl compilationUnit3(List<Directive> directives) =>
compilationUnit8(null, directives, []);
- static CompilationUnit compilationUnit4(List<Directive> directives,
+ static CompilationUnitImpl compilationUnit4(List<Directive> directives,
List<CompilationUnitMember> declarations) =>
compilationUnit8(null, directives, declarations);
- static CompilationUnit compilationUnit5(String scriptTag) =>
+ static CompilationUnitImpl compilationUnit5(String scriptTag) =>
compilationUnit8(scriptTag, [], []);
- static CompilationUnit compilationUnit6(
+ static CompilationUnitImpl compilationUnit6(
String scriptTag, List<CompilationUnitMember> declarations) =>
compilationUnit8(scriptTag, [], declarations);
- static CompilationUnit compilationUnit7(
+ static CompilationUnitImpl compilationUnit7(
String scriptTag, List<Directive> directives) =>
compilationUnit8(scriptTag, directives, []);
- static CompilationUnit compilationUnit8(
+ static CompilationUnitImpl compilationUnit8(
String? scriptTag,
List<Directive> directives,
List<CompilationUnitMember> declarations) =>
@@ -297,7 +301,7 @@
endToken: TokenFactory.tokenFromType(TokenType.EOF),
featureSet: FeatureSet.latestLanguageVersion());
- static CompilationUnit compilationUnit9(
+ static CompilationUnitImpl compilationUnit9(
{String? scriptTag,
List<Directive> directives = const [],
List<CompilationUnitMember> declarations = const [],
@@ -311,7 +315,7 @@
endToken: TokenFactory.tokenFromType(TokenType.EOF),
featureSet: featureSet);
- static ConditionalExpression conditionalExpression(Expression condition,
+ static ConditionalExpressionImpl conditionalExpression(Expression condition,
Expression thenExpression, Expression elseExpression) =>
astFactory.conditionalExpression(
condition,
@@ -320,7 +324,7 @@
TokenFactory.tokenFromType(TokenType.COLON),
elseExpression);
- static ConstructorDeclaration constructorDeclaration(
+ static ConstructorDeclarationImpl constructorDeclaration(
Identifier returnType,
String? name,
FormalParameterList parameters,
@@ -342,7 +346,7 @@
null,
emptyFunctionBody());
- static ConstructorDeclaration constructorDeclaration2(
+ static ConstructorDeclarationImpl constructorDeclaration2(
Keyword? constKeyword,
Keyword? factoryKeyword,
Identifier returnType,
@@ -371,7 +375,7 @@
null,
body);
- static ConstructorFieldInitializer constructorFieldInitializer(
+ static ConstructorFieldInitializerImpl constructorFieldInitializer(
bool prefixedWithThis, String fieldName, Expression expression) =>
astFactory.constructorFieldInitializer(
prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null,
@@ -382,23 +386,23 @@
TokenFactory.tokenFromType(TokenType.EQ),
expression);
- static ConstructorName constructorName(TypeName type, String? name) =>
+ static ConstructorNameImpl constructorName(TypeName type, String? name) =>
astFactory.constructorName(
type,
name == null ? null : TokenFactory.tokenFromType(TokenType.PERIOD),
name == null ? null : identifier3(name));
- static ContinueStatement continueStatement([String? label]) =>
+ static ContinueStatementImpl continueStatement([String? label]) =>
astFactory.continueStatement(
TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
label == null ? null : identifier3(label),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static DeclaredIdentifier declaredIdentifier(
+ static DeclaredIdentifierImpl declaredIdentifier(
Keyword keyword, String identifier) =>
declaredIdentifier2(keyword, null, identifier);
- static DeclaredIdentifier declaredIdentifier2(
+ static DeclaredIdentifierImpl declaredIdentifier2(
Keyword? keyword, TypeAnnotation? type, String identifier) =>
astFactory.declaredIdentifier(
null,
@@ -407,19 +411,19 @@
type,
identifier3(identifier));
- static DeclaredIdentifier declaredIdentifier3(String identifier) =>
+ static DeclaredIdentifierImpl declaredIdentifier3(String identifier) =>
declaredIdentifier2(Keyword.VAR, null, identifier);
- static DeclaredIdentifier declaredIdentifier4(
+ static DeclaredIdentifierImpl declaredIdentifier4(
TypeAnnotation type, String identifier) =>
declaredIdentifier2(null, type, identifier);
- static Comment documentationComment(
+ static CommentImpl documentationComment(
List<Token> tokens, List<CommentReference> references) {
return astFactory.documentationComment(tokens, references);
}
- static DoStatement doStatement(Statement body, Expression condition) =>
+ static DoStatementImpl doStatement(Statement body, Expression condition) =>
astFactory.doStatement(
TokenFactory.tokenFromKeyword(Keyword.DO),
body,
@@ -429,16 +433,16 @@
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static DoubleLiteral doubleLiteral(double value) => astFactory.doubleLiteral(
- TokenFactory.tokenFromString(value.toString()), value);
+ static DoubleLiteralImpl doubleLiteral(double value) => astFactory
+ .doubleLiteral(TokenFactory.tokenFromString(value.toString()), value);
- static EmptyFunctionBody emptyFunctionBody() => astFactory
+ static EmptyFunctionBodyImpl emptyFunctionBody() => astFactory
.emptyFunctionBody(TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static EmptyStatement emptyStatement() => astFactory
+ static EmptyStatementImpl emptyStatement() => astFactory
.emptyStatement(TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static EnumDeclaration enumDeclaration(
+ static EnumDeclarationImpl enumDeclaration(
SimpleIdentifier name, List<EnumConstantDeclaration> constants) =>
astFactory.enumDeclaration(
null,
@@ -449,7 +453,7 @@
constants,
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static EnumDeclaration enumDeclaration2(
+ static EnumDeclarationImpl enumDeclaration2(
String name, List<String> constantNames) {
var constants = constantNames.map((name) {
return astFactory.enumConstantDeclaration(
@@ -461,7 +465,8 @@
return enumDeclaration(identifier3(name), constants);
}
- static ExportDirective exportDirective(List<Annotation> metadata, String uri,
+ static ExportDirectiveImpl exportDirective(
+ List<Annotation> metadata, String uri,
[List<Combinator> combinators = const []]) =>
astFactory.exportDirective(
null,
@@ -472,25 +477,26 @@
combinators,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static ExportDirective exportDirective2(String uri,
+ static ExportDirectiveImpl exportDirective2(String uri,
[List<Combinator> combinators = const []]) =>
exportDirective([], uri, combinators);
- static ExpressionFunctionBody expressionFunctionBody(Expression expression) =>
+ static ExpressionFunctionBodyImpl expressionFunctionBody(
+ Expression expression) =>
astFactory.expressionFunctionBody(
null,
TokenFactory.tokenFromType(TokenType.FUNCTION),
expression,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static ExpressionStatement expressionStatement(Expression expression) =>
+ static ExpressionStatementImpl expressionStatement(Expression expression) =>
astFactory.expressionStatement(
expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static ExtendsClause extendsClause(TypeName type) => astFactory.extendsClause(
- TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
+ static ExtendsClauseImpl extendsClause(TypeName type) => astFactory
+ .extendsClause(TokenFactory.tokenFromKeyword(Keyword.EXTENDS), type);
- static ExtensionDeclaration extensionDeclaration(
+ static ExtensionDeclarationImpl extensionDeclaration(
{required String name,
TypeParameterList? typeParameters,
required TypeAnnotation extendedType,
@@ -508,7 +514,7 @@
rightBracket:
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static ExtensionOverride extensionOverride(
+ static ExtensionOverrideImpl extensionOverride(
{required Identifier extensionName,
TypeArgumentList? typeArguments,
required ArgumentList argumentList}) =>
@@ -517,7 +523,7 @@
typeArguments: typeArguments,
argumentList: argumentList);
- static FieldDeclaration fieldDeclaration(bool isStatic, Keyword? keyword,
+ static FieldDeclarationImpl fieldDeclaration(bool isStatic, Keyword? keyword,
TypeAnnotation? type, List<VariableDeclaration> variables,
{bool isAbstract = false, bool isExternal = false}) =>
astFactory.fieldDeclaration2(
@@ -532,11 +538,11 @@
fieldList: variableDeclarationList(keyword, type, variables),
semicolon: TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword? keyword,
+ static FieldDeclarationImpl fieldDeclaration2(bool isStatic, Keyword? keyword,
List<VariableDeclaration> variables) =>
fieldDeclaration(isStatic, keyword, null, variables);
- static FieldFormalParameter fieldFormalParameter(
+ static FieldFormalParameterImpl fieldFormalParameter(
Keyword? keyword, TypeAnnotation? type, String identifier,
[FormalParameterList? parameterList]) =>
astFactory.fieldFormalParameter2(
@@ -548,24 +554,24 @@
identifier: identifier3(identifier),
parameters: parameterList);
- static FieldFormalParameter fieldFormalParameter2(String identifier) =>
+ static FieldFormalParameterImpl fieldFormalParameter2(String identifier) =>
fieldFormalParameter(null, null, identifier);
- static ForEachPartsWithDeclaration forEachPartsWithDeclaration(
+ static ForEachPartsWithDeclarationImpl forEachPartsWithDeclaration(
DeclaredIdentifier loopVariable, Expression iterable) =>
astFactory.forEachPartsWithDeclaration(
loopVariable: loopVariable,
inKeyword: TokenFactory.tokenFromKeyword(Keyword.IN),
iterable: iterable);
- static ForEachPartsWithIdentifier forEachPartsWithIdentifier(
+ static ForEachPartsWithIdentifierImpl forEachPartsWithIdentifier(
SimpleIdentifier identifier, Expression iterable) =>
astFactory.forEachPartsWithIdentifier(
identifier: identifier,
inKeyword: TokenFactory.tokenFromKeyword(Keyword.IN),
iterable: iterable);
- static ForElement forElement(
+ static ForElementImpl forElement(
ForLoopParts forLoopParts, CollectionElement body,
{bool hasAwait = false}) =>
astFactory.forElement(
@@ -577,7 +583,7 @@
rightParenthesis: TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
body: body);
- static FormalParameterList formalParameterList(
+ static FormalParameterListImpl formalParameterList(
[List<FormalParameter> parameters = const []]) =>
astFactory.formalParameterList(
TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
@@ -586,7 +592,7 @@
null,
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
- static ForPartsWithDeclarations forPartsWithDeclarations(
+ static ForPartsWithDeclarationsImpl forPartsWithDeclarations(
VariableDeclarationList variables,
Expression? condition,
List<Expression>? updaters) =>
@@ -597,7 +603,7 @@
rightSeparator: TokenFactory.tokenFromType(TokenType.SEMICOLON),
updaters: updaters);
- static ForPartsWithExpression forPartsWithExpression(
+ static ForPartsWithExpressionImpl forPartsWithExpression(
Expression? initialization,
Expression? condition,
List<Expression>? updaters) =>
@@ -608,7 +614,8 @@
rightSeparator: TokenFactory.tokenFromType(TokenType.SEMICOLON),
updaters: updaters);
- static ForStatement forStatement(ForLoopParts forLoopParts, Statement body) =>
+ static ForStatementImpl forStatement(
+ ForLoopParts forLoopParts, Statement body) =>
astFactory.forStatement(
forKeyword: TokenFactory.tokenFromKeyword(Keyword.FOR),
leftParenthesis: TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
@@ -616,7 +623,7 @@
rightParenthesis: TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
body: body);
- static FunctionDeclaration functionDeclaration(
+ static FunctionDeclarationImpl functionDeclaration(
TypeAnnotation? type,
Keyword? keyword,
String name,
@@ -630,7 +637,7 @@
identifier3(name),
functionExpression);
- static FunctionDeclarationStatement functionDeclarationStatement(
+ static FunctionDeclarationStatementImpl functionDeclarationStatement(
TypeAnnotation? type,
Keyword? keyword,
String name,
@@ -638,32 +645,32 @@
astFactory.functionDeclarationStatement(
functionDeclaration(type, keyword, name, functionExpression));
- static FunctionExpression functionExpression() => astFactory
+ static FunctionExpressionImpl functionExpression() => astFactory
.functionExpression(null, formalParameterList(), blockFunctionBody2());
- static FunctionExpression functionExpression2(
+ static FunctionExpressionImpl functionExpression2(
FormalParameterList parameters, FunctionBody body) =>
astFactory.functionExpression(null, parameters, body);
- static FunctionExpression functionExpression3(
+ static FunctionExpressionImpl functionExpression3(
TypeParameterList typeParameters,
FormalParameterList parameters,
FunctionBody body) =>
astFactory.functionExpression(typeParameters, parameters, body);
- static FunctionExpressionInvocation functionExpressionInvocation(
+ static FunctionExpressionInvocationImpl functionExpressionInvocation(
Expression function,
[List<Expression> arguments = const []]) =>
functionExpressionInvocation2(function, null, arguments);
- static FunctionExpressionInvocation functionExpressionInvocation2(
+ static FunctionExpressionInvocationImpl functionExpressionInvocation2(
Expression function,
[TypeArgumentList? typeArguments,
List<Expression> arguments = const []]) =>
astFactory.functionExpressionInvocation(
function, typeArguments, argumentList(arguments));
- static FunctionTypedFormalParameter functionTypedFormalParameter(
+ static FunctionTypedFormalParameterImpl functionTypedFormalParameter(
TypeAnnotation? returnType, String identifier,
[List<FormalParameter> parameters = const []]) =>
astFactory.functionTypedFormalParameter2(
@@ -671,7 +678,7 @@
identifier: identifier3(identifier),
parameters: formalParameterList(parameters));
- static GenericFunctionType genericFunctionType(TypeAnnotation returnType,
+ static GenericFunctionTypeImpl genericFunctionType(TypeAnnotation returnType,
TypeParameterList typeParameters, FormalParameterList parameters,
{bool question = false}) =>
astFactory.genericFunctionType(returnType,
@@ -679,7 +686,7 @@
question:
question ? TokenFactory.tokenFromType(TokenType.QUESTION) : null);
- static GenericTypeAlias genericTypeAlias(String name,
+ static GenericTypeAliasImpl genericTypeAlias(String name,
TypeParameterList typeParameters, GenericFunctionType functionType) =>
astFactory.genericTypeAlias(
null,
@@ -691,29 +698,30 @@
functionType,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) =>
+ static HideCombinatorImpl hideCombinator(
+ List<SimpleIdentifier> identifiers) =>
astFactory.hideCombinator(
TokenFactory.tokenFromString("hide"), identifiers);
- static HideCombinator hideCombinator2(List<String> identifiers) =>
+ static HideCombinatorImpl hideCombinator2(List<String> identifiers) =>
astFactory.hideCombinator(
TokenFactory.tokenFromString("hide"), identifierList(identifiers));
- static PrefixedIdentifier identifier(
+ static PrefixedIdentifierImpl identifier(
SimpleIdentifier prefix, SimpleIdentifier identifier) =>
astFactory.prefixedIdentifier(
prefix, TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
- static SimpleIdentifier identifier3(String lexeme) =>
+ static SimpleIdentifierImpl identifier3(String lexeme) =>
astFactory.simpleIdentifier(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
- static PrefixedIdentifier identifier4(
+ static PrefixedIdentifierImpl identifier4(
String prefix, SimpleIdentifier identifier) =>
astFactory.prefixedIdentifier(identifier3(prefix),
TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
- static PrefixedIdentifier identifier5(String prefix, String identifier) =>
+ static PrefixedIdentifierImpl identifier5(String prefix, String identifier) =>
astFactory.prefixedIdentifier(
identifier3(prefix),
TokenFactory.tokenFromType(TokenType.PERIOD),
@@ -725,7 +733,7 @@
.toList();
}
- static IfElement ifElement(
+ static IfElementImpl ifElement(
Expression condition, CollectionElement thenElement,
[CollectionElement? elseElement]) =>
astFactory.ifElement(
@@ -739,12 +747,12 @@
: TokenFactory.tokenFromKeyword(Keyword.ELSE),
elseElement: elseElement);
- static IfStatement ifStatement(
+ static IfStatementImpl ifStatement(
Expression condition, Statement thenStatement) =>
ifStatement2(condition, thenStatement, null);
- static IfStatement ifStatement2(Expression condition, Statement thenStatement,
- Statement? elseStatement) =>
+ static IfStatementImpl ifStatement2(Expression condition,
+ Statement thenStatement, Statement? elseStatement) =>
astFactory.ifStatement(
TokenFactory.tokenFromKeyword(Keyword.IF),
TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
@@ -756,12 +764,12 @@
: TokenFactory.tokenFromKeyword(Keyword.ELSE),
elseStatement);
- static ImplementsClause implementsClause(List<TypeName> types) =>
+ static ImplementsClauseImpl implementsClause(List<TypeName> types) =>
astFactory.implementsClause(
TokenFactory.tokenFromKeyword(Keyword.IMPLEMENTS), types);
- static ImportDirective importDirective(List<Annotation> metadata, String uri,
- bool isDeferred, String? prefix,
+ static ImportDirectiveImpl importDirective(List<Annotation> metadata,
+ String uri, bool isDeferred, String? prefix,
[List<Combinator> combinators = const []]) =>
astFactory.importDirective(
null,
@@ -775,16 +783,16 @@
combinators,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static ImportDirective importDirective2(
+ static ImportDirectiveImpl importDirective2(
String uri, bool isDeferred, String prefix,
[List<Combinator> combinators = const []]) =>
importDirective([], uri, isDeferred, prefix, combinators);
- static ImportDirective importDirective3(String uri, String? prefix,
+ static ImportDirectiveImpl importDirective3(String uri, String? prefix,
[List<Combinator> combinators = const []]) =>
importDirective([], uri, false, prefix, combinators);
- static IndexExpression indexExpression({
+ static IndexExpressionImpl indexExpression({
required Expression target,
bool hasQuestion = false,
required Expression index,
@@ -806,7 +814,7 @@
);
}
- static IndexExpression indexExpressionForCascade(Expression array,
+ static IndexExpressionImpl indexExpressionForCascade(Expression array,
Expression index, TokenType period, TokenType leftBracket) =>
astFactory.indexExpressionForCascade2(
period: TokenFactory.tokenFromType(period),
@@ -815,7 +823,7 @@
rightBracket:
TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
- static InstanceCreationExpression instanceCreationExpression(
+ static InstanceCreationExpressionImpl instanceCreationExpression(
Keyword? keyword, ConstructorName name,
[List<Expression> arguments = const []]) =>
astFactory.instanceCreationExpression(
@@ -823,12 +831,12 @@
name,
argumentList(arguments));
- static InstanceCreationExpression instanceCreationExpression2(
+ static InstanceCreationExpressionImpl instanceCreationExpression2(
Keyword? keyword, TypeName type,
[List<Expression> arguments = const []]) =>
instanceCreationExpression3(keyword, type, null, arguments);
- static InstanceCreationExpression instanceCreationExpression3(
+ static InstanceCreationExpressionImpl instanceCreationExpression3(
Keyword? keyword, TypeName type, String? identifier,
[List<Expression> arguments = const []]) =>
instanceCreationExpression(
@@ -841,29 +849,30 @@
identifier == null ? null : identifier3(identifier)),
arguments);
- static IntegerLiteral integer(int value) => astFactory.integerLiteral(
+ static IntegerLiteralImpl integer(int value) => astFactory.integerLiteral(
TokenFactory.tokenFromTypeAndString(TokenType.INT, value.toString()),
value);
- static InterpolationExpression interpolationExpression(
+ static InterpolationExpressionImpl interpolationExpression(
Expression expression) =>
astFactory.interpolationExpression(
TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_EXPRESSION),
expression,
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static InterpolationExpression interpolationExpression2(String identifier) =>
+ static InterpolationExpressionImpl interpolationExpression2(
+ String identifier) =>
astFactory.interpolationExpression(
TokenFactory.tokenFromType(TokenType.STRING_INTERPOLATION_IDENTIFIER),
identifier3(identifier),
null);
- static InterpolationString interpolationString(
+ static InterpolationStringImpl interpolationString(
String contents, String value) =>
astFactory.interpolationString(
TokenFactory.tokenFromString(contents), value);
- static IsExpression isExpression(
+ static IsExpressionImpl isExpression(
Expression expression, bool negated, TypeAnnotation type) =>
astFactory.isExpression(
expression,
@@ -871,16 +880,17 @@
negated ? TokenFactory.tokenFromType(TokenType.BANG) : null,
type);
- static Label label(SimpleIdentifier label) =>
+ static LabelImpl label(SimpleIdentifier label) =>
astFactory.label(label, TokenFactory.tokenFromType(TokenType.COLON));
- static Label label2(String label) => AstTestFactory.label(identifier3(label));
+ static LabelImpl label2(String label) =>
+ AstTestFactory.label(identifier3(label));
- static LabeledStatement labeledStatement(
+ static LabeledStatementImpl labeledStatement(
List<Label> labels, Statement statement) =>
astFactory.labeledStatement(labels, statement);
- static LibraryDirective libraryDirective(
+ static LibraryDirectiveImpl libraryDirective(
List<Annotation> metadata, LibraryIdentifier libraryName) =>
astFactory.libraryDirective(
null,
@@ -889,14 +899,14 @@
libraryName,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static LibraryDirective libraryDirective2(String libraryName) =>
+ static LibraryDirectiveImpl libraryDirective2(String libraryName) =>
libraryDirective(<Annotation>[], libraryIdentifier2([libraryName]));
- static LibraryIdentifier libraryIdentifier(
+ static LibraryIdentifierImpl libraryIdentifier(
List<SimpleIdentifier> components) =>
astFactory.libraryIdentifier(components);
- static LibraryIdentifier libraryIdentifier2(List<String> components) {
+ static LibraryIdentifierImpl libraryIdentifier2(List<String> components) {
return astFactory.libraryIdentifier(identifierList(components));
}
@@ -904,10 +914,10 @@
return elements;
}
- static ListLiteral listLiteral([List<Expression> elements = const []]) =>
+ static ListLiteralImpl listLiteral([List<Expression> elements = const []]) =>
listLiteral2(null, null, elements);
- static ListLiteral listLiteral2(
+ static ListLiteralImpl listLiteral2(
Keyword? keyword, TypeArgumentList? typeArguments,
[List<CollectionElement> elements = const []]) =>
astFactory.listLiteral(
@@ -917,19 +927,20 @@
elements,
TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET));
- static MapLiteralEntry mapLiteralEntry(String key, Expression value) =>
+ static MapLiteralEntryImpl mapLiteralEntry(String key, Expression value) =>
astFactory.mapLiteralEntry(
string2(key), TokenFactory.tokenFromType(TokenType.COLON), value);
- static MapLiteralEntry mapLiteralEntry2(Expression key, Expression value) =>
+ static MapLiteralEntryImpl mapLiteralEntry2(
+ Expression key, Expression value) =>
astFactory.mapLiteralEntry(
key, TokenFactory.tokenFromType(TokenType.COLON), value);
- static MapLiteralEntry mapLiteralEntry3(String key, String value) =>
+ static MapLiteralEntryImpl mapLiteralEntry3(String key, String value) =>
astFactory.mapLiteralEntry(string2(key),
TokenFactory.tokenFromType(TokenType.COLON), string2(value));
- static MethodDeclaration methodDeclaration(
+ static MethodDeclarationImpl methodDeclaration(
Keyword? modifier,
TypeAnnotation? returnType,
Keyword? property,
@@ -949,7 +960,7 @@
parameters,
emptyFunctionBody());
- static MethodDeclaration methodDeclaration2(
+ static MethodDeclarationImpl methodDeclaration2(
Keyword? modifier,
TypeAnnotation? returnType,
Keyword? property,
@@ -970,7 +981,7 @@
parameters,
body);
- static MethodDeclaration methodDeclaration3(
+ static MethodDeclarationImpl methodDeclaration3(
Keyword? modifier,
TypeAnnotation? returnType,
Keyword? property,
@@ -992,7 +1003,7 @@
parameters,
body);
- static MethodDeclaration methodDeclaration4(
+ static MethodDeclarationImpl methodDeclaration4(
{bool external = false,
Keyword? modifier,
TypeAnnotation? returnType,
@@ -1014,7 +1025,7 @@
parameters,
body);
- static MethodInvocation methodInvocation(
+ static MethodInvocationImpl methodInvocation(
Expression? target, String methodName,
[List<Expression> arguments = const [],
TokenType operator = TokenType.PERIOD]) =>
@@ -1025,11 +1036,11 @@
null,
argumentList(arguments));
- static MethodInvocation methodInvocation2(String methodName,
+ static MethodInvocationImpl methodInvocation2(String methodName,
[List<Expression> arguments = const []]) =>
methodInvocation(null, methodName, arguments);
- static MethodInvocation methodInvocation3(Expression? target,
+ static MethodInvocationImpl methodInvocation3(Expression? target,
String methodName, TypeArgumentList? typeArguments,
[List<Expression> arguments = const [],
TokenType operator = TokenType.PERIOD]) =>
@@ -1040,14 +1051,15 @@
typeArguments,
argumentList(arguments));
- static NamedExpression namedExpression(Label label, Expression expression) =>
+ static NamedExpressionImpl namedExpression(
+ Label label, Expression expression) =>
astFactory.namedExpression(label, expression);
- static NamedExpression namedExpression2(
+ static NamedExpressionImpl namedExpression2(
String label, Expression expression) =>
namedExpression(label2(label), expression);
- static DefaultFormalParameter namedFormalParameter(
+ static DefaultFormalParameterImpl namedFormalParameter(
NormalFormalParameter parameter, Expression? expression) =>
astFactory.defaultFormalParameter(
parameter,
@@ -1057,27 +1069,28 @@
: TokenFactory.tokenFromType(TokenType.COLON),
expression);
- static NativeClause nativeClause(String nativeCode) =>
+ static NativeClauseImpl nativeClause(String nativeCode) =>
astFactory.nativeClause(
TokenFactory.tokenFromString("native"), string2(nativeCode));
- static NativeFunctionBody nativeFunctionBody(String nativeMethodName) =>
+ static NativeFunctionBodyImpl nativeFunctionBody(String nativeMethodName) =>
astFactory.nativeFunctionBody(
TokenFactory.tokenFromString("native"),
string2(nativeMethodName),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static NullLiteral nullLiteral() =>
+ static NullLiteralImpl nullLiteral() =>
astFactory.nullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
- static ParenthesizedExpression parenthesizedExpression(
+ static ParenthesizedExpressionImpl parenthesizedExpression(
Expression expression) =>
astFactory.parenthesizedExpression(
TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
expression,
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
- static PartDirective partDirective(List<Annotation> metadata, String url) =>
+ static PartDirectiveImpl partDirective(
+ List<Annotation> metadata, String url) =>
astFactory.partDirective(
null,
metadata,
@@ -1085,13 +1098,13 @@
string2(url),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static PartDirective partDirective2(String url) =>
+ static PartDirectiveImpl partDirective2(String url) =>
partDirective(<Annotation>[], url);
- static PartOfDirective partOfDirective(LibraryIdentifier libraryName) =>
+ static PartOfDirectiveImpl partOfDirective(LibraryIdentifier libraryName) =>
partOfDirective2(<Annotation>[], libraryName);
- static PartOfDirective partOfDirective2(
+ static PartOfDirectiveImpl partOfDirective2(
List<Annotation> metadata, LibraryIdentifier libraryName) =>
astFactory.partOfDirective(
null,
@@ -1102,7 +1115,7 @@
libraryName,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static DefaultFormalParameter positionalFormalParameter(
+ static DefaultFormalParameterImpl positionalFormalParameter(
NormalFormalParameter parameter, Expression? expression) =>
astFactory.defaultFormalParameter(
parameter,
@@ -1110,31 +1123,32 @@
expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ),
expression);
- static PostfixExpression postfixExpression(
+ static PostfixExpressionImpl postfixExpression(
Expression expression, TokenType operator) =>
astFactory.postfixExpression(
expression, TokenFactory.tokenFromType(operator));
- static PrefixExpression prefixExpression(
+ static PrefixExpressionImpl prefixExpression(
TokenType operator, Expression expression) =>
astFactory.prefixExpression(
TokenFactory.tokenFromType(operator), expression);
- static PropertyAccess propertyAccess(
+ static PropertyAccessImpl propertyAccess(
Expression? target, SimpleIdentifier propertyName) =>
astFactory.propertyAccess(
target, TokenFactory.tokenFromType(TokenType.PERIOD), propertyName);
- static PropertyAccess propertyAccess2(Expression? target, String propertyName,
+ static PropertyAccessImpl propertyAccess2(
+ Expression? target, String propertyName,
[TokenType operator = TokenType.PERIOD]) =>
astFactory.propertyAccess(target, TokenFactory.tokenFromType(operator),
identifier3(propertyName));
- static RedirectingConstructorInvocation redirectingConstructorInvocation(
+ static RedirectingConstructorInvocationImpl redirectingConstructorInvocation(
[List<Expression> arguments = const []]) =>
redirectingConstructorInvocation2(null, arguments);
- static RedirectingConstructorInvocation redirectingConstructorInvocation2(
+ static RedirectingConstructorInvocationImpl redirectingConstructorInvocation2(
String? constructorName,
[List<Expression> arguments = const []]) =>
astFactory.redirectingConstructorInvocation(
@@ -1145,19 +1159,19 @@
constructorName == null ? null : identifier3(constructorName),
argumentList(arguments));
- static RethrowExpression rethrowExpression() => astFactory
+ static RethrowExpressionImpl rethrowExpression() => astFactory
.rethrowExpression(TokenFactory.tokenFromKeyword(Keyword.RETHROW));
- static ReturnStatement returnStatement() => returnStatement2(null);
+ static ReturnStatementImpl returnStatement() => returnStatement2(null);
- static ReturnStatement returnStatement2(Expression? expression) =>
+ static ReturnStatementImpl returnStatement2(Expression? expression) =>
astFactory.returnStatement(TokenFactory.tokenFromKeyword(Keyword.RETURN),
expression, TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static ScriptTag scriptTag(String scriptTag) =>
+ static ScriptTagImpl scriptTag(String scriptTag) =>
astFactory.scriptTag(TokenFactory.tokenFromString(scriptTag));
- static SetOrMapLiteral setOrMapLiteral(
+ static SetOrMapLiteralImpl setOrMapLiteral(
Keyword? keyword, TypeArgumentList? typeArguments,
[List<CollectionElement> elements = const []]) =>
astFactory.setOrMapLiteral(
@@ -1169,19 +1183,20 @@
rightBracket: TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET),
);
- static ShowCombinator showCombinator(List<SimpleIdentifier> identifiers) =>
+ static ShowCombinatorImpl showCombinator(
+ List<SimpleIdentifier> identifiers) =>
astFactory.showCombinator(
TokenFactory.tokenFromString("show"), identifiers);
- static ShowCombinator showCombinator2(List<String> identifiers) =>
+ static ShowCombinatorImpl showCombinator2(List<String> identifiers) =>
astFactory.showCombinator(
TokenFactory.tokenFromString("show"), identifierList(identifiers));
- static SimpleFormalParameter simpleFormalParameter(
+ static SimpleFormalParameterImpl simpleFormalParameter(
Keyword keyword, String parameterName) =>
simpleFormalParameter2(keyword, null, parameterName);
- static SimpleFormalParameter simpleFormalParameter2(
+ static SimpleFormalParameterImpl simpleFormalParameter2(
Keyword? keyword, TypeAnnotation? type, String? parameterName) =>
astFactory.simpleFormalParameter2(
keyword:
@@ -1190,31 +1205,33 @@
identifier:
parameterName == null ? null : identifier3(parameterName));
- static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
+ static SimpleFormalParameterImpl simpleFormalParameter3(
+ String parameterName) =>
simpleFormalParameter2(null, null, parameterName);
- static SimpleFormalParameter simpleFormalParameter4(
+ static SimpleFormalParameterImpl simpleFormalParameter4(
TypeAnnotation type, String? parameterName) =>
simpleFormalParameter2(null, type, parameterName);
- static SpreadElement spreadElement(
+ static SpreadElementImpl spreadElement(
TokenType operator, Expression expression) =>
astFactory.spreadElement(
spreadOperator: TokenFactory.tokenFromType(operator),
expression: expression);
- static StringInterpolation string(
+ static StringInterpolationImpl string(
[List<InterpolationElement> elements = const []]) =>
astFactory.stringInterpolation(elements);
- static SimpleStringLiteral string2(String content) => astFactory
+ static SimpleStringLiteralImpl string2(String content) => astFactory
.simpleStringLiteral(TokenFactory.tokenFromString("'$content'"), content);
- static SuperConstructorInvocation superConstructorInvocation(
+ static SuperConstructorInvocationImpl superConstructorInvocation(
[List<Expression> arguments = const []]) =>
superConstructorInvocation2(null, arguments);
- static SuperConstructorInvocation superConstructorInvocation2(String? name,
+ static SuperConstructorInvocationImpl superConstructorInvocation2(
+ String? name,
[List<Expression> arguments = const []]) =>
astFactory.superConstructorInvocation(
TokenFactory.tokenFromKeyword(Keyword.SUPER),
@@ -1222,19 +1239,19 @@
name == null ? null : identifier3(name),
argumentList(arguments));
- static SuperExpression superExpression() =>
+ static SuperExpressionImpl superExpression() =>
astFactory.superExpression(TokenFactory.tokenFromKeyword(Keyword.SUPER));
- static SwitchCase switchCase(
+ static SwitchCaseImpl switchCase(
Expression expression, List<Statement> statements) =>
switchCase2(<Label>[], expression, statements);
- static SwitchCase switchCase2(List<Label> labels, Expression expression,
+ static SwitchCaseImpl switchCase2(List<Label> labels, Expression expression,
List<Statement> statements) =>
astFactory.switchCase(labels, TokenFactory.tokenFromKeyword(Keyword.CASE),
expression, TokenFactory.tokenFromType(TokenType.COLON), statements);
- static SwitchDefault switchDefault(
+ static SwitchDefaultImpl switchDefault(
List<Label> labels, List<Statement> statements) =>
astFactory.switchDefault(
labels,
@@ -1242,10 +1259,10 @@
TokenFactory.tokenFromType(TokenType.COLON),
statements);
- static SwitchDefault switchDefault2(List<Statement> statements) =>
+ static SwitchDefaultImpl switchDefault2(List<Statement> statements) =>
switchDefault(<Label>[], statements);
- static SwitchStatement switchStatement(
+ static SwitchStatementImpl switchStatement(
Expression expression, List<SwitchMember> members) =>
astFactory.switchStatement(
TokenFactory.tokenFromKeyword(Keyword.SWITCH),
@@ -1256,7 +1273,7 @@
members,
TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
- static SymbolLiteral symbolLiteral(List<String> components) {
+ static SymbolLiteralImpl symbolLiteral(List<String> components) {
List<Token> identifierList = <Token>[];
for (String component in components) {
identifierList.add(
@@ -1266,28 +1283,28 @@
TokenFactory.tokenFromType(TokenType.HASH), identifierList);
}
- static BlockFunctionBody syncBlockFunctionBody(
+ static BlockFunctionBodyImpl syncBlockFunctionBody(
[List<Statement> statements = const []]) =>
astFactory.blockFunctionBody(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
null,
block(statements));
- static BlockFunctionBody syncGeneratorBlockFunctionBody(
+ static BlockFunctionBodyImpl syncGeneratorBlockFunctionBody(
[List<Statement> statements = const []]) =>
astFactory.blockFunctionBody(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"),
TokenFactory.tokenFromType(TokenType.STAR),
block(statements));
- static ThisExpression thisExpression() =>
+ static ThisExpressionImpl thisExpression() =>
astFactory.thisExpression(TokenFactory.tokenFromKeyword(Keyword.THIS));
- static ThrowExpression throwExpression2(Expression expression) =>
+ static ThrowExpressionImpl throwExpression2(Expression expression) =>
astFactory.throwExpression(
TokenFactory.tokenFromKeyword(Keyword.THROW), expression);
- static TopLevelVariableDeclaration topLevelVariableDeclaration(
+ static TopLevelVariableDeclarationImpl topLevelVariableDeclaration(
Keyword? keyword,
TypeAnnotation? type,
List<VariableDeclaration> variables) =>
@@ -1297,7 +1314,7 @@
variableDeclarationList(keyword, type, variables),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static TopLevelVariableDeclaration topLevelVariableDeclaration2(
+ static TopLevelVariableDeclarationImpl topLevelVariableDeclaration2(
Keyword? keyword, List<VariableDeclaration> variables,
{bool isExternal = false}) =>
astFactory.topLevelVariableDeclaration(
@@ -1309,14 +1326,14 @@
? TokenFactory.tokenFromKeyword(Keyword.EXTERNAL)
: null);
- static TryStatement tryStatement(Block body, Block finallyClause) =>
+ static TryStatementImpl tryStatement(Block body, Block finallyClause) =>
tryStatement3(body, <CatchClause>[], finallyClause);
- static TryStatement tryStatement2(
+ static TryStatementImpl tryStatement2(
Block body, List<CatchClause> catchClauses) =>
tryStatement3(body, catchClauses, null);
- static TryStatement tryStatement3(
+ static TryStatementImpl tryStatement3(
Block body, List<CatchClause> catchClauses, Block? finallyClause) =>
astFactory.tryStatement(
TokenFactory.tokenFromKeyword(Keyword.TRY),
@@ -1327,7 +1344,7 @@
: TokenFactory.tokenFromKeyword(Keyword.FINALLY),
finallyClause);
- static FunctionTypeAlias typeAlias(TypeAnnotation returnType, String name,
+ static FunctionTypeAliasImpl typeAlias(TypeAnnotation returnType, String name,
TypeParameterList? typeParameters, FormalParameterList parameters) =>
astFactory.functionTypeAlias(
null,
@@ -1346,7 +1363,7 @@
return typeArgumentList2(types);
}
- static TypeArgumentList typeArgumentList2(List<TypeAnnotation> types) {
+ static TypeArgumentListImpl typeArgumentList2(List<TypeAnnotation> types) {
return astFactory.typeArgumentList(TokenFactory.tokenFromType(TokenType.LT),
types, TokenFactory.tokenFromType(TokenType.GT));
}
@@ -1356,11 +1373,11 @@
///
/// <b>Note:</b> This method does not correctly handle class elements that
/// have type parameters.
- static TypeName typeName(ClassElement element,
+ static TypeNameImpl typeName(ClassElement element,
[List<TypeAnnotation>? arguments]) {
- SimpleIdentifier name = identifier3(element.name);
+ var name = identifier3(element.name);
name.staticElement = element;
- TypeName typeName = typeName3(name, arguments);
+ var typeName = typeName3(name, arguments);
typeName.type = element.instantiate(
typeArguments: List.filled(
element.typeParameters.length,
@@ -1371,27 +1388,27 @@
return typeName;
}
- static TypeName typeName3(Identifier name,
+ static TypeNameImpl typeName3(Identifier name,
[List<TypeAnnotation>? arguments]) =>
astFactory.typeName(name, typeArgumentList(arguments));
- static TypeName typeName4(String name,
+ static TypeNameImpl typeName4(String name,
[List<TypeAnnotation>? arguments, bool question = false]) =>
astFactory.typeName(identifier3(name), typeArgumentList(arguments),
question:
question ? TokenFactory.tokenFromType(TokenType.QUESTION) : null);
- static TypeParameter typeParameter(String name) =>
+ static TypeParameterImpl typeParameter(String name) =>
astFactory.typeParameter(null, null, identifier3(name), null, null);
- static TypeParameter typeParameter2(String name, TypeAnnotation bound) =>
+ static TypeParameterImpl typeParameter2(String name, TypeAnnotation bound) =>
astFactory.typeParameter(null, null, identifier3(name),
TokenFactory.tokenFromKeyword(Keyword.EXTENDS), bound);
- static TypeParameter typeParameter3(String name, String varianceLexeme) =>
+ static TypeParameterImpl typeParameter3(String name, String varianceLexeme) =>
// TODO (kallentu) : Clean up AstFactoryImpl casting once variance is
// added to the interface.
- (astFactory as AstFactoryImpl).typeParameter2(
+ astFactory.typeParameter2(
comment: null,
metadata: null,
name: identifier3(name),
@@ -1406,7 +1423,7 @@
return typeParameterList2(typeNames);
}
- static TypeParameterList typeParameterList2(List<String> typeNames) {
+ static TypeParameterListImpl typeParameterList2(List<String> typeNames) {
var typeParameters = <TypeParameter>[];
for (String typeName in typeNames) {
typeParameters.add(typeParameter(typeName));
@@ -1418,15 +1435,15 @@
TokenFactory.tokenFromType(TokenType.GT));
}
- static VariableDeclaration variableDeclaration(String name) =>
+ static VariableDeclarationImpl variableDeclaration(String name) =>
astFactory.variableDeclaration(identifier3(name), null, null);
- static VariableDeclaration variableDeclaration2(
+ static VariableDeclarationImpl variableDeclaration2(
String name, Expression initializer) =>
astFactory.variableDeclaration(identifier3(name),
TokenFactory.tokenFromType(TokenType.EQ), initializer);
- static VariableDeclarationList variableDeclarationList(Keyword? keyword,
+ static VariableDeclarationListImpl variableDeclarationList(Keyword? keyword,
TypeAnnotation? type, List<VariableDeclaration> variables) =>
astFactory.variableDeclarationList(
null,
@@ -1435,11 +1452,11 @@
type,
variables);
- static VariableDeclarationList variableDeclarationList2(
+ static VariableDeclarationListImpl variableDeclarationList2(
Keyword? keyword, List<VariableDeclaration> variables) =>
variableDeclarationList(keyword, null, variables);
- static VariableDeclarationStatement variableDeclarationStatement(
+ static VariableDeclarationStatementImpl variableDeclarationStatement(
Keyword? keyword,
TypeAnnotation? type,
List<VariableDeclaration> variables) =>
@@ -1447,11 +1464,12 @@
variableDeclarationList(keyword, type, variables),
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static VariableDeclarationStatement variableDeclarationStatement2(
+ static VariableDeclarationStatementImpl variableDeclarationStatement2(
Keyword keyword, List<VariableDeclaration> variables) =>
variableDeclarationStatement(keyword, null, variables);
- static WhileStatement whileStatement(Expression condition, Statement body) =>
+ static WhileStatementImpl whileStatement(
+ Expression condition, Statement body) =>
astFactory.whileStatement(
TokenFactory.tokenFromKeyword(Keyword.WHILE),
TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
@@ -1459,17 +1477,17 @@
TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
body);
- static WithClause withClause(List<TypeName> types) =>
+ static WithClauseImpl withClause(List<TypeName> types) =>
astFactory.withClause(TokenFactory.tokenFromKeyword(Keyword.WITH), types);
- static YieldStatement yieldEachStatement(Expression expression) =>
+ static YieldStatementImpl yieldEachStatement(Expression expression) =>
astFactory.yieldStatement(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
TokenFactory.tokenFromType(TokenType.STAR),
expression,
TokenFactory.tokenFromType(TokenType.SEMICOLON));
- static YieldStatement yieldStatement(Expression expression) =>
+ static YieldStatementImpl yieldStatement(Expression expression) =>
astFactory.yieldStatement(
TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
null,
diff --git a/pkg/analyzer/lib/src/generated/testing/element_factory.dart b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
index 560e904..6045950 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.dart
@@ -340,9 +340,8 @@
ConstTopLevelVariableElementImpl constant =
ConstTopLevelVariableElementImpl(name, -1);
var typeElement = type.element as ClassElement;
- InstanceCreationExpression initializer =
- AstTestFactory.instanceCreationExpression2(
- Keyword.CONST, AstTestFactory.typeName(typeElement));
+ var initializer = AstTestFactory.instanceCreationExpression2(
+ Keyword.CONST, AstTestFactory.typeName(typeElement));
if (type is InterfaceType) {
var element = typeElement.unnamedConstructor;
initializer.constructorName.staticElement = element;
diff --git a/pkg/analyzer/lib/src/lint/linter.dart b/pkg/analyzer/lib/src/lint/linter.dart
index 9d8c65f..3a4d2a3 100644
--- a/pkg/analyzer/lib/src/lint/linter.dart
+++ b/pkg/analyzer/lib/src/lint/linter.dart
@@ -16,6 +16,7 @@
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/file_system/file_system.dart' as file_system;
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/constant/compute.dart';
import 'package:analyzer/src/dart/constant/constant_verifier.dart';
@@ -328,9 +329,9 @@
@override
bool canBeConst(Expression expression) {
- if (expression is InstanceCreationExpression) {
+ if (expression is InstanceCreationExpressionImpl) {
return _canBeConstInstanceCreation(expression);
- } else if (expression is TypedLiteral) {
+ } else if (expression is TypedLiteralImpl) {
return _canBeConstTypedLiteral(expression);
} else {
return false;
@@ -338,7 +339,7 @@
}
@override
- bool canBeConstConstructor(ConstructorDeclaration node) {
+ bool canBeConstConstructor(covariant ConstructorDeclarationImpl node) {
var element = node.declaredElement!;
ClassElement classElement = element.enclosingElement;
@@ -426,7 +427,7 @@
return const LinterNameInScopeResolutionResult._none();
}
- bool _canBeConstInstanceCreation(InstanceCreationExpression node) {
+ bool _canBeConstInstanceCreation(InstanceCreationExpressionImpl node) {
//
// Verify that the invoked constructor is a const constructor.
//
@@ -452,7 +453,7 @@
}
}
- bool _canBeConstTypedLiteral(TypedLiteral node) {
+ bool _canBeConstTypedLiteral(TypedLiteralImpl node) {
var oldKeyword = node.constKeyword;
try {
node.constKeyword = KeywordToken(Keyword.CONST, node.offset);
diff --git a/pkg/analyzer/lib/src/summary2/apply_resolution.dart b/pkg/analyzer/lib/src/summary2/apply_resolution.dart
index 9da7646..20308e2 100644
--- a/pkg/analyzer/lib/src/summary2/apply_resolution.dart
+++ b/pkg/analyzer/lib/src/summary2/apply_resolution.dart
@@ -5,11 +5,11 @@
import 'dart:math';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/resolver/variance.dart';
@@ -81,7 +81,7 @@
}
@override
- void visitAnnotation(Annotation node) {
+ void visitAnnotation(covariant AnnotationImpl node) {
_expectMarker(MarkerTag.Annotation_name);
node.name.accept(this);
_expectMarker(MarkerTag.Annotation_constructorName);
@@ -100,7 +100,7 @@
}
@override
- void visitAsExpression(AsExpression node) {
+ void visitAsExpression(covariant AsExpressionImpl node) {
_expectMarker(MarkerTag.AsExpression_expression);
node.expression.accept(this);
_expectMarker(MarkerTag.AsExpression_type);
@@ -142,7 +142,7 @@
}
@override
- void visitAwaitExpression(AwaitExpression node) {
+ void visitAwaitExpression(covariant AwaitExpressionImpl node) {
_expectMarker(MarkerTag.AwaitExpression_expression);
node.expression.accept(this);
_expectMarker(MarkerTag.AwaitExpression_expression2);
@@ -151,7 +151,7 @@
}
@override
- void visitBinaryExpression(BinaryExpression node) {
+ void visitBinaryExpression(covariant BinaryExpressionImpl node) {
_expectMarker(MarkerTag.BinaryExpression_leftOperand);
node.leftOperand.accept(this);
_expectMarker(MarkerTag.BinaryExpression_rightOperand);
@@ -166,12 +166,12 @@
}
@override
- void visitBooleanLiteral(BooleanLiteral node) {
+ void visitBooleanLiteral(covariant BooleanLiteralImpl node) {
_expression(node);
}
@override
- void visitCascadeExpression(CascadeExpression node) {
+ void visitCascadeExpression(covariant CascadeExpressionImpl node) {
_expectMarker(MarkerTag.CascadeExpression_target);
node.target.accept(this);
_expectMarker(MarkerTag.CascadeExpression_cascadeSections);
@@ -241,7 +241,7 @@
}
@override
- void visitConditionalExpression(ConditionalExpression node) {
+ void visitConditionalExpression(covariant ConditionalExpressionImpl node) {
_expectMarker(MarkerTag.ConditionalExpression_condition);
node.condition.accept(this);
_expectMarker(MarkerTag.ConditionalExpression_thenExpression);
@@ -302,7 +302,7 @@
}
@override
- void visitConstructorName(ConstructorName node) {
+ void visitConstructorName(covariant ConstructorNameImpl node) {
// Rewrite:
// ConstructorName
// type: TypeName
@@ -475,7 +475,7 @@
}
@override
- void visitFieldFormalParameter(FieldFormalParameter node) {
+ void visitFieldFormalParameter(covariant FieldFormalParameterImpl node) {
if (node.declaredElement == null) {
assert(node.parent is! DefaultFormalParameter);
var enclosing = _enclosingElements.last;
@@ -527,6 +527,7 @@
@override
void visitForPartsWithDeclarations(ForPartsWithDeclarations node) {
for (var variable in node.variables.variables) {
+ variable as VariableDeclarationImpl;
var nameNode = variable.name;
nameNode.staticElement = LocalVariableElementImpl(
nameNode.name,
@@ -579,7 +580,7 @@
@override
void visitFunctionExpressionInvocation(
- FunctionExpressionInvocation node, {
+ covariant FunctionExpressionInvocationImpl node, {
bool readRewrite = true,
}) {
// Read possible rewrite of `MethodInvocation`.
@@ -628,7 +629,8 @@
}
@override
- void visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+ void visitFunctionTypedFormalParameter(
+ covariant FunctionTypedFormalParameterImpl node) {
if (node.declaredElement == null) {
assert(node.parent is! DefaultFormalParameter);
var enclosing = _enclosingElements.last;
@@ -733,7 +735,7 @@
}
@override
- void visitIndexExpression(IndexExpression node) {
+ void visitIndexExpression(covariant IndexExpressionImpl node) {
_expectMarker(MarkerTag.IndexExpression_target);
node.target?.accept(this);
_expectMarker(MarkerTag.IndexExpression_index);
@@ -747,7 +749,7 @@
@override
void visitInstanceCreationExpression(
- InstanceCreationExpression node, {
+ covariant InstanceCreationExpressionImpl node, {
bool readRewrite = true,
}) {
// Read possible rewrite of `MethodInvocation`.
@@ -770,7 +772,7 @@
}
@override
- void visitIntegerLiteral(IntegerLiteral node) {
+ void visitIntegerLiteral(covariant IntegerLiteralImpl node) {
_expression(node);
}
@@ -785,7 +787,7 @@
}
@override
- void visitIsExpression(IsExpression node) {
+ void visitIsExpression(covariant IsExpressionImpl node) {
_expectMarker(MarkerTag.IsExpression_expression);
node.expression.accept(this);
_expectMarker(MarkerTag.IsExpression_type);
@@ -807,7 +809,7 @@
}
@override
- void visitListLiteral(ListLiteral node) {
+ void visitListLiteral(covariant ListLiteralImpl node) {
_expectMarker(MarkerTag.ListLiteral_typeArguments);
node.typeArguments?.accept(this);
_expectMarker(MarkerTag.ListLiteral_elements);
@@ -872,7 +874,7 @@
}
@override
- void visitMethodInvocation(MethodInvocation node) {
+ void visitMethodInvocation(covariant MethodInvocationImpl node) {
var rewriteTag = _resolution.readByte();
if (rewriteTag == MethodInvocationRewriteTag.none) {
// No rewrite necessary.
@@ -1012,7 +1014,8 @@
}
@override
- void visitParenthesizedExpression(ParenthesizedExpression node) {
+ void visitParenthesizedExpression(
+ covariant ParenthesizedExpressionImpl node) {
_expectMarker(MarkerTag.ParenthesizedExpression_expression);
node.expression.accept(this);
_expectMarker(MarkerTag.ParenthesizedExpression_expression2);
@@ -1059,7 +1062,7 @@
}
@override
- void visitPrefixedIdentifier(PrefixedIdentifier node) {
+ void visitPrefixedIdentifier(covariant PrefixedIdentifierImpl node) {
_expectMarker(MarkerTag.PrefixedIdentifier_prefix);
node.prefix.accept(this);
_expectMarker(MarkerTag.PrefixedIdentifier_identifier);
@@ -1092,7 +1095,7 @@
}
@override
- void visitPropertyAccess(PropertyAccess node) {
+ void visitPropertyAccess(covariant PropertyAccessImpl node) {
_expectMarker(MarkerTag.PropertyAccess_target);
node.target?.accept(this);
_expectMarker(MarkerTag.PropertyAccess_propertyName);
@@ -1105,7 +1108,7 @@
@override
void visitRedirectingConstructorInvocation(
- RedirectingConstructorInvocation node) {
+ covariant RedirectingConstructorInvocationImpl node) {
_expectMarker(MarkerTag.RedirectingConstructorInvocation_constructorName);
node.constructorName?.accept(this);
_expectMarker(MarkerTag.RedirectingConstructorInvocation_argumentList);
@@ -1117,13 +1120,13 @@
}
@override
- void visitSetOrMapLiteral(SetOrMapLiteral node) {
+ void visitSetOrMapLiteral(covariant SetOrMapLiteralImpl node) {
_expectMarker(MarkerTag.SetOrMapLiteral_flags);
var mapOrSetBits = _resolution.readByte();
if ((mapOrSetBits & 0x01) != 0) {
- (node as SetOrMapLiteralImpl).becomeMap();
+ node.becomeMap();
} else if ((mapOrSetBits & 0x02) != 0) {
- (node as SetOrMapLiteralImpl).becomeSet();
+ node.becomeSet();
}
_expectMarker(MarkerTag.SetOrMapLiteral_typeArguments);
@@ -1141,7 +1144,7 @@
}
@override
- visitSimpleFormalParameter(SimpleFormalParameter node) {
+ visitSimpleFormalParameter(covariant SimpleFormalParameterImpl node) {
var element = node.declaredElement as ParameterElementImpl?;
if (element == null) {
assert(node.parent is! DefaultFormalParameter);
@@ -1162,7 +1165,7 @@
}
@override
- visitSimpleIdentifier(SimpleIdentifier node) {
+ visitSimpleIdentifier(covariant SimpleIdentifierImpl node) {
_expectMarker(MarkerTag.SimpleIdentifier_staticElement);
node.staticElement = _nextElement();
_expectMarker(MarkerTag.SimpleIdentifier_expression);
@@ -1191,7 +1194,8 @@
}
@override
- void visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+ void visitSuperConstructorInvocation(
+ covariant SuperConstructorInvocationImpl node) {
_expectMarker(MarkerTag.SuperConstructorInvocation_constructorName);
node.constructorName?.accept(this);
_expectMarker(MarkerTag.SuperConstructorInvocation_argumentList);
@@ -1203,26 +1207,26 @@
}
@override
- void visitSuperExpression(SuperExpression node) {
+ void visitSuperExpression(covariant SuperExpressionImpl node) {
_expectMarker(MarkerTag.SuperExpression_expression);
_expression(node);
_expectMarker(MarkerTag.SuperExpression_end);
}
@override
- void visitSymbolLiteral(SymbolLiteral node) {
+ void visitSymbolLiteral(covariant SymbolLiteralImpl node) {
_expression(node);
}
@override
- void visitThisExpression(ThisExpression node) {
+ void visitThisExpression(covariant ThisExpressionImpl node) {
_expectMarker(MarkerTag.ThisExpression_expression);
_expression(node);
_expectMarker(MarkerTag.ThisExpression_end);
}
@override
- void visitThrowExpression(ThrowExpression node) {
+ void visitThrowExpression(covariant ThrowExpressionImpl node) {
_expectMarker(MarkerTag.ThrowExpression_expression);
node.expression.accept(this);
_expectMarker(MarkerTag.ThrowExpression_expression2);
@@ -1247,7 +1251,7 @@
}
@override
- visitTypeName(TypeName node) {
+ visitTypeName(covariant TypeNameImpl node) {
_expectMarker(MarkerTag.TypeName_name);
node.name.accept(this);
_expectMarker(MarkerTag.TypeName_typeArguments);
@@ -1262,6 +1266,7 @@
@override
visitTypeParameterList(TypeParameterList node) {
for (var typeParameter in node.typeParameters) {
+ typeParameter as TypeParameterImpl;
var element = TypeParameterElementImpl.forLinkedNode(
_enclosingElements.last,
typeParameter,
@@ -1419,7 +1424,7 @@
}
}
- void _expression(Expression node) {
+ void _expression(ExpressionImpl node) {
_expectMarker(MarkerTag.Expression_staticType);
node.staticType = _nextType();
}
@@ -1449,7 +1454,7 @@
_expectMarker(MarkerTag.ForParts_end);
}
- void _invocationExpression(InvocationExpression node) {
+ void _invocationExpression(covariant InvocationExpressionImpl node) {
_expectMarker(MarkerTag.InvocationExpression_typeArguments);
node.typeArguments?.accept(this);
_expectMarker(MarkerTag.InvocationExpression_argumentList);
@@ -1458,7 +1463,7 @@
_expression(node);
_expectMarker(MarkerTag.InvocationExpression_end);
// TODO(scheglov) typeArgumentTypes and staticInvokeType?
- var nodeImpl = node as InvocationExpressionImpl;
+ var nodeImpl = node;
nodeImpl.typeArgumentTypes = [];
}
@@ -1529,7 +1534,7 @@
ArgumentList argumentList,
) {
for (var argument in argumentList.arguments) {
- if (argument is NamedExpression) {
+ if (argument is NamedExpressionImpl) {
var nameNode = argument.name.label;
if (executable is ExecutableElement) {
var parameters = executable.parameters;
diff --git a/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart b/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
index cf03d4d..5282bec 100644
--- a/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
+++ b/pkg/analyzer/lib/src/summary2/ast_binary_reader.dart
@@ -5,9 +5,8 @@
import 'dart:typed_data';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
import 'package:analyzer/src/generated/testing/token_factory.dart';
@@ -370,7 +369,7 @@
Tokens.OPEN_CURLY_BRACKET,
const <ClassMember>[],
Tokens.CLOSE_CURLY_BRACKET,
- ) as ClassDeclarationImpl;
+ );
node.nativeClause = nativeClause;
node.linkedContext = LinkedContext(
@@ -412,7 +411,7 @@
withClause,
implementsClause,
Tokens.SEMICOLON,
- ) as ClassTypeAliasImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -496,7 +495,7 @@
initializers,
redirectedConstructor,
AstTestFactory.emptyFunctionBody(),
- ) as ConstructorDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -579,7 +578,7 @@
kind,
AstBinaryFlags.hasInitializer(flags) ? Tokens.COLON : null,
defaultValue,
- ) as DefaultFormalParameterImpl;
+ );
node.summaryData = SummaryDataForFormalParameter(
codeOffset: codeOffset,
codeLength: codeLength,
@@ -606,8 +605,7 @@
var name = readNode() as SimpleIdentifier;
var metadata = _readNodeList<Annotation>();
- var node = astFactory.enumConstantDeclaration(null, metadata, name)
- as EnumConstantDeclarationImpl;
+ var node = astFactory.enumConstantDeclaration(null, metadata, name);
node.linkedContext = LinkedContext(
_unitReader,
@@ -638,7 +636,7 @@
Tokens.OPEN_CURLY_BRACKET,
constants,
Tokens.CLOSE_CURLY_BRACKET,
- ) as EnumDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -667,7 +665,7 @@
configurations,
combinators,
Tokens.SEMICOLON,
- ) as ExportDirectiveImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -707,7 +705,7 @@
leftBracket: Tokens.OPEN_CURLY_BRACKET,
members: const <ClassMember>[],
rightBracket: Tokens.CLOSE_CURLY_BRACKET,
- ) as ExtensionDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -751,7 +749,7 @@
metadata: metadata,
semicolon: Tokens.SEMICOLON,
staticKeyword: AstBinaryFlags.isStatic(flags) ? Tokens.STATIC : null,
- ) as FieldDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -797,7 +795,7 @@
question: AstBinaryFlags.hasQuestion(flags) ? Tokens.QUESTION : null,
requiredKeyword:
AstBinaryFlags.isRequired(flags) ? Tokens.REQUIRED : null,
- ) as FieldFormalParameterImpl;
+ );
node.summaryData = SummaryDataForFormalParameter(
codeOffset: codeOffset,
codeLength: codeLength,
@@ -901,7 +899,7 @@
),
name,
functionExpression,
- ) as FunctionDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -959,7 +957,7 @@
typeParameters,
formalParameters,
Tokens.SEMICOLON,
- ) as FunctionTypeAliasImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -993,7 +991,7 @@
AstBinaryFlags.isRequired(flags) ? Tokens.REQUIRED : null,
returnType: returnType,
typeParameters: typeParameters,
- ) as FunctionTypedFormalParameterImpl;
+ );
node.summaryData = SummaryDataForFormalParameter(
codeOffset: codeOffset,
codeLength: codeLength,
@@ -1035,7 +1033,7 @@
Tokens.EQ,
type,
Tokens.SEMICOLON,
- ) as GenericTypeAliasImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -1106,7 +1104,7 @@
prefixIdentifier,
combinators,
Tokens.SEMICOLON,
- ) as ImportDirectiveImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -1126,13 +1124,15 @@
var index = readNode() as Expression;
// TODO(scheglov) Is this clumsy?
if (target != null) {
- return astFactory.indexExpressionForTarget2(
+ return (astFactory.indexExpressionForTarget2(
target: target,
question: AstBinaryFlags.hasQuestion(flags) ? Tokens.QUESTION : null,
leftBracket: Tokens.OPEN_SQUARE_BRACKET,
index: index,
rightBracket: Tokens.CLOSE_SQUARE_BRACKET,
- )..period = AstBinaryFlags.hasPeriod(flags) ? Tokens.PERIOD_PERIOD : null;
+ ))
+ ..period =
+ AstBinaryFlags.hasPeriod(flags) ? Tokens.PERIOD_PERIOD : null;
} else {
return astFactory.indexExpressionForCascade2(
period: Tokens.PERIOD_PERIOD,
@@ -1248,7 +1248,7 @@
KeywordToken(Keyword.LIBRARY, keywordOffset),
name,
Tokens.SEMICOLON,
- ) as LibraryDirectiveImpl;
+ );
SummaryDataForLibraryDirective(
_unitReader,
node,
@@ -1315,7 +1315,7 @@
typeParameters,
formalParameters,
body,
- ) as MethodDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -1372,7 +1372,7 @@
Tokens.OPEN_CURLY_BRACKET,
const <ClassMember>[],
Tokens.CLOSE_CURLY_BRACKET,
- ) as MixinDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -1548,7 +1548,7 @@
leftBracket: Tokens.OPEN_CURLY_BRACKET,
typeArguments: typeArguments,
rightBracket: Tokens.CLOSE_CURLY_BRACKET,
- ) as SetOrMapLiteralImpl;
+ );
return node;
}
@@ -1586,7 +1586,7 @@
),
requiredKeyword:
AstBinaryFlags.isRequired(flags) ? Tokens.REQUIRED : null,
- ) as SimpleFormalParameterImpl;
+ );
node.summaryData = SummaryDataForFormalParameter(
codeOffset: codeOffset,
codeLength: codeLength,
@@ -1681,7 +1681,7 @@
Tokens.SEMICOLON,
externalKeyword:
AstBinaryFlags.isExternal(flags) ? Tokens.EXTERNAL : null,
- ) as TopLevelVariableDeclarationImpl;
+ );
node.linkedContext = LinkedContext(
_unitReader,
@@ -1726,7 +1726,7 @@
name,
bound != null ? Tokens.EXTENDS : null,
bound,
- ) as TypeParameterImpl;
+ );
node.summaryData = SummaryDataForTypeParameter(
codeOffset: codeOffset,
codeLength: codeLength,
@@ -1786,7 +1786,7 @@
name,
Tokens.EQ,
initializer,
- ) as VariableDeclarationImpl;
+ );
node.hasInitializer = AstBinaryFlags.hasInitializer(flags);
diff --git a/pkg/analyzer/lib/src/summary2/bundle_reader.dart b/pkg/analyzer/lib/src/summary2/bundle_reader.dart
index e178788..ecace4e 100644
--- a/pkg/analyzer/lib/src/summary2/bundle_reader.dart
+++ b/pkg/analyzer/lib/src/summary2/bundle_reader.dart
@@ -5,7 +5,6 @@
import 'dart:typed_data';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/nullability_suffix.dart';
@@ -13,6 +12,7 @@
import 'package:analyzer/source/line_info.dart';
import 'package:analyzer/src/dart/analysis/experiments.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/member.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -944,7 +944,7 @@
declarations: [],
endToken: Tokens.BANG,
featureSet: featureSet,
- ) as CompilationUnitImpl;
+ );
_unit.languageVersion = languageVersion;
_unit.lineInfo = lineInfo;
_unit.summaryData = SummaryDataForCompilationUnit(codeLength);
@@ -1211,7 +1211,7 @@
required this.reference,
required UnitReader unitReader,
required int offset,
- required CompilationUnit unit,
+ required CompilationUnitImpl unit,
required this.indexOffset,
}) : super(unitReader, offset, unit) {
reference.nodeAccessor ??= this;
@@ -1348,7 +1348,7 @@
class _UnitMemberReader implements ReferenceNodeAccessor {
final UnitReader unitReader;
final int offset;
- final CompilationUnit _unit;
+ final CompilationUnitImpl _unit;
final int _index;
CompilationUnitMemberImpl? _node;
diff --git a/pkg/analyzer/lib/src/summary2/default_types_builder.dart b/pkg/analyzer/lib/src/summary2/default_types_builder.dart
index 103f87e..4401ee5 100644
--- a/pkg/analyzer/lib/src/summary2/default_types_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/default_types_builder.dart
@@ -5,6 +5,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/replacement_visitor.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -82,7 +83,7 @@
for (var cycle in allCycles) {
for (var element in cycle) {
var boundNode = element.parameter.bound;
- if (boundNode is TypeName) {
+ if (boundNode is TypeNameImpl) {
boundNode.type = DynamicTypeImpl.instance;
} else {
throw UnimplementedError('(${boundNode.runtimeType}) $boundNode');
@@ -97,8 +98,9 @@
Map<String, TypeParameter>? typeParametersByName;
for (var parameter in typeParameters) {
+ parameter as TypeParameterImpl;
var boundNode = parameter.bound;
- if (boundNode is TypeName) {
+ if (boundNode is TypeNameImpl) {
if (typeParametersByName == null) {
typeParametersByName = {};
for (var parameterNode in typeParameters) {
diff --git a/pkg/analyzer/lib/src/summary2/library_builder.dart b/pkg/analyzer/lib/src/summary2/library_builder.dart
index e6532f5..246a0f3 100644
--- a/pkg/analyzer/lib/src/summary2/library_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/library_builder.dart
@@ -122,7 +122,7 @@
linkingUnit.reference.element as CompilationUnitElementImpl,
reference,
node);
- } else if (node is ast.EnumDeclaration) {
+ } else if (node is ast.EnumDeclarationImpl) {
var name = node.name.name;
var reference = enumRef.getChild(name);
reference.node ??= node;
@@ -147,7 +147,7 @@
linkingUnit.reference.element as CompilationUnitElementImpl,
reference,
node);
- } else if (node is ast.FunctionDeclaration) {
+ } else if (node is ast.FunctionDeclarationImpl) {
var name = node.name.name;
Reference reference;
@@ -193,7 +193,7 @@
linkingUnit.reference.element as CompilationUnitElementImpl,
reference,
node);
- } else if (node is ast.MixinDeclaration) {
+ } else if (node is ast.MixinDeclarationImpl) {
var name = node.name.name;
var reference = mixinRef.getChild(name);
reference.node ??= node;
@@ -259,12 +259,12 @@
var isDefiningUnit = true;
for (var unitContext in context.units) {
for (var node in unitContext.unit!.directives) {
- if (node is ast.ExportDirective) {
+ if (node is ast.ExportDirectiveImpl) {
var exportElement = ExportElementImpl.forLinkedNode(element, node);
if (isDefiningUnit) {
exports.add(exportElement);
}
- } else if (node is ast.ImportDirective) {
+ } else if (node is ast.ImportDirectiveImpl) {
var importElement = ImportElementImpl.forLinkedNode(element, node);
if (isDefiningUnit) {
imports.add(importElement);
diff --git a/pkg/analyzer/lib/src/summary2/linked_element_factory.dart b/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
index 83d3eee..92e167b 100644
--- a/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_element_factory.dart
@@ -329,7 +329,7 @@
parentElement as ClassElementImpl, reference, node);
var element = reference.element as ConstructorElementImpl;
return element;
- } else if (node is EnumDeclaration) {
+ } else if (node is EnumDeclarationImpl) {
EnumElementImpl.forLinkedNode(
parentElement as CompilationUnitElementImpl, reference, node);
assert(reference.element != null);
@@ -350,7 +350,7 @@
}
assert(reference.element != null);
return reference.element;
- } else if (node is FunctionDeclaration) {
+ } else if (node is FunctionDeclarationImpl) {
if (node.propertyKeyword != null) {
_topLevelPropertyAccessor(parent,
parentElement as CompilationUnitElementImpl, reference, node);
@@ -367,7 +367,7 @@
node as TypeAlias);
assert(reference.element != null);
return reference.element;
- } else if (node is MethodDeclaration) {
+ } else if (node is MethodDeclarationImpl) {
if (node.propertyKeyword != null) {
_classPropertyAccessor(
parent, parentElement as ElementImpl, reference, node);
@@ -377,7 +377,7 @@
}
assert(reference.element != null);
return reference.element;
- } else if (node is MixinDeclaration) {
+ } else if (node is MixinDeclarationImpl) {
MixinElementImpl.forLinkedNode(
parentElement as CompilationUnitElementImpl, reference, node);
assert(reference.element != null);
diff --git a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
index bde642f..2888aa1 100644
--- a/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
+++ b/pkg/analyzer/lib/src/summary2/linked_unit_context.dart
@@ -70,11 +70,11 @@
var libraryElement =
libraryContext.reference.element as LibraryElementImpl;
for (var directive in unit!.directives) {
- if (directive is ExportDirective) {
+ if (directive is ExportDirectiveImpl) {
if (directive.element == null) {
ExportElementImpl.forLinkedNode(libraryElement, directive);
}
- } else if (directive is ImportDirective) {
+ } else if (directive is ImportDirectiveImpl) {
if (directive.element == null) {
ImportElementImpl.forLinkedNode(libraryElement, directive);
}
@@ -345,9 +345,9 @@
return const <Annotation>[];
}
- List<MethodDeclaration> getMethods(CompilationUnitMember node) {
+ List<MethodDeclarationImpl> getMethods(CompilationUnitMember node) {
return _getClassOrExtensionOrMixinMembers(node)
- .whereType<MethodDeclaration>()
+ .whereType<MethodDeclarationImpl>()
.toList();
}
@@ -394,36 +394,36 @@
}
}
- TypeParameterList? getTypeParameters2(AstNode node) {
- if (node is ClassDeclaration) {
+ TypeParameterListImpl? getTypeParameters2(AstNode node) {
+ if (node is ClassDeclarationImpl) {
return node.typeParameters;
- } else if (node is ClassTypeAlias) {
+ } else if (node is ClassTypeAliasImpl) {
return node.typeParameters;
- } else if (node is ConstructorDeclaration) {
+ } else if (node is ConstructorDeclarationImpl) {
return null;
- } else if (node is DefaultFormalParameter) {
+ } else if (node is DefaultFormalParameterImpl) {
return getTypeParameters2(node.parameter);
- } else if (node is ExtensionDeclaration) {
+ } else if (node is ExtensionDeclarationImpl) {
return node.typeParameters;
- } else if (node is FieldFormalParameter) {
+ } else if (node is FieldFormalParameterImpl) {
return node.typeParameters;
- } else if (node is FunctionDeclaration) {
+ } else if (node is FunctionDeclarationImpl) {
return getTypeParameters2(node.functionExpression);
- } else if (node is FunctionExpression) {
+ } else if (node is FunctionExpressionImpl) {
return node.typeParameters;
- } else if (node is FunctionTypedFormalParameter) {
+ } else if (node is FunctionTypedFormalParameterImpl) {
return node.typeParameters;
- } else if (node is FunctionTypeAlias) {
+ } else if (node is FunctionTypeAliasImpl) {
return node.typeParameters;
- } else if (node is GenericFunctionType) {
+ } else if (node is GenericFunctionTypeImpl) {
return node.typeParameters;
- } else if (node is GenericTypeAlias) {
+ } else if (node is GenericTypeAliasImpl) {
return node.typeParameters;
- } else if (node is MethodDeclaration) {
+ } else if (node is MethodDeclarationImpl) {
return node.typeParameters;
- } else if (node is MixinDeclaration) {
+ } else if (node is MixinDeclarationImpl) {
return node.typeParameters;
- } else if (node is SimpleFormalParameter) {
+ } else if (node is SimpleFormalParameterImpl) {
return null;
} else {
throw UnimplementedError('${node.runtimeType}');
diff --git a/pkg/analyzer/lib/src/summary2/metadata_resolver.dart b/pkg/analyzer/lib/src/summary2/metadata_resolver.dart
index bcd9298..170d30f 100644
--- a/pkg/analyzer/lib/src/summary2/metadata_resolver.dart
+++ b/pkg/analyzer/lib/src/summary2/metadata_resolver.dart
@@ -5,6 +5,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/scope.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/summary2/ast_resolver.dart';
import 'package:analyzer/src/summary2/link.dart';
@@ -20,7 +21,7 @@
: _scope = _libraryScope;
@override
- void visitAnnotation(Annotation node) {
+ void visitAnnotation(covariant AnnotationImpl node) {
node.elementAnnotation = ElementAnnotationImpl(_unitElement);
var astResolver = AstResolver(_linker, _unitElement, _scope);
diff --git a/pkg/analyzer/lib/src/summary2/named_type_builder.dart b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
index 5fff83c..47ea3f0 100644
--- a/pkg/analyzer/lib/src/summary2/named_type_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/named_type_builder.dart
@@ -8,6 +8,7 @@
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/type_visitor.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -35,7 +36,7 @@
/// The node for which this builder is created, or `null` if the builder
/// was detached from its node, e.g. during computing default types for
/// type parameters.
- final TypeName? node;
+ final TypeNameImpl? node;
/// The actual built type, not a [TypeBuilder] anymore.
///
@@ -49,7 +50,7 @@
factory NamedTypeBuilder.of(
TypeSystemImpl typeSystem,
- TypeName node,
+ TypeNameImpl node,
Element element,
NullabilitySuffix nullabilitySuffix,
) {
diff --git a/pkg/analyzer/lib/src/summary2/reference_resolver.dart b/pkg/analyzer/lib/src/summary2/reference_resolver.dart
index fa6e3a0..5d78a69 100644
--- a/pkg/analyzer/lib/src/summary2/reference_resolver.dart
+++ b/pkg/analyzer/lib/src/summary2/reference_resolver.dart
@@ -416,11 +416,11 @@
}
@override
- void visitTypeName(TypeName node) {
+ void visitTypeName(covariant TypeNameImpl node) {
var typeIdentifier = node.name;
Element? element;
- if (typeIdentifier is PrefixedIdentifier) {
+ if (typeIdentifier is PrefixedIdentifierImpl) {
var prefix = typeIdentifier.prefix;
var prefixName = prefix.name;
var prefixElement = scope.lookup(prefixName).getter;
@@ -434,7 +434,7 @@
nameNode.staticElement = element;
}
} else {
- var nameNode = typeIdentifier as SimpleIdentifier;
+ var nameNode = typeIdentifier as SimpleIdentifierImpl;
var name = nameNode.name;
if (name == 'void') {
@@ -491,7 +491,7 @@
void _createTypeParameterElement(
ElementImpl enclosingElement,
- TypeParameter node,
+ TypeParameterImpl node,
) {
var element = TypeParameterElementImpl.forLinkedNode(
enclosingElement,
@@ -507,6 +507,7 @@
if (typeParameterList == null) return;
for (var typeParameter in typeParameterList.typeParameters) {
+ typeParameter as TypeParameterImpl;
_createTypeParameterElement(enclosingElement, typeParameter);
}
}
diff --git a/pkg/analyzer/lib/src/summary2/top_level_inference.dart b/pkg/analyzer/lib/src/summary2/top_level_inference.dart
index 77a0c47..4138d99 100644
--- a/pkg/analyzer/lib/src/summary2/top_level_inference.dart
+++ b/pkg/analyzer/lib/src/summary2/top_level_inference.dart
@@ -7,6 +7,7 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/scope.dart';
import 'package:analyzer/dart/element/type.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/type.dart';
@@ -147,7 +148,7 @@
parameterNode = parameterNode.parameter;
}
- if (parameterNode is FieldFormalParameter &&
+ if (parameterNode is FieldFormalParameterImpl &&
parameterNode.type == null &&
parameterNode.parameters == null) {
parameterNode.identifier.staticElement = parameterElement;
diff --git a/pkg/analyzer/lib/src/summary2/types_builder.dart b/pkg/analyzer/lib/src/summary2/types_builder.dart
index d58f96d..3555861 100644
--- a/pkg/analyzer/lib/src/summary2/types_builder.dart
+++ b/pkg/analyzer/lib/src/summary2/types_builder.dart
@@ -8,6 +8,7 @@
import 'package:analyzer/dart/element/nullability_suffix.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/analysis/session.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/extensions.dart';
import 'package:analyzer/src/dart/element/class_hierarchy.dart';
import 'package:analyzer/src/dart/element/element.dart';
@@ -226,7 +227,7 @@
if (withClause == null) return;
for (var mixinNode in withClause.mixinTypes) {
- var mixinType = _inferSingle(mixinNode);
+ var mixinType = _inferSingle(mixinNode as TypeNameImpl);
interfacesMerger.addWithSupertypes(mixinType);
}
}
@@ -262,7 +263,7 @@
return result;
}
- InterfaceType _inferSingle(TypeName mixinNode) {
+ InterfaceType _inferSingle(TypeNameImpl mixinNode) {
var mixinType = _interfaceType(mixinNode.type!);
if (mixinNode.typeArguments != null) {
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 799dee7..3ba35e2 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,5 +1,5 @@
name: analyzer
-version: 1.1.0
+version: 1.2.0-dev
description: This package provides a library that performs static analysis of Dart code.
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/analyzer
diff --git a/pkg/analyzer/test/dart/ast/ast_test.dart b/pkg/analyzer/test/dart/ast/ast_test.dart
index 0c854a3..e3fd7f5 100644
--- a/pkg/analyzer/test/dart/ast/ast_test.dart
+++ b/pkg/analyzer/test/dart/ast/ast_test.dart
@@ -4,8 +4,8 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/parser.dart';
@@ -148,7 +148,7 @@
void test_firstTokenAfterCommentAndMetadata_all_inverted() {
Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
externalKeyword.offset = 14;
- ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
+ var declaration = AstTestFactory.constructorDeclaration2(
Keyword.CONST,
Keyword.FACTORY,
AstTestFactory.identifier3('int'),
@@ -166,7 +166,7 @@
void test_firstTokenAfterCommentAndMetadata_all_normal() {
Token token = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
token.offset = 0;
- ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
+ var declaration = AstTestFactory.constructorDeclaration2(
Keyword.CONST,
Keyword.FACTORY,
AstTestFactory.identifier3('int'),
@@ -195,7 +195,7 @@
void test_firstTokenAfterCommentAndMetadata_externalOnly() {
Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
- ConstructorDeclaration declaration = AstTestFactory.constructorDeclaration2(
+ var declaration = AstTestFactory.constructorDeclaration2(
null,
null,
AstTestFactory.identifier3('int'),
@@ -898,8 +898,7 @@
nodes.add(firstNode);
nodes.add(secondNode);
nodes.add(thirdNode);
- NodeList<AstNode> list =
- astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
+ var list = astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
list.addAll(nodes);
expect(list, hasLength(3));
AstNode fourthNode = AstTestFactory.integer(0);
@@ -912,8 +911,7 @@
void test_set_negative() {
AstNode node = AstTestFactory.booleanLiteral(true);
- NodeList<AstNode> list =
- astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
+ var list = astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
try {
list[-1] = node;
fail("Expected IndexOutOfBoundsException");
@@ -924,8 +922,7 @@
void test_set_tooBig() {
AstNode node = AstTestFactory.booleanLiteral(true);
- NodeList<AstNode> list =
- astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
+ var list = astFactory.nodeList<AstNode>(AstTestFactory.argumentList());
try {
list[1] = node;
fail("Expected IndexOutOfBoundsException");
@@ -1723,7 +1720,7 @@
class VariableDeclarationTest extends ParserTestCase {
void test_getDocumentationComment_onGrandParent() {
VariableDeclaration varDecl = AstTestFactory.variableDeclaration("a");
- TopLevelVariableDeclaration decl =
+ var decl =
AstTestFactory.topLevelVariableDeclaration2(Keyword.VAR, [varDecl]);
Comment comment = astFactory.documentationComment([]);
expect(varDecl.documentationComment, isNull);
@@ -1733,7 +1730,7 @@
}
void test_getDocumentationComment_onNode() {
- VariableDeclaration decl = AstTestFactory.variableDeclaration("a");
+ var decl = AstTestFactory.variableDeclaration("a");
Comment comment = astFactory.documentationComment([]);
decl.documentationComment = comment;
expect(decl.documentationComment, isNotNull);
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index 31f410d..d785728 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -4,12 +4,12 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/scope.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/type_provider.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
import 'package:analyzer/src/dart/element/scope.dart';
@@ -480,7 +480,7 @@
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/44522')
test_visitExportDirective_noCombinators() async {
- ExportDirective directive = AstTestFactory.exportDirective2('dart:math');
+ var directive = AstTestFactory.exportDirective2('dart:math');
directive.element = ElementFactory.exportFor(
ElementFactory.library(_definingLibrary.context, "lib"));
_resolveNode(directive);
@@ -494,8 +494,7 @@
ElementFactory.fieldElement(fieldName, false, false, false, intType);
ClassElementImpl classA = ElementFactory.classElement2("A");
classA.fields = <FieldElement>[fieldElement];
- FieldFormalParameter parameter =
- AstTestFactory.fieldFormalParameter2(fieldName);
+ var parameter = AstTestFactory.fieldFormalParameter2(fieldName);
FieldFormalParameterElementImpl parameterElement =
ElementFactory.fieldFormalParameter(parameter.identifier);
parameterElement.field = fieldElement;
@@ -507,8 +506,7 @@
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/44522')
test_visitImportDirective_noCombinators_noPrefix() async {
- ImportDirective directive =
- AstTestFactory.importDirective3('dart:math', null);
+ var directive = AstTestFactory.importDirective3('dart:math', null);
directive.element = ElementFactory.importFor(
ElementFactory.library(_definingLibrary.context, "lib"), null);
_resolveNode(directive);
@@ -522,8 +520,7 @@
ElementFactory.library(_definingLibrary.context, "lib"),
ElementFactory.prefix(prefixName));
_definingLibrary.imports = <ImportElement>[importElement];
- ImportDirective directive =
- AstTestFactory.importDirective3('dart:math', prefixName);
+ var directive = AstTestFactory.importDirective3('dart:math', prefixName);
directive.element = importElement;
_resolveNode(directive);
_listener.assertNoErrors();
@@ -532,7 +529,7 @@
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/44522')
test_visitImportDirective_withCombinators() async {
ShowCombinator combinator = AstTestFactory.showCombinator2(["A", "B", "C"]);
- ImportDirective directive =
+ var directive =
AstTestFactory.importDirective3('dart:math', null, [combinator]);
LibraryElementImpl library =
ElementFactory.library(_definingLibrary.context, "lib");
@@ -565,7 +562,7 @@
ConstructorElement constructor =
ElementFactory.constructorElement2(classA, constructorName);
classA.constructors = <ConstructorElement>[constructor];
- ConstructorName name = AstTestFactory.constructorName(
+ var name = AstTestFactory.constructorName(
AstTestFactory.typeName(classA), constructorName);
name.staticElement = constructor;
InstanceCreationExpression creation =
@@ -580,7 +577,7 @@
ConstructorElement constructor =
ElementFactory.constructorElement2(classA, constructorName);
classA.constructors = <ConstructorElement>[constructor];
- ConstructorName name = AstTestFactory.constructorName(
+ var name = AstTestFactory.constructorName(
AstTestFactory.typeName(classA), constructorName);
name.staticElement = constructor;
InstanceCreationExpression creation =
@@ -599,7 +596,7 @@
ElementFactory.namedParameter2(parameterName, _typeProvider.intType);
constructor.parameters = <ParameterElement>[parameter];
classA.constructors = <ConstructorElement>[constructor];
- ConstructorName name = AstTestFactory.constructorName(
+ var name = AstTestFactory.constructorName(
AstTestFactory.typeName(classA), constructorName);
name.staticElement = constructor;
InstanceCreationExpression creation =
@@ -618,7 +615,7 @@
test_visitMethodInvocation() async {
InterfaceType numType = _typeProvider.numType;
- SimpleIdentifier left = AstTestFactory.identifier3("i");
+ var left = AstTestFactory.identifier3("i");
left.staticType = numType;
String methodName = "abs";
MethodInvocation invocation =
@@ -631,7 +628,7 @@
test_visitPrefixedIdentifier_dynamic() async {
DartType dynamicType = _typeProvider.dynamicType;
- SimpleIdentifier target = AstTestFactory.identifier3("a");
+ var target = AstTestFactory.identifier3("a");
VariableElementImpl variable = ElementFactory.localVariableElement(target);
variable.type = dynamicType;
target.staticElement = variable;
diff --git a/pkg/analyzer/test/generated/extension_methods_parser_test.dart b/pkg/analyzer/test/generated/extension_methods_parser_test.dart
index e76b4ac..aca31bc 100644
--- a/pkg/analyzer/test/generated/extension_methods_parser_test.dart
+++ b/pkg/analyzer/test/generated/extension_methods_parser_test.dart
@@ -4,7 +4,6 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/src/dart/ast/ast.dart' show CompilationUnitImpl;
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
import 'package:pub_semver/src/version.dart';
@@ -155,9 +154,8 @@
}
void test_parse_toplevel_member_called_late_calling_self() {
- var unit =
- parseCompilationUnit('void late() { late(); }', featureSet: nonNullable)
- as CompilationUnitImpl;
+ var unit = parseCompilationUnit('void late() { late(); }',
+ featureSet: nonNullable);
var method = unit.declarations[0] as FunctionDeclaration;
expect(method.documentationComment, isNull);
diff --git a/pkg/analyzer/test/generated/nnbd_parser_test.dart b/pkg/analyzer/test/generated/nnbd_parser_test.dart
index c1376ea..f8f5bcd 100644
--- a/pkg/analyzer/test/generated/nnbd_parser_test.dart
+++ b/pkg/analyzer/test/generated/nnbd_parser_test.dart
@@ -24,7 +24,7 @@
@reflectiveTest
class NNBDParserTest extends FastaParserTestCase {
@override
- CompilationUnit parseCompilationUnit(String content,
+ CompilationUnitImpl parseCompilationUnit(String content,
{List<ErrorCode>? codes,
List<ExpectedError>? errors,
FeatureSet? featureSet}) =>
diff --git a/pkg/analyzer/test/generated/parser_test_base.dart b/pkg/analyzer/test/generated/parser_test_base.dart
index b8699be..17c0c9f 100644
--- a/pkg/analyzer/test/generated/parser_test_base.dart
+++ b/pkg/analyzer/test/generated/parser_test_base.dart
@@ -11,12 +11,11 @@
show ScannerConfiguration, ScannerResult, scanString;
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
-import 'package:analyzer/src/dart/ast/ast.dart'
- show ClassDeclarationImpl, CompilationUnitImpl;
+import 'package:analyzer/src/dart/ast/ast.dart' show CompilationUnitImpl;
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/fasta/ast_builder.dart';
@@ -380,14 +379,13 @@
}
@override
- CompilationUnit parseCompilationUnit(String content,
+ CompilationUnitImpl parseCompilationUnit(String content,
{List<ErrorCode>? codes,
List<ExpectedError>? errors,
FeatureSet? featureSet}) {
GatheringErrorListener listener = GatheringErrorListener(checkRanges: true);
- CompilationUnit unit =
- parseCompilationUnit2(content, listener, featureSet: featureSet);
+ var unit = parseCompilationUnit2(content, listener, featureSet: featureSet);
// Assert and return result
if (codes != null) {
@@ -401,7 +399,7 @@
return unit;
}
- CompilationUnit parseCompilationUnit2(
+ CompilationUnitImpl parseCompilationUnit2(
String content, GatheringErrorListener listener,
{LanguageVersionToken? languageVersion, FeatureSet? featureSet}) {
featureSet ??= FeatureSet.forTesting();
@@ -817,7 +815,7 @@
Tokens.OPEN_CURLY_BRACKET /* leftBracket */,
<ClassMember>[],
Tokens.CLOSE_CURLY_BRACKET /* rightBracket */,
- ) as ClassDeclarationImpl;
+ );
// TODO(danrubel): disambiguate between class and mixin
currentToken = fastaParser.parseClassMember(currentToken, className);
//currentToken = fastaParser.parseMixinMember(currentToken);
@@ -857,7 +855,7 @@
}
@override
- CompilationUnit parseCompilationUnit2() {
+ CompilationUnitImpl parseCompilationUnit2() {
var result = super.parseCompilationUnit2();
expect(currentToken.isEof, isTrue, reason: currentToken.lexeme);
expect(astBuilder.stack, hasLength(0));
@@ -1192,7 +1190,7 @@
featureSet: FeatureSet.forTesting(),
);
parser.enableOptionalNewAndConst = enableOptionalNewAndConst;
- CompilationUnit unit = parser.parseCompilationUnit(result.tokens);
+ var unit = parser.parseCompilationUnit(result.tokens);
unit.lineInfo = LineInfo(result.lineStarts);
return unit;
}
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
index 8c50eca..c214e6d 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
@@ -327,7 +327,7 @@
ConstructorElementImpl constructor =
ElementFactory.constructorElement2(elementC, null);
elementC.constructors = <ConstructorElement>[constructor];
- TypeName typeName =
+ var typeName =
AstTestFactory.typeName(elementC, [AstTestFactory.typeName(elementI)]);
typeName.type = interfaceTypeStar(elementC,
typeArguments: [interfaceTypeStar(elementI)]);
@@ -525,7 +525,7 @@
/// @param value the value of the literal
/// @return an integer literal that has been resolved to the correct type
DoubleLiteral _resolvedDouble(double value) {
- DoubleLiteral literal = AstTestFactory.doubleLiteral(value);
+ var literal = AstTestFactory.doubleLiteral(value);
literal.staticType = _typeProvider.doubleType;
return literal;
}
@@ -535,7 +535,7 @@
/// @param value the value of the literal
/// @return an integer literal that has been resolved to the correct type
IntegerLiteral _resolvedInteger(int value) {
- IntegerLiteral literal = AstTestFactory.integer(value);
+ var literal = AstTestFactory.integer(value);
literal.staticType = _typeProvider.intType;
return literal;
}
@@ -545,7 +545,7 @@
/// @param value the value of the literal
/// @return a string literal that has been resolved to the correct type
SimpleStringLiteral _resolvedString(String value) {
- SimpleStringLiteral string = AstTestFactory.string2(value);
+ var string = AstTestFactory.string2(value);
string.staticType = _typeProvider.stringType;
return string;
}
@@ -558,7 +558,7 @@
/// @return a simple identifier that has been resolved to a variable element
/// with the given type
SimpleIdentifier _resolvedVariable(InterfaceType type, String variableName) {
- SimpleIdentifier identifier = AstTestFactory.identifier3(variableName);
+ var identifier = AstTestFactory.identifier3(variableName);
VariableElementImpl element =
ElementFactory.localVariableElement(identifier);
element.type = type;
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 23ee17b..57f5ce0 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -4,9 +4,9 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
@@ -2733,7 +2733,7 @@
}
void test_classDeclaration() {
- ClassDeclaration node = AstTestFactory.classDeclaration(
+ var node = AstTestFactory.classDeclaration(
null,
"A",
AstTestFactory.typeParameterList(["E"]),
@@ -2758,7 +2758,7 @@
}
void test_classTypeAlias() {
- ClassTypeAlias node = AstTestFactory.classTypeAlias(
+ var node = AstTestFactory.classTypeAlias(
"A",
AstTestFactory.typeParameterList(["E"]),
null,
@@ -2814,7 +2814,7 @@
}
void test_constructorDeclaration() {
- ConstructorDeclaration node = AstTestFactory.constructorDeclaration2(
+ var node = AstTestFactory.constructorDeclaration2(
null,
null,
AstTestFactory.identifier3("C"),
@@ -2867,7 +2867,7 @@
}
void test_declaredIdentifier() {
- DeclaredIdentifier node =
+ var node =
AstTestFactory.declaredIdentifier4(AstTestFactory.typeName4("C"), "i");
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
@@ -2903,7 +2903,7 @@
}
void test_enumDeclaration() {
- EnumDeclaration node = AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]);
+ var node = AstTestFactory.enumDeclaration2("E", ["ONE", "TWO"]);
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
@@ -2912,7 +2912,7 @@
}
void test_exportDirective() {
- ExportDirective node = AstTestFactory.exportDirective2("", [
+ var node = AstTestFactory.exportDirective2("", [
AstTestFactory.hideCombinator2(["C"])
]);
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
@@ -2940,7 +2940,7 @@
}
void test_fieldDeclaration() {
- FieldDeclaration node = AstTestFactory.fieldDeclaration(
+ var node = AstTestFactory.fieldDeclaration(
false,
null,
AstTestFactory.typeName4("C"),
@@ -2953,7 +2953,7 @@
}
void test_fieldFormalParameter() {
- FieldFormalParameter node = AstTestFactory.fieldFormalParameter(
+ var node = AstTestFactory.fieldFormalParameter(
null,
AstTestFactory.typeName4("C"),
"f",
@@ -3035,7 +3035,7 @@
}
void test_functionDeclaration() {
- FunctionDeclaration node = AstTestFactory.functionDeclaration(
+ var node = AstTestFactory.functionDeclaration(
AstTestFactory.typeName4("R"),
null,
"f",
@@ -3082,7 +3082,7 @@
}
void test_functionTypeAlias() {
- FunctionTypeAlias node = AstTestFactory.typeAlias(
+ var node = AstTestFactory.typeAlias(
AstTestFactory.typeName4("R"),
"F",
AstTestFactory.typeParameterList(["E"]),
@@ -3098,11 +3098,10 @@
}
void test_functionTypedFormalParameter() {
- FunctionTypedFormalParameter node =
- AstTestFactory.functionTypedFormalParameter(
- AstTestFactory.typeName4("R"),
- "f",
- [AstTestFactory.simpleFormalParameter3("p")]);
+ var node = AstTestFactory.functionTypedFormalParameter(
+ AstTestFactory.typeName4("R"),
+ "f",
+ [AstTestFactory.simpleFormalParameter3("p")]);
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [
AstTestFactory.annotation(AstTestFactory.identifier3("a"))
@@ -3136,7 +3135,7 @@
}
void test_importDirective() {
- ImportDirective node = AstTestFactory.importDirective3("", "p", [
+ var node = AstTestFactory.importDirective3("", "p", [
AstTestFactory.showCombinator2(["A"]),
AstTestFactory.hideCombinator2(["B"])
]);
@@ -3192,7 +3191,7 @@
}
void test_libraryDirective() {
- LibraryDirective node = AstTestFactory.libraryDirective2("lib");
+ var node = AstTestFactory.libraryDirective2("lib");
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
@@ -3231,7 +3230,7 @@
}
void test_methodDeclaration() {
- MethodDeclaration node = AstTestFactory.methodDeclaration2(
+ var node = AstTestFactory.methodDeclaration2(
null,
AstTestFactory.typeName4("A"),
null,
@@ -3282,7 +3281,7 @@
}
void test_partDirective() {
- PartDirective node = AstTestFactory.partDirective2("");
+ var node = AstTestFactory.partDirective2("");
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
@@ -3290,7 +3289,7 @@
}
void test_partOfDirective() {
- PartOfDirective node = AstTestFactory.partOfDirective(
+ var node = AstTestFactory.partOfDirective(
AstTestFactory.libraryIdentifier2(["lib"]));
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
@@ -3346,7 +3345,7 @@
}
void test_simpleFormalParameter() {
- SimpleFormalParameter node = AstTestFactory.simpleFormalParameter4(
+ var node = AstTestFactory.simpleFormalParameter4(
AstTestFactory.typeName4("T"), "p");
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata = [
@@ -3405,11 +3404,10 @@
}
void test_topLevelVariableDeclaration() {
- TopLevelVariableDeclaration node =
- AstTestFactory.topLevelVariableDeclaration(
- null,
- AstTestFactory.typeName4("T"),
- [AstTestFactory.variableDeclaration("t")]);
+ var node = AstTestFactory.topLevelVariableDeclaration(
+ null,
+ AstTestFactory.typeName4("T"),
+ [AstTestFactory.variableDeclaration("t")]);
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
.add(AstTestFactory.annotation(AstTestFactory.identifier3("a")));
@@ -3456,7 +3454,7 @@
}
void test_variableDeclaration() {
- VariableDeclaration node =
+ var node =
AstTestFactory.variableDeclaration2("a", AstTestFactory.nullLiteral());
node.documentationComment = astFactory.endOfLineComment(EMPTY_TOKEN_LIST);
node.metadata
@@ -3467,7 +3465,7 @@
}
void test_variableDeclarationList() {
- VariableDeclarationList node = AstTestFactory.variableDeclarationList(
+ var node = AstTestFactory.variableDeclarationList(
null,
AstTestFactory.typeName4("T"),
[AstTestFactory.variableDeclaration("a")]);
diff --git a/pkg/analyzer/test/generated/variance_parser_test.dart b/pkg/analyzer/test/generated/variance_parser_test.dart
index bdb86c3..1208056 100644
--- a/pkg/analyzer/test/generated/variance_parser_test.dart
+++ b/pkg/analyzer/test/generated/variance_parser_test.dart
@@ -22,7 +22,7 @@
@reflectiveTest
class VarianceParserTest extends FastaParserTestCase {
@override
- CompilationUnit parseCompilationUnit(String content,
+ CompilationUnitImpl parseCompilationUnit(String content,
{List<ErrorCode>? codes,
List<ExpectedError>? errors,
FeatureSet? featureSet}) {
diff --git a/pkg/analyzer/test/src/dart/ast/to_source_visitor_test.dart b/pkg/analyzer/test/src/dart/ast/to_source_visitor_test.dart
index 48e9a27..bd36abc 100644
--- a/pkg/analyzer/test/src/dart/ast/to_source_visitor_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/to_source_visitor_test.dart
@@ -4,9 +4,8 @@
import 'package:analyzer/dart/analysis/utilities.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/to_source_visitor.dart';
import 'package:analyzer/src/generated/testing/ast_test_factory.dart';
import 'package:analyzer/src/generated/testing/token_factory.dart';
@@ -999,7 +998,7 @@
void test_visitFieldFormalParameter_type_covariant() {
var expected = AstTestFactory.fieldFormalParameter(
- null, AstTestFactory.typeName4("A"), "a") as FieldFormalParameterImpl;
+ null, AstTestFactory.typeName4("A"), "a");
expected.covariantKeyword =
TokenFactory.tokenFromKeyword(Keyword.COVARIANT);
_assertSource("covariant A this.a", expected);
@@ -1406,14 +1405,12 @@
}
void test_visitFunctionDeclaration_external() {
- FunctionDeclaration functionDeclaration =
- AstTestFactory.functionDeclaration(
- null,
- null,
- "f",
- AstTestFactory.functionExpression2(
- AstTestFactory.formalParameterList(),
- AstTestFactory.emptyFunctionBody()));
+ var functionDeclaration = AstTestFactory.functionDeclaration(
+ null,
+ null,
+ "f",
+ AstTestFactory.functionExpression2(AstTestFactory.formalParameterList(),
+ AstTestFactory.emptyFunctionBody()));
functionDeclaration.externalKeyword =
TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
_assertSource("external f();", functionDeclaration);
@@ -1598,7 +1595,7 @@
void test_visitFunctionTypedFormalParameter_type_covariant() {
var expected = AstTestFactory.functionTypedFormalParameter(
- AstTestFactory.typeName4("T"), "f") as FunctionTypedFormalParameterImpl;
+ AstTestFactory.typeName4("T"), "f");
expected.covariantKeyword =
TokenFactory.tokenFromKeyword(Keyword.COVARIANT);
_assertSource("covariant T f()", expected);
@@ -2595,7 +2592,7 @@
void test_visitSimpleFormalParameter_type_covariant() {
var expected = AstTestFactory.simpleFormalParameter4(
- AstTestFactory.typeName4("A"), "a") as SimpleFormalParameterImpl;
+ AstTestFactory.typeName4("A"), "a");
expected.covariantKeyword =
TokenFactory.tokenFromKeyword(Keyword.COVARIANT);
_assertSource("covariant A a", expected);
diff --git a/pkg/analyzer/test/src/dart/ast/utilities_test.dart b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
index 1fd52fa..901b093 100644
--- a/pkg/analyzer/test/src/dart/ast/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/utilities_test.dart
@@ -5,12 +5,12 @@
import 'package:analyzer/dart/analysis/features.dart';
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/dart/element/type_provider.dart';
import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/generated/engine.dart';
@@ -135,12 +135,13 @@
final TypeProvider typeProvider = TestTypeProvider();
void test_topLevelVariableDeclaration_external() {
- TopLevelVariableDeclaration fromNode =
- AstTestFactory.topLevelVariableDeclaration2(
- Keyword.VAR, [AstTestFactory.variableDeclaration('x')],
- isExternal: false);
+ var fromNode = AstTestFactory.topLevelVariableDeclaration2(
+ Keyword.VAR, [AstTestFactory.variableDeclaration('x')],
+ isExternal: false);
TopLevelVariableElement element = TopLevelVariableElementImpl('x', -1);
- fromNode.variables.variables[0].name.staticElement = element;
+ (fromNode.variables.variables[0] as VariableDeclarationImpl)
+ .name
+ .staticElement = element;
TopLevelVariableDeclaration toNode1 =
AstTestFactory.topLevelVariableDeclaration2(
Keyword.VAR, [AstTestFactory.variableDeclaration('x')],
@@ -158,7 +159,7 @@
}
void test_visitAdjacentStrings() {
- AdjacentStrings createNode() => astFactory.adjacentStrings([
+ AdjacentStringsImpl createNode() => astFactory.adjacentStrings([
astFactory.simpleStringLiteral(
TokenFactory.tokenFromString('hello'),
'hello',
@@ -169,7 +170,7 @@
)
]);
- AdjacentStrings fromNode = createNode();
+ var fromNode = createNode();
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('B'));
fromNode.staticType = staticType;
@@ -180,7 +181,7 @@
void test_visitAnnotation() {
String annotationName = "proxy";
- Annotation fromNode =
+ var fromNode =
AstTestFactory.annotation(AstTestFactory.identifier3(annotationName));
Element element = ElementFactory.topLevelVariableElement2(annotationName);
fromNode.element = element;
@@ -198,7 +199,7 @@
AstTestFactory.identifier3(annotationClassName),
AstTestFactory.identifier3(annotationConstructorName),
AstTestFactory.argumentList(
- [AstTestFactory.identifier3(argumentName)])) as AnnotationImpl;
+ [AstTestFactory.identifier3(argumentName)]));
var elementA = ElementFactory.classElement2(annotationClassName, ['T']);
var element = ElementFactory.constructorElement(
elementA, annotationConstructorName, true, [typeProvider.dynamicType]);
@@ -211,7 +212,7 @@
AstTestFactory.identifier3(annotationClassName),
AstTestFactory.identifier3(annotationConstructorName),
AstTestFactory.argumentList(
- [AstTestFactory.identifier3(argumentName)])) as AnnotationImpl;
+ [AstTestFactory.identifier3(argumentName)]));
toNode.typeArguments = AstTestFactory.typeArgumentList2(
[AstTestFactory.typeName4(typeArgumentName)]);
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -222,7 +223,7 @@
}
void test_visitAsExpression() {
- AsExpression fromNode = AstTestFactory.asExpression(
+ var fromNode = AstTestFactory.asExpression(
AstTestFactory.identifier3("x"), AstTestFactory.typeName4("A"));
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('B'));
fromNode.staticType = staticType;
@@ -233,7 +234,7 @@
}
void test_visitAssignmentExpression() {
- AssignmentExpression fromNode = AstTestFactory.assignmentExpression(
+ var fromNode = AstTestFactory.assignmentExpression(
AstTestFactory.identifier3("a"),
TokenType.PLUS_EQ,
AstTestFactory.identifier3("b"));
@@ -251,7 +252,7 @@
}
void test_visitBinaryExpression() {
- BinaryExpression fromNode = AstTestFactory.binaryExpression(
+ var fromNode = AstTestFactory.binaryExpression(
AstTestFactory.identifier3("a"),
TokenType.PLUS,
AstTestFactory.identifier3("b"));
@@ -269,7 +270,7 @@
}
void test_visitBooleanLiteral() {
- BooleanLiteral fromNode = AstTestFactory.booleanLiteral(true);
+ var fromNode = AstTestFactory.booleanLiteral(true);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
BooleanLiteral toNode = AstTestFactory.booleanLiteral(true);
@@ -278,7 +279,7 @@
}
void test_visitCascadeExpression() {
- CascadeExpression fromNode = AstTestFactory.cascadeExpression(
+ var fromNode = AstTestFactory.cascadeExpression(
AstTestFactory.identifier3("a"), [AstTestFactory.identifier3("b")]);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -289,7 +290,7 @@
}
void test_visitCompilationUnit() {
- CompilationUnit fromNode = AstTestFactory.compilationUnit();
+ var fromNode = AstTestFactory.compilationUnit();
CompilationUnitElement element = CompilationUnitElementImpl();
fromNode.element = element;
CompilationUnit toNode = AstTestFactory.compilationUnit();
@@ -298,7 +299,7 @@
}
void test_visitConditionalExpression() {
- ConditionalExpression fromNode = AstTestFactory.conditionalExpression(
+ var fromNode = AstTestFactory.conditionalExpression(
AstTestFactory.identifier3("c"),
AstTestFactory.identifier3("a"),
AstTestFactory.identifier3("b"));
@@ -318,7 +319,7 @@
var fromNode = AstTestFactory.constructorDeclaration(
AstTestFactory.identifier3(className),
constructorName,
- AstTestFactory.formalParameterList(), []) as ConstructorDeclarationImpl;
+ AstTestFactory.formalParameterList(), []);
ConstructorElement element = ElementFactory.constructorElement2(
ElementFactory.classElement2(className), constructorName);
fromNode.declaredElement = element;
@@ -331,7 +332,7 @@
}
void test_visitConstructorName() {
- ConstructorName fromNode =
+ var fromNode =
AstTestFactory.constructorName(AstTestFactory.typeName4("A"), "c");
ConstructorElement staticElement = ElementFactory.constructorElement2(
ElementFactory.classElement2("A"), "c");
@@ -343,7 +344,7 @@
}
void test_visitDoubleLiteral() {
- DoubleLiteral fromNode = AstTestFactory.doubleLiteral(1.0);
+ var fromNode = AstTestFactory.doubleLiteral(1.0);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
DoubleLiteral toNode = AstTestFactory.doubleLiteral(1.0);
@@ -352,7 +353,7 @@
}
void test_visitExportDirective() {
- ExportDirective fromNode = AstTestFactory.exportDirective2("dart:uri");
+ var fromNode = AstTestFactory.exportDirective2("dart:uri");
ExportElement element = ExportElementImpl(-1);
fromNode.element = element;
ExportDirective toNode = AstTestFactory.exportDirective2("dart:uri");
@@ -365,7 +366,9 @@
false, Keyword.VAR, null, [AstTestFactory.variableDeclaration('x')],
isAbstract: false);
FieldElement element = FieldElementImpl('x', -1);
- fromNode.fields.variables[0].name.staticElement = element;
+ (fromNode.fields.variables[0] as VariableDeclarationImpl)
+ .name
+ .staticElement = element;
FieldDeclaration toNode1 = AstTestFactory.fieldDeclaration(
false, Keyword.VAR, null, [AstTestFactory.variableDeclaration('x')],
isAbstract: false);
@@ -385,7 +388,9 @@
false, Keyword.VAR, null, [AstTestFactory.variableDeclaration('x')],
isExternal: false);
FieldElement element = FieldElementImpl('x', -1);
- fromNode.fields.variables[0].name.staticElement = element;
+ (fromNode.fields.variables[0] as VariableDeclarationImpl)
+ .name
+ .staticElement = element;
FieldDeclaration toNode1 = AstTestFactory.fieldDeclaration(
false, Keyword.VAR, null, [AstTestFactory.variableDeclaration('x')],
isExternal: false);
@@ -410,7 +415,7 @@
DartType typeB = interfaceTypeStar(ElementFactory.classElement2('B'));
ForEachPartsWithDeclaration fromNode = createNode();
- (fromNode.iterable as SimpleIdentifier).staticType = typeB;
+ (fromNode.iterable as SimpleIdentifierImpl).staticType = typeB;
ForEachPartsWithDeclaration toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -418,7 +423,7 @@
}
void test_visitForEachPartsWithIdentifier() {
- ForEachPartsWithIdentifier createNode() =>
+ ForEachPartsWithIdentifierImpl createNode() =>
astFactory.forEachPartsWithIdentifier(
identifier: AstTestFactory.identifier3('a'),
inKeyword: TokenFactory.tokenFromKeyword(Keyword.IN),
@@ -427,9 +432,9 @@
DartType typeA = interfaceTypeStar(ElementFactory.classElement2('A'));
DartType typeB = interfaceTypeStar(ElementFactory.classElement2('B'));
- ForEachPartsWithIdentifier fromNode = createNode();
+ var fromNode = createNode();
fromNode.identifier.staticType = typeA;
- (fromNode.iterable as SimpleIdentifier).staticType = typeB;
+ (fromNode.iterable as SimpleIdentifierImpl).staticType = typeB;
ForEachPartsWithIdentifier toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -438,7 +443,7 @@
}
void test_visitForElement() {
- ForElement createNode() => astFactory.forElement(
+ ForElementImpl createNode() => astFactory.forElement(
forKeyword: TokenFactory.tokenFromKeyword(Keyword.FOR),
leftParenthesis: TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
forLoopParts: astFactory.forEachPartsWithIdentifier(
@@ -451,7 +456,7 @@
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
ForElement fromNode = createNode();
- (fromNode.body as SimpleIdentifier).staticType = typeC;
+ (fromNode.body as SimpleIdentifierImpl).staticType = typeC;
ForElement toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -472,8 +477,8 @@
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
ForPartsWithDeclarations fromNode = createNode();
- (fromNode.condition as SimpleIdentifier).staticType = typeB;
- (fromNode.updaters[0] as SimpleIdentifier).staticType = typeC;
+ (fromNode.condition as SimpleIdentifierImpl).staticType = typeB;
+ (fromNode.updaters[0] as SimpleIdentifierImpl).staticType = typeC;
ForPartsWithDeclarations toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -494,9 +499,9 @@
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
ForPartsWithExpression fromNode = createNode();
- (fromNode.initialization as SimpleIdentifier).staticType = typeA;
- (fromNode.condition as SimpleIdentifier).staticType = typeB;
- (fromNode.updaters[0] as SimpleIdentifier).staticType = typeC;
+ (fromNode.initialization as SimpleIdentifierImpl).staticType = typeA;
+ (fromNode.condition as SimpleIdentifierImpl).staticType = typeB;
+ (fromNode.updaters[0] as SimpleIdentifierImpl).staticType = typeC;
ForPartsWithExpression toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -522,11 +527,11 @@
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
ForStatement fromNode = createNode();
- var fromForLoopParts = fromNode.forLoopParts as ForEachPartsWithIdentifier;
+ var fromForLoopParts =
+ fromNode.forLoopParts as ForEachPartsWithIdentifierImpl;
fromForLoopParts.identifier.staticType = typeA;
- (fromForLoopParts.iterable as SimpleIdentifier).staticType = typeB;
- ((fromNode.body as ExpressionStatement).expression as SimpleIdentifier)
- .staticType = typeC;
+ fromForLoopParts.iterable.staticType = typeB;
+ (fromNode.body as ExpressionStatementImpl).expression.staticType = typeC;
ForStatement toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -543,7 +548,7 @@
void test_visitFunctionExpression() {
var fromNode = AstTestFactory.functionExpression2(
AstTestFactory.formalParameterList(),
- AstTestFactory.emptyFunctionBody()) as FunctionExpressionImpl;
+ AstTestFactory.emptyFunctionBody());
MethodElement element = ElementFactory.methodElement(
"m", interfaceTypeStar(ElementFactory.classElement2('C')));
fromNode.declaredElement = element;
@@ -558,15 +563,13 @@
}
void test_visitFunctionExpressionInvocation() {
- FunctionExpressionInvocation fromNode =
- AstTestFactory.functionExpressionInvocation(
- AstTestFactory.identifier3("f"));
+ var fromNode = AstTestFactory.functionExpressionInvocation(
+ AstTestFactory.identifier3("f"));
MethodElement staticElement = ElementFactory.methodElement(
"m", interfaceTypeStar(ElementFactory.classElement2('C')));
fromNode.staticElement = staticElement;
- FunctionExpressionInvocation toNode =
- AstTestFactory.functionExpressionInvocation(
- AstTestFactory.identifier3("f"));
+ var toNode = AstTestFactory.functionExpressionInvocation(
+ AstTestFactory.identifier3("f"));
ClassElement elementT = ElementFactory.classElement2('T');
fromNode.typeArguments = AstTestFactory.typeArgumentList(
<TypeAnnotation>[AstTestFactory.typeName(elementT)]);
@@ -579,7 +582,7 @@
}
void test_visitIfElement() {
- IfElement createNode() => astFactory.ifElement(
+ IfElementImpl createNode() => astFactory.ifElement(
ifKeyword: TokenFactory.tokenFromKeyword(Keyword.IF),
leftParenthesis: TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
condition: AstTestFactory.identifier3('a'),
@@ -591,10 +594,10 @@
DartType typeB = interfaceTypeStar(ElementFactory.classElement2('B'));
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
- IfElement fromNode = createNode();
- (fromNode.condition as SimpleIdentifier).staticType = typeA;
- (fromNode.thenElement as SimpleIdentifier).staticType = typeB;
- (fromNode.elseElement as SimpleIdentifier).staticType = typeC;
+ var fromNode = createNode();
+ (fromNode.condition as SimpleIdentifierImpl).staticType = typeA;
+ (fromNode.thenElement as SimpleIdentifierImpl).staticType = typeB;
+ (fromNode.elseElement as SimpleIdentifierImpl).staticType = typeC;
IfElement toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -604,8 +607,7 @@
}
void test_visitImportDirective() {
- ImportDirective fromNode =
- AstTestFactory.importDirective3("dart:uri", null);
+ var fromNode = AstTestFactory.importDirective3("dart:uri", null);
ImportElement element = ImportElementImpl(0);
fromNode.element = element;
ImportDirective toNode = AstTestFactory.importDirective3("dart:uri", null);
@@ -614,7 +616,7 @@
}
void test_visitIndexExpression() {
- IndexExpression fromNode = AstTestFactory.indexExpression(
+ var fromNode = AstTestFactory.indexExpression(
target: AstTestFactory.identifier3("a"),
index: AstTestFactory.integer(0),
);
@@ -633,9 +635,8 @@
}
void test_visitInstanceCreationExpression() {
- InstanceCreationExpression fromNode =
- AstTestFactory.instanceCreationExpression2(
- Keyword.NEW, AstTestFactory.typeName4("C"));
+ var fromNode = AstTestFactory.instanceCreationExpression2(
+ Keyword.NEW, AstTestFactory.typeName4("C"));
ConstructorElement staticElement = ElementFactory.constructorElement2(
ElementFactory.classElement2("C"), null);
fromNode.constructorName.staticElement = staticElement;
@@ -650,7 +651,7 @@
}
void test_visitIntegerLiteral() {
- IntegerLiteral fromNode = AstTestFactory.integer(2);
+ var fromNode = AstTestFactory.integer(2);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
IntegerLiteral toNode = AstTestFactory.integer(2);
@@ -659,7 +660,7 @@
}
void test_visitIsExpression() {
- IsExpression fromNode = AstTestFactory.isExpression(
+ var fromNode = AstTestFactory.isExpression(
AstTestFactory.identifier3("x"), false, AstTestFactory.typeName4("A"));
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -670,7 +671,7 @@
}
void test_visitLibraryIdentifier() {
- LibraryIdentifier fromNode =
+ var fromNode =
AstTestFactory.libraryIdentifier([AstTestFactory.identifier3("lib")]);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -681,7 +682,7 @@
}
void test_visitListLiteral() {
- ListLiteral createNode() => astFactory.listLiteral(
+ ListLiteralImpl createNode() => astFactory.listLiteral(
null,
AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')]),
TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET),
@@ -693,9 +694,9 @@
DartType typeB = interfaceTypeStar(ElementFactory.classElement2('B'));
DartType typeC = interfaceTypeStar(ElementFactory.classElement2('C'));
- ListLiteral fromNode = createNode();
- (fromNode.typeArguments!.arguments[0] as TypeName).type = typeA;
- (fromNode.elements[0] as SimpleIdentifier).staticType = typeB;
+ var fromNode = createNode();
+ (fromNode.typeArguments!.arguments[0] as TypeNameImpl).type = typeA;
+ (fromNode.elements[0] as SimpleIdentifierImpl).staticType = typeB;
fromNode.staticType = typeC;
ListLiteral toNode = createNode();
@@ -706,7 +707,7 @@
}
void test_visitMapLiteral() {
- SetOrMapLiteral fromNode = AstTestFactory.setOrMapLiteral(null, null);
+ var fromNode = AstTestFactory.setOrMapLiteral(null, null);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
SetOrMapLiteral toNode = AstTestFactory.setOrMapLiteral(null, null);
@@ -715,8 +716,8 @@
}
void test_visitMethodInvocation() {
- MethodInvocation fromNode = AstTestFactory.methodInvocation2("m");
- MethodInvocation toNode = AstTestFactory.methodInvocation2("m");
+ var fromNode = AstTestFactory.methodInvocation2("m");
+ var toNode = AstTestFactory.methodInvocation2("m");
ClassElement elementT = ElementFactory.classElement2('T');
fromNode.typeArguments = AstTestFactory.typeArgumentList(
<TypeAnnotation>[AstTestFactory.typeName(elementT)]);
@@ -726,7 +727,7 @@
}
void test_visitNamedExpression() {
- NamedExpression fromNode =
+ var fromNode =
AstTestFactory.namedExpression2("n", AstTestFactory.integer(0));
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -737,7 +738,7 @@
}
void test_visitNullLiteral() {
- NullLiteral fromNode = AstTestFactory.nullLiteral();
+ var fromNode = AstTestFactory.nullLiteral();
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
NullLiteral toNode = AstTestFactory.nullLiteral();
@@ -746,7 +747,7 @@
}
void test_visitParenthesizedExpression() {
- ParenthesizedExpression fromNode =
+ var fromNode =
AstTestFactory.parenthesizedExpression(AstTestFactory.integer(0));
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -757,7 +758,7 @@
}
void test_visitPartDirective() {
- PartDirective fromNode = AstTestFactory.partDirective2("part.dart");
+ var fromNode = AstTestFactory.partDirective2("part.dart");
LibraryElement element = LibraryElementImpl(
_AnalysisContextMock(),
_AnalysisSessionMock(),
@@ -772,7 +773,7 @@
}
void test_visitPartOfDirective() {
- PartOfDirective fromNode = AstTestFactory.partOfDirective(
+ var fromNode = AstTestFactory.partOfDirective(
AstTestFactory.libraryIdentifier2(["lib"]));
LibraryElement element = LibraryElementImpl(
_AnalysisContextMock(),
@@ -790,7 +791,7 @@
void test_visitPostfixExpression() {
String variableName = "x";
- PostfixExpression fromNode = AstTestFactory.postfixExpression(
+ var fromNode = AstTestFactory.postfixExpression(
AstTestFactory.identifier3(variableName), TokenType.PLUS_PLUS);
MethodElement staticElement = ElementFactory.methodElement(
"+", interfaceTypeStar(ElementFactory.classElement2('C')));
@@ -805,7 +806,7 @@
}
void test_visitPrefixedIdentifier() {
- PrefixedIdentifier fromNode = AstTestFactory.identifier5("p", "f");
+ var fromNode = AstTestFactory.identifier5("p", "f");
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
PrefixedIdentifier toNode = AstTestFactory.identifier5("p", "f");
@@ -814,7 +815,7 @@
}
void test_visitPrefixExpression() {
- PrefixExpression fromNode = AstTestFactory.prefixExpression(
+ var fromNode = AstTestFactory.prefixExpression(
TokenType.PLUS_PLUS, AstTestFactory.identifier3("x"));
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
MethodElement staticElement = ElementFactory.methodElement(
@@ -829,7 +830,7 @@
}
void test_visitPropertyAccess() {
- PropertyAccess fromNode =
+ var fromNode =
AstTestFactory.propertyAccess2(AstTestFactory.identifier3("x"), "y");
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -840,8 +841,7 @@
}
void test_visitRedirectingConstructorInvocation() {
- RedirectingConstructorInvocation fromNode =
- AstTestFactory.redirectingConstructorInvocation();
+ var fromNode = AstTestFactory.redirectingConstructorInvocation();
ConstructorElement staticElement = ElementFactory.constructorElement2(
ElementFactory.classElement2("C"), null);
fromNode.staticElement = staticElement;
@@ -852,7 +852,7 @@
}
void test_visitRethrowExpression() {
- RethrowExpression fromNode = AstTestFactory.rethrowExpression();
+ var fromNode = AstTestFactory.rethrowExpression();
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
RethrowExpression toNode = AstTestFactory.rethrowExpression();
@@ -861,7 +861,7 @@
}
void test_visitSetOrMapLiteral_map() {
- SetOrMapLiteral createNode() => astFactory.setOrMapLiteral(
+ SetOrMapLiteralImpl createNode() => astFactory.setOrMapLiteral(
typeArguments: AstTestFactory.typeArgumentList(
[AstTestFactory.typeName4('A'), AstTestFactory.typeName4('B')]),
leftBracket: TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
@@ -876,11 +876,11 @@
DartType typeD = interfaceTypeStar(ElementFactory.classElement2('D'));
SetOrMapLiteral fromNode = createNode();
- (fromNode.typeArguments!.arguments[0] as TypeName).type = typeA;
- (fromNode.typeArguments!.arguments[1] as TypeName).type = typeB;
+ (fromNode.typeArguments!.arguments[0] as TypeNameImpl).type = typeA;
+ (fromNode.typeArguments!.arguments[1] as TypeNameImpl).type = typeB;
MapLiteralEntry fromEntry = fromNode.elements[0] as MapLiteralEntry;
- (fromEntry.key as SimpleStringLiteral).staticType = typeC;
- (fromEntry.value as SimpleStringLiteral).staticType = typeD;
+ (fromEntry.key as SimpleStringLiteralImpl).staticType = typeC;
+ (fromEntry.value as SimpleStringLiteralImpl).staticType = typeD;
SetOrMapLiteral toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -892,7 +892,7 @@
}
void test_visitSetOrMapLiteral_set() {
- SetOrMapLiteral createNode() => astFactory.setOrMapLiteral(
+ SetOrMapLiteralImpl createNode() => astFactory.setOrMapLiteral(
typeArguments:
AstTestFactory.typeArgumentList([AstTestFactory.typeName4('A')]),
leftBracket: TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET),
@@ -905,8 +905,8 @@
DartType typeB = interfaceTypeStar(ElementFactory.classElement2('B'));
SetOrMapLiteral fromNode = createNode();
- (fromNode.typeArguments!.arguments[0] as TypeName).type = typeA;
- (fromNode.elements[0] as SimpleIdentifier).staticType = typeB;
+ (fromNode.typeArguments!.arguments[0] as TypeNameImpl).type = typeA;
+ (fromNode.elements[0] as SimpleIdentifierImpl).staticType = typeB;
SetOrMapLiteral toNode = createNode();
ResolutionCopier.copyResolutionData(fromNode, toNode);
@@ -915,7 +915,7 @@
}
void test_visitSimpleIdentifier() {
- SimpleIdentifier fromNode = AstTestFactory.identifier3("x");
+ var fromNode = AstTestFactory.identifier3("x");
MethodElement staticElement = ElementFactory.methodElement(
"m", interfaceTypeStar(ElementFactory.classElement2('C')));
fromNode.staticElement = staticElement;
@@ -928,7 +928,7 @@
}
void test_visitSimpleStringLiteral() {
- SimpleStringLiteral fromNode = AstTestFactory.string2("abc");
+ var fromNode = AstTestFactory.string2("abc");
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
SimpleStringLiteral toNode = AstTestFactory.string2("abc");
@@ -950,7 +950,7 @@
DartType typeA = interfaceTypeStar(ElementFactory.classElement2('A'));
SpreadElement fromNode = createNode();
- ((fromNode.expression as ListLiteral).elements[0] as SimpleIdentifier)
+ ((fromNode.expression as ListLiteral).elements[0] as SimpleIdentifierImpl)
.staticType = typeA;
SpreadElement toNode = createNode();
@@ -962,7 +962,7 @@
}
void test_visitStringInterpolation() {
- StringInterpolation fromNode =
+ var fromNode =
AstTestFactory.string([AstTestFactory.interpolationString("a", "'a'")]);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
@@ -973,8 +973,7 @@
}
void test_visitSuperConstructorInvocation() {
- SuperConstructorInvocation fromNode =
- AstTestFactory.superConstructorInvocation();
+ var fromNode = AstTestFactory.superConstructorInvocation();
ConstructorElement staticElement = ElementFactory.constructorElement2(
ElementFactory.classElement2("C"), null);
fromNode.staticElement = staticElement;
@@ -985,7 +984,7 @@
}
void test_visitSuperExpression() {
- SuperExpression fromNode = AstTestFactory.superExpression();
+ var fromNode = AstTestFactory.superExpression();
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
SuperExpression toNode = AstTestFactory.superExpression();
@@ -994,7 +993,7 @@
}
void test_visitSymbolLiteral() {
- SymbolLiteral fromNode = AstTestFactory.symbolLiteral(["s"]);
+ var fromNode = AstTestFactory.symbolLiteral(["s"]);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
SymbolLiteral toNode = AstTestFactory.symbolLiteral(["s"]);
@@ -1003,7 +1002,7 @@
}
void test_visitThisExpression() {
- ThisExpression fromNode = AstTestFactory.thisExpression();
+ var fromNode = AstTestFactory.thisExpression();
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
ThisExpression toNode = AstTestFactory.thisExpression();
@@ -1012,7 +1011,7 @@
}
void test_visitThrowExpression() {
- ThrowExpression fromNode = AstTestFactory.throwExpression2(
+ var fromNode = AstTestFactory.throwExpression2(
AstTestFactory.integer(0),
);
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
@@ -1025,7 +1024,7 @@
}
void test_visitTypeName() {
- TypeName fromNode = AstTestFactory.typeName4("C");
+ var fromNode = AstTestFactory.typeName4("C");
DartType type = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.type = type;
TypeName toNode = AstTestFactory.typeName4("C");
@@ -1034,7 +1033,7 @@
}
void _copyAndVerifyInvocation(
- InvocationExpression fromNode, InvocationExpression toNode) {
+ InvocationExpressionImpl fromNode, InvocationExpression toNode) {
DartType staticType = interfaceTypeStar(ElementFactory.classElement2('C'));
fromNode.staticType = staticType;
diff --git a/pkg/analyzer/test/src/dart/constant/utilities_test.dart b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
index d546744..92b5d6e 100644
--- a/pkg/analyzer/test/src/dart/constant/utilities_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/utilities_test.dart
@@ -3,11 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/ast/ast.dart';
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type_provider.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/generated/constant.dart';
@@ -49,9 +48,9 @@
.definingCompilationUnit = compilationUnitElement;
ElementAnnotationImpl elementAnnotation =
ElementAnnotationImpl(compilationUnitElement);
- _node = elementAnnotation.annotationAst =
- AstTestFactory.annotation(AstTestFactory.identifier3('x'))
- ..elementAnnotation = elementAnnotation;
+ var annotation = AstTestFactory.annotation(AstTestFactory.identifier3('x'));
+ _node = elementAnnotation.annotationAst = annotation
+ ..elementAnnotation = elementAnnotation;
expect(_findAnnotations(), contains(_node));
}
@@ -73,8 +72,9 @@
.definingCompilationUnit = compilationUnitElement;
ElementAnnotationImpl elementAnnotation =
ElementAnnotationImpl(compilationUnitElement);
- _node = elementAnnotation.annotationAst = AstTestFactory.annotation2(
- AstTestFactory.identifier3('A'), null, AstTestFactory.argumentList())
+ var annotation = AstTestFactory.annotation2(
+ AstTestFactory.identifier3('A'), null, AstTestFactory.argumentList());
+ _node = elementAnnotation.annotationAst = annotation
..elementAnnotation = elementAnnotation;
expect(_findAnnotations(), contains(_node));
}
@@ -190,7 +190,7 @@
null,
AstTestFactory.formalParameterList(),
[],
- AstTestFactory.blockFunctionBody2()) as ConstructorDeclarationImpl;
+ AstTestFactory.blockFunctionBody2());
ClassElement classElement = ElementFactory.classElement2(name);
ConstructorElement element =
ElementFactory.constructorElement(classElement, name, isConst);
@@ -204,7 +204,7 @@
{bool isInitialized = true,
bool isStatic = false,
bool hasConstConstructor = false}) {
- VariableDeclaration variableDeclaration = isInitialized
+ var variableDeclaration = isInitialized
? AstTestFactory.variableDeclaration2(
fieldName, AstTestFactory.integer(0))
: AstTestFactory.variableDeclaration(fieldName);
@@ -217,7 +217,7 @@
variableDeclaration.name.staticElement = fieldElement;
FieldDeclaration fieldDeclaration = AstTestFactory.fieldDeclaration2(
isStatic, keyword, <VariableDeclaration>[variableDeclaration]);
- ClassDeclaration classDeclaration = AstTestFactory.classDeclaration(
+ var classDeclaration = AstTestFactory.classDeclaration(
null, className, null, null, null, null);
classDeclaration.members.add(fieldDeclaration);
_node = classDeclaration;
@@ -232,7 +232,7 @@
null,
AstTestFactory.formalParameterList(),
[],
- AstTestFactory.blockFunctionBody2()) as ConstructorDeclarationImpl;
+ AstTestFactory.blockFunctionBody2());
classDeclaration.members.add(constructorDeclaration);
ConstructorElement constructorElement =
ElementFactory.constructorElement(classElement, '', true);
@@ -247,10 +247,10 @@
VariableElement _setupVariableDeclaration(
String name, bool isConst, bool isInitialized,
{isFinal = false}) {
- VariableDeclaration variableDeclaration = isInitialized
+ var variableDeclaration = isInitialized
? AstTestFactory.variableDeclaration2(name, AstTestFactory.integer(0))
: AstTestFactory.variableDeclaration(name);
- SimpleIdentifier identifier = variableDeclaration.name;
+ var identifier = variableDeclaration.name;
VariableElement element = ElementFactory.localVariableElement(identifier);
identifier.staticElement = element;
var keyword = isConst
@@ -303,14 +303,16 @@
SuperConstructorInvocation _makeTailSuperConstructorInvocation(
String name, bool isConst) {
List<ConstructorInitializer> initializers = <ConstructorInitializer>[];
- ConstructorDeclaration constructorDeclaration =
- AstTestFactory.constructorDeclaration(AstTestFactory.identifier3(name),
- null, AstTestFactory.formalParameterList(), initializers);
+ var constructorDeclaration = AstTestFactory.constructorDeclaration(
+ AstTestFactory.identifier3(name),
+ null,
+ AstTestFactory.formalParameterList(),
+ initializers);
if (isConst) {
constructorDeclaration.constKeyword = KeywordToken(Keyword.CONST, 0);
}
ClassElementImpl classElement = ElementFactory.classElement2(name);
- SuperConstructorInvocation superConstructorInvocation =
+ var superConstructorInvocation =
AstTestFactory.superConstructorInvocation();
ConstructorElementImpl constructorElement =
ElementFactory.constructorElement(classElement, name, isConst);
@@ -328,7 +330,7 @@
variableElement.isConst = isConst;
AstTestFactory.variableDeclarationList2(
isConst ? Keyword.CONST : Keyword.VAR, [variableDeclaration]);
- SimpleIdentifier identifier = AstTestFactory.identifier3(name);
+ var identifier = AstTestFactory.identifier3(name);
identifier.staticElement = variableElement;
return identifier;
}
diff --git a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
index 00ab99f..b59d6fd 100644
--- a/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
+++ b/pkg/analyzer/test/src/dart/element/generic_inferrer_test.dart
@@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
import 'package:analyzer/src/dart/ast/token.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/resolver/variance.dart';
diff --git a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
index 590f27e..950c741 100644
--- a/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/code_order_test.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -198,13 +198,13 @@
''', adjustValidUnitBeforeComparison: _moveFirstDirectiveToEnd);
}
- CompilationUnit _moveFirstDirectiveToEnd(CompilationUnit unit) {
+ CompilationUnitImpl _moveFirstDirectiveToEnd(CompilationUnitImpl unit) {
unit.directives.add(unit.directives.removeAt(0));
unit.beginToken = unit.directives[0].beginToken;
return unit;
}
- CompilationUnit _updateBeginToken(CompilationUnit unit) {
+ CompilationUnitImpl _updateBeginToken(CompilationUnitImpl unit) {
unit.beginToken = unit.declarations[0].beginToken;
return unit;
}
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart
index cc830fb..c9abdee 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/constructor_declaration_test.dart
@@ -4,6 +4,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'partial_code_support.dart';
@@ -113,9 +114,9 @@
tail: '}');
}
- CompilationUnit setSeparator(CompilationUnit unit) {
+ CompilationUnitImpl setSeparator(CompilationUnitImpl unit) {
var declaration = unit.declarations[0] as ClassDeclaration;
- var member = declaration.members[0] as ConstructorDeclaration;
+ var member = declaration.members[0] as ConstructorDeclarationImpl;
member.separator =
Token(TokenType.COLON, member.parameters.endToken.charOffset + 1);
return unit;
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
index 8247907..0622739 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/partial_code_support.dart
@@ -3,16 +3,16 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/analysis/features.dart';
-import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:test/test.dart';
import '../../../../generated/test_support.dart';
import '../recovery_test_support.dart';
-typedef AdjustValidUnitBeforeComparison = CompilationUnit Function(
- CompilationUnit unit);
+typedef AdjustValidUnitBeforeComparison = CompilationUnitImpl Function(
+ CompilationUnitImpl unit);
/// A base class that adds support for tests that test how well the parser
/// recovers when the user has entered an incomplete (but otherwise correct)
diff --git a/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart b/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
index 61c070a..cad0dfb 100644
--- a/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/recovery_test_support.dart
@@ -6,6 +6,7 @@
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:test/test.dart';
@@ -17,11 +18,11 @@
abstract class AbstractRecoveryTest extends FastaParserTestCase {
void testRecovery(
String invalidCode, List<ErrorCode>? errorCodes, String validCode,
- {CompilationUnit Function(CompilationUnit unit)?
+ {CompilationUnitImpl Function(CompilationUnitImpl unit)?
adjustValidUnitBeforeComparison,
List<ErrorCode>? expectedErrorsInValidCode,
FeatureSet? featureSet}) {
- CompilationUnit validUnit;
+ CompilationUnitImpl validUnit;
// Assert that the valid code is indeed valid.
try {
@@ -39,7 +40,7 @@
// Compare the structures before asserting valid errors.
GatheringErrorListener listener = GatheringErrorListener(checkRanges: true);
- CompilationUnit invalidUnit =
+ var invalidUnit =
parseCompilationUnit2(invalidCode, listener, featureSet: featureSet);
validateTokenStream(invalidUnit.beginToken);
if (adjustValidUnitBeforeComparison != null) {
diff --git a/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart b/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
index d650578..f7e2b7d 100644
--- a/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
+++ b/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/element/inheritance_manager3.dart';
import 'package:analyzer/src/dart/element/type_system.dart';
import 'package:analyzer/src/lint/linter.dart';
@@ -59,7 +60,8 @@
late final LinterContextImpl context;
void assertCanBeConstConstructor(String search, bool expectedResult) {
- var constructor = findNode.constructor(search);
+ var constructor =
+ findNode.constructor(search) as ConstructorDeclarationImpl;
expect(context.canBeConstConstructor(constructor), expectedResult);
}
diff --git a/pkg/analyzer/test/src/summary/test_strategies.dart b/pkg/analyzer/test/src/summary/test_strategies.dart
index 5cd4d74..5632a0a 100644
--- a/pkg/analyzer/test/src/summary/test_strategies.dart
+++ b/pkg/analyzer/test/src/summary/test_strategies.dart
@@ -8,7 +8,6 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/dart/analysis/experiments.dart';
-import 'package:analyzer/src/dart/ast/ast.dart';
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/parser.dart';
@@ -34,11 +33,10 @@
AnalysisErrorListener.NULL_LISTENER,
featureSet: scanner.featureSet,
);
- CompilationUnit unit = parser.parseCompilationUnit(token);
+ var unit = parser.parseCompilationUnit(token);
unit.lineInfo = LineInfo(scanner.lineStarts);
- var unitImpl = unit as CompilationUnitImpl;
- unitImpl.languageVersion = LibraryLanguageVersion(
+ unit.languageVersion = LibraryLanguageVersion(
package: ExperimentStatus.currentVersion,
override: null,
);
diff --git a/pkg/nnbd_migration/lib/src/fix_builder.dart b/pkg/nnbd_migration/lib/src/fix_builder.dart
index 0cb9d26..0f2cd7f 100644
--- a/pkg/nnbd_migration/lib/src/fix_builder.dart
+++ b/pkg/nnbd_migration/lib/src/fix_builder.dart
@@ -890,7 +890,7 @@
writeType = writeTypeToSet;
// TODO(scheglov) Remove this after the analyzer breaking change that
// will top setting types for LHS.
- target.staticType = writeTypeToSet;
+ (target as ExpressionImpl).staticType = writeTypeToSet;
var fixBuilder = hooks._fixBuilder;
if (combinerType == TokenType.EQ) {
rhsContextType = writeTypeToSet;
@@ -1167,7 +1167,8 @@
_makeTypeNameNullable(node, decoratedType);
}
}
- node.type = _fixBuilder._variables.toFinalType(decoratedType);
+ (node as TypeNameImpl).type =
+ _fixBuilder._variables.toFinalType(decoratedType);
super.visitTypeName(node);
}
diff --git a/tools/VERSION b/tools/VERSION
index 025d120..96276ba 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 13
PATCH 0
-PRERELEASE 115
+PRERELEASE 116
PRERELEASE_PATCH 0
\ No newline at end of file