Index: pkg/analyzer/lib/src/generated/ast.dart |
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart |
index 40eb1dbe2dfae6002f88f8757b41c55d068a8771..ee68939488232421d6ee74b679d7bf94c3bf498a 100644 |
--- a/pkg/analyzer/lib/src/generated/ast.dart |
+++ b/pkg/analyzer/lib/src/generated/ast.dart |
@@ -594,8 +594,10 @@ class AsExpression extends Expression { |
Token get beginToken => _expression.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_expression)..add(asOperator)..add(_type); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_expression) |
+ ..add(asOperator) |
+ ..add(_type); |
@override |
Token get endToken => _type.endToken; |
@@ -1251,13 +1253,13 @@ class AstCloner implements AstVisitor<AstNode> { |
ForEachStatement visitForEachStatement(ForEachStatement node) { |
DeclaredIdentifier loopVariable = node.loopVariable; |
if (loopVariable == null) { |
- return new ForEachStatement.con2(cloneToken(node.awaitKeyword), |
+ return new ForEachStatement.withReference(cloneToken(node.awaitKeyword), |
cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), |
cloneNode(node.identifier), cloneToken(node.inKeyword), |
cloneNode(node.iterable), cloneToken(node.rightParenthesis), |
cloneNode(node.body)); |
} |
- return new ForEachStatement.con1(cloneToken(node.awaitKeyword), |
+ return new ForEachStatement.withDeclaration(cloneToken(node.awaitKeyword), |
cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), |
cloneNode(loopVariable), cloneToken(node.inKeyword), |
cloneNode(node.iterable), cloneToken(node.rightParenthesis), |
@@ -3190,8 +3192,9 @@ class AwaitExpression extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(awaitKeyword)..add(_expression); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(awaitKeyword) |
+ ..add(_expression); |
@override |
Token get endToken => _expression.endToken; |
@@ -3285,8 +3288,10 @@ class BinaryExpression extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_leftOperand)..add(operator)..add(_rightOperand); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_leftOperand) |
+ ..add(operator) |
+ ..add(_rightOperand); |
@override |
Token get endToken => _rightOperand.endToken; |
@@ -3491,8 +3496,10 @@ class BlockFunctionBody extends FunctionBody { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(keyword)..add(star)..add(_block); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(keyword) |
+ ..add(star) |
+ ..add(_block); |
@override |
Token get endToken => _block.endToken; |
@@ -3658,8 +3665,10 @@ class BreakStatement extends Statement { |
Token get beginToken => breakKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(breakKeyword)..add(_label)..add(semicolon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(breakKeyword) |
+ ..add(_label) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |
@@ -4566,8 +4575,9 @@ class CommentReference extends AstNode { |
Token get beginToken => _identifier.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(newKeyword)..add(_identifier); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(newKeyword) |
+ ..add(_identifier); |
@override |
Token get endToken => _identifier.endToken; |
@@ -4708,7 +4718,9 @@ class CompilationUnit extends AstNode { |
Iterable get childEntities { |
ChildEntities result = new ChildEntities()..add(_scriptTag); |
if (_directivesAreBeforeDeclarations) { |
- result..addAll(_directives)..addAll(_declarations); |
+ result |
+ ..addAll(_directives) |
+ ..addAll(_declarations); |
} else { |
result.addAll(sortedDirectivesAndDeclarations); |
} |
@@ -5671,8 +5683,10 @@ class ConstructorName extends AstNode { |
Token get beginToken => _type.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_type)..add(period)..add(_name); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_type) |
+ ..add(period) |
+ ..add(_name); |
@override |
Token get endToken { |
@@ -5762,8 +5776,10 @@ class ContinueStatement extends Statement { |
Token get beginToken => continueKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(continueKeyword)..add(_label)..add(semicolon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(continueKeyword) |
+ ..add(_label) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |
@@ -5864,8 +5880,10 @@ class DeclaredIdentifier extends Declaration { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(keyword)..add(_type)..add(_identifier); |
+ Iterable get childEntities => super._childEntities |
+ ..add(keyword) |
+ ..add(_type) |
+ ..add(_identifier); |
@override |
LocalVariableElement get element { |
@@ -5986,8 +6004,10 @@ class DefaultFormalParameter extends FormalParameter { |
Token get beginToken => _parameter.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_parameter)..add(separator)..add(_defaultValue); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_parameter) |
+ ..add(separator) |
+ ..add(_defaultValue); |
/** |
* Return the expression computing the default value for the parameter, or |
@@ -6940,8 +6960,9 @@ class ExpressionStatement extends Statement { |
Token get beginToken => _expression.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_expression)..add(semicolon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_expression) |
+ ..add(semicolon); |
@override |
Token get endToken { |
@@ -7003,8 +7024,9 @@ class ExtendsClause extends AstNode { |
Token get beginToken => extendsKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(extendsKeyword)..add(_superclass); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(extendsKeyword) |
+ ..add(_superclass); |
@override |
Token get endToken => _superclass.endToken; |
@@ -7080,8 +7102,10 @@ class FieldDeclaration extends ClassMember { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(staticKeyword)..add(_fieldList)..add(semicolon); |
+ Iterable get childEntities => super._childEntities |
+ ..add(staticKeyword) |
+ ..add(_fieldList) |
+ ..add(semicolon); |
@override |
Element get element => null; |
@@ -7326,6 +7350,7 @@ class ForEachStatement extends Statement { |
* Initialize a newly created for-each statement. The [awaitKeyword] can be |
* `null` if this is not an asynchronous for loop. |
*/ |
+ @deprecated // Use new ForEachStatement.withDeclaration(...) |
ForEachStatement.con1(this.awaitKeyword, this.forKeyword, |
this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, |
Expression iterator, this.rightParenthesis, Statement body) { |
@@ -7338,6 +7363,7 @@ class ForEachStatement extends Statement { |
* Initialize a newly created for-each statement. The [awaitKeyword] can be |
* `null` if this is not an asynchronous for loop. |
*/ |
+ @deprecated // Use new ForEachStatement.withReference(...) |
ForEachStatement.con2(this.awaitKeyword, this.forKeyword, |
this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, |
Expression iterator, this.rightParenthesis, Statement body) { |
@@ -7346,6 +7372,32 @@ class ForEachStatement extends Statement { |
_body = _becomeParentOf(body); |
} |
+ /** |
+ * Initialize a newly created for-each statement whose loop control variable |
+ * is declared internally (in the for-loop part). The [awaitKeyword] can be |
+ * `null` if this is not an asynchronous for loop. |
+ */ |
+ ForEachStatement.withDeclaration(this.awaitKeyword, this.forKeyword, |
+ this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, |
+ Expression iterator, this.rightParenthesis, Statement body) { |
+ _loopVariable = _becomeParentOf(loopVariable); |
+ _iterable = _becomeParentOf(iterator); |
+ _body = _becomeParentOf(body); |
+ } |
+ |
+ /** |
+ * Initialize a newly created for-each statement whose loop control variable |
+ * is declared outside the for loop. The [awaitKeyword] can be `null` if this |
+ * is not an asynchronous for loop. |
+ */ |
+ ForEachStatement.withReference(this.awaitKeyword, this.forKeyword, |
+ this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, |
+ Expression iterator, this.rightParenthesis, Statement body) { |
+ _identifier = _becomeParentOf(identifier); |
+ _iterable = _becomeParentOf(iterator); |
+ _body = _becomeParentOf(body); |
+ } |
+ |
@override |
Token get beginToken => forKeyword; |
@@ -7557,7 +7609,9 @@ class FormalParameterList extends AstNode { |
} |
result.add(parameter); |
} |
- return result..add(rightDelimiter)..add(rightParenthesis); |
+ return result |
+ ..add(rightDelimiter) |
+ ..add(rightParenthesis); |
} |
@override |
@@ -8034,8 +8088,9 @@ class FunctionExpression extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_parameters)..add(_body); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_parameters) |
+ ..add(_body); |
@override |
Token get endToken { |
@@ -8148,8 +8203,9 @@ class FunctionExpressionInvocation extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_function)..add(_argumentList); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_function) |
+ ..add(_argumentList); |
@override |
Token get endToken => _argumentList.endToken; |
@@ -8332,8 +8388,10 @@ class FunctionTypedFormalParameter extends NormalFormalParameter { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(_returnType)..add(identifier)..add(parameters); |
+ Iterable get childEntities => super._childEntities |
+ ..add(_returnType) |
+ ..add(identifier) |
+ ..add(parameters); |
@override |
Token get endToken => _parameters.endToken; |
@@ -9629,13 +9687,13 @@ class IncrementalAstCloner implements AstVisitor<AstNode> { |
ForEachStatement visitForEachStatement(ForEachStatement node) { |
DeclaredIdentifier loopVariable = node.loopVariable; |
if (loopVariable == null) { |
- return new ForEachStatement.con2(_mapToken(node.awaitKeyword), |
+ return new ForEachStatement.withReference(_mapToken(node.awaitKeyword), |
_mapToken(node.forKeyword), _mapToken(node.leftParenthesis), |
_cloneNode(node.identifier), _mapToken(node.inKeyword), |
_cloneNode(node.iterable), _mapToken(node.rightParenthesis), |
_cloneNode(node.body)); |
} |
- return new ForEachStatement.con1(_mapToken(node.awaitKeyword), |
+ return new ForEachStatement.withDeclaration(_mapToken(node.awaitKeyword), |
_mapToken(node.forKeyword), _mapToken(node.leftParenthesis), |
_cloneNode(loopVariable), _mapToken(node.inKeyword), |
_cloneNode(node.iterable), _mapToken(node.rightParenthesis), |
@@ -10887,7 +10945,9 @@ class Label extends AstNode { |
Token get beginToken => _label.beginToken; |
@override |
- Iterable get childEntities => new ChildEntities()..add(_label)..add(colon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_label) |
+ ..add(colon); |
@override |
Token get endToken => colon; |
@@ -11019,8 +11079,10 @@ class LibraryDirective extends Directive { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(libraryKeyword)..add(_name)..add(semicolon); |
+ Iterable get childEntities => super._childEntities |
+ ..add(libraryKeyword) |
+ ..add(_name) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |
@@ -11336,8 +11398,10 @@ class MapLiteralEntry extends AstNode { |
Token get beginToken => _key.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_key)..add(separator)..add(_value); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_key) |
+ ..add(separator) |
+ ..add(_value); |
@override |
Token get endToken => _value.endToken; |
@@ -11699,10 +11763,8 @@ class MethodInvocation extends Expression { |
* if there is no target. In an ordinary method invocation this will be a |
* period ('.'). In a cascade section this will be the cascade operator |
* ('..'). |
- * |
- * Deprecated: use [operator] instead. |
*/ |
- @deprecated |
+ @deprecated // Use this.operator |
Token get period => operator; |
/** |
@@ -11710,10 +11772,8 @@ class MethodInvocation extends Expression { |
* if there is no target. In an ordinary method invocation this will be a |
* period ('.'). In a cascade section this will be the cascade operator |
* ('..'). |
- * |
- * Deprecated: use [operator] instead. |
*/ |
- @deprecated |
+ @deprecated // Use this.operator |
void set period(Token value) { |
operator = value; |
} |
@@ -11833,8 +11893,9 @@ class NamedExpression extends Expression { |
Token get beginToken => _name.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_name)..add(_expression); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_name) |
+ ..add(_expression); |
/** |
* Return the element representing the parameter being named by this |
@@ -11968,8 +12029,9 @@ class NativeClause extends AstNode { |
Token get beginToken => nativeKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(nativeKeyword)..add(_name); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(nativeKeyword) |
+ ..add(_name); |
@override |
Token get endToken => _name.endToken; |
@@ -12249,16 +12311,27 @@ class NodeLocator extends UnifyingAstVisitor<Object> { |
/** |
* Initialize a newly created locator to locate an [AstNode] by locating the |
+ * node within an AST structure that corresponds to the given range of |
+ * characters (between the [startOffset] and [endOffset] in the source. |
+ */ |
+ NodeLocator(int startOffset, [int endOffset]) |
+ : this._startOffset = startOffset, |
+ this._endOffset = endOffset == null ? startOffset : endOffset; |
+ |
+ /** |
+ * Initialize a newly created locator to locate an [AstNode] by locating the |
* node within an AST structure that corresponds to the given [offset] in the |
* source. |
*/ |
- NodeLocator.con1(int offset) : this.con2(offset, offset); |
+ @deprecated // Use new NodeLocator(offset) |
+ NodeLocator.con1(int offset) : this(offset); |
/** |
* Initialize a newly created locator to locate an [AstNode] by locating the |
* node within an AST structure that corresponds to the given range of |
* characters (between the [startOffset] and [endOffset] in the source. |
*/ |
+ @deprecated // Use new NodeLocator(startOffset, endOffset) |
NodeLocator.con2(this._startOffset, this._endOffset); |
/** |
@@ -13759,8 +13832,10 @@ class PartDirective extends UriBasedDirective { |
: super(comment, metadata, partUri); |
@override |
- Iterable get childEntities => |
- super._childEntities..add(partKeyword)..add(_uri)..add(semicolon); |
+ Iterable get childEntities => super._childEntities |
+ ..add(partKeyword) |
+ ..add(_uri) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |
@@ -13956,8 +14031,9 @@ class PostfixExpression extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_operand)..add(operator); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_operand) |
+ ..add(operator); |
@override |
Token get endToken => operator; |
@@ -14087,8 +14163,10 @@ class PrefixedIdentifier extends Identifier { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_prefix)..add(period)..add(_identifier); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_prefix) |
+ ..add(period) |
+ ..add(_identifier); |
@override |
Token get endToken => _identifier.endToken; |
@@ -14229,8 +14307,9 @@ class PrefixExpression extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(operator)..add(_operand); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(operator) |
+ ..add(_operand); |
@override |
Token get endToken => _operand.endToken; |
@@ -14360,8 +14439,10 @@ class PropertyAccess extends Expression { |
} |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_target)..add(operator)..add(_propertyName); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_target) |
+ ..add(operator) |
+ ..add(_propertyName); |
@override |
Token get endToken => _propertyName.endToken; |
@@ -15287,8 +15368,10 @@ class ReturnStatement extends Statement { |
Token get beginToken => returnKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(returnKeyword)..add(_expression)..add(semicolon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(returnKeyword) |
+ ..add(_expression) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |
@@ -15972,8 +16055,10 @@ class SimpleFormalParameter extends NormalFormalParameter { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(keyword)..add(_type)..add(identifier); |
+ Iterable get childEntities => super._childEntities |
+ ..add(keyword) |
+ ..add(_type) |
+ ..add(identifier); |
@override |
Token get endToken => identifier.endToken; |
@@ -17251,8 +17336,9 @@ class ThrowExpression extends Expression { |
Token get beginToken => throwKeyword; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(throwKeyword)..add(_expression); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(throwKeyword) |
+ ..add(_expression); |
@override |
Token get endToken { |
@@ -17331,8 +17417,9 @@ class TopLevelVariableDeclaration extends CompilationUnitMember { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(_variableList)..add(semicolon); |
+ Iterable get childEntities => super._childEntities |
+ ..add(_variableList) |
+ ..add(semicolon); |
@override |
Element get element => null; |
@@ -18744,8 +18831,9 @@ abstract class TypedLiteral extends Literal { |
_typeArguments = _becomeParentOf(typeArguments); |
} |
- ChildEntities get _childEntities => |
- new ChildEntities()..add(constKeyword)..add(_typeArguments); |
+ ChildEntities get _childEntities => new ChildEntities() |
+ ..add(constKeyword) |
+ ..add(_typeArguments); |
@override |
void visitChildren(AstVisitor visitor) { |
@@ -18789,8 +18877,9 @@ class TypeName extends AstNode { |
Token get beginToken => _name.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_name)..add(_typeArguments); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_name) |
+ ..add(_typeArguments); |
@override |
Token get endToken { |
@@ -18905,8 +18994,10 @@ class TypeParameter extends Declaration { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(_name)..add(extendsKeyword)..add(_bound); |
+ Iterable get childEntities => super._childEntities |
+ ..add(_name) |
+ ..add(extendsKeyword) |
+ ..add(_bound); |
@override |
TypeParameterElement get element => |
@@ -19526,8 +19617,10 @@ class VariableDeclaration extends Declaration { |
} |
@override |
- Iterable get childEntities => |
- super._childEntities..add(_name)..add(equals)..add(_initializer); |
+ Iterable get childEntities => super._childEntities |
+ ..add(_name) |
+ ..add(equals) |
+ ..add(_initializer); |
/** |
* This overridden implementation of getDocumentationComment() looks in the |
@@ -19757,8 +19850,9 @@ class VariableDeclarationStatement extends Statement { |
Token get beginToken => _variableList.beginToken; |
@override |
- Iterable get childEntities => |
- new ChildEntities()..add(_variableList)..add(semicolon); |
+ Iterable get childEntities => new ChildEntities() |
+ ..add(_variableList) |
+ ..add(semicolon); |
@override |
Token get endToken => semicolon; |