| 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 ec3b73c80dd38e56fd893dbac5710c699895a4c1..999fd4c9ecf7d2b611a70515b8abde56618a1b81 100644
|
| --- a/pkg/analyzer/lib/src/generated/ast.dart
|
| +++ b/pkg/analyzer/lib/src/generated/ast.dart
|
| @@ -8,16 +8,17 @@
|
| library engine.ast;
|
|
|
| import 'dart:collection';
|
| +
|
| +import 'constant.dart';
|
| +import 'element.dart';
|
| +import 'engine.dart' show AnalysisEngine;
|
| import 'java_core.dart';
|
| import 'java_engine.dart';
|
| -import 'source.dart' show LineInfo, Source;
|
| +import 'parser.dart';
|
| import 'scanner.dart';
|
| -import 'engine.dart' show AnalysisEngine;
|
| -import 'utilities_dart.dart';
|
| +import 'source.dart' show LineInfo, Source;
|
| import 'utilities_collection.dart' show TokenMap;
|
| -import 'element.dart';
|
| -import 'constant.dart';
|
| -import 'parser.dart';
|
| +import 'utilities_dart.dart';
|
|
|
| /**
|
| * Instances of the class `AdjacentStrings` represents two or more string literals that are
|
| @@ -47,9 +48,6 @@ class AdjacentStrings extends StringLiteral {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this);
|
| -
|
| - @override
|
| Token get beginToken => _strings.beginToken;
|
|
|
| @override
|
| @@ -63,9 +61,7 @@ class AdjacentStrings extends StringLiteral {
|
| NodeList<StringLiteral> get strings => _strings;
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - _strings.accept(visitor);
|
| - }
|
| + accept(AstVisitor visitor) => visitor.visitAdjacentStrings(this);
|
|
|
| @override
|
| void appendStringValue(StringBuffer buffer) {
|
| @@ -73,6 +69,11 @@ class AdjacentStrings extends StringLiteral {
|
| stringLiteral.appendStringValue(buffer);
|
| }
|
| }
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + _strings.accept(visitor);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -129,13 +130,6 @@ abstract class AnnotatedNode extends AstNode {
|
| Comment get documentationComment => _comment;
|
|
|
| /**
|
| - * Return the annotations associated with this node.
|
| - *
|
| - * @return the annotations associated with this node
|
| - */
|
| - NodeList<Annotation> get metadata => _metadata;
|
| -
|
| - /**
|
| * Set the documentation comment associated with this node to the given comment.
|
| *
|
| * @param comment the documentation comment to be associated with this node
|
| @@ -145,6 +139,20 @@ abstract class AnnotatedNode extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the first token following the comment and metadata.
|
| + *
|
| + * @return the first token following the comment and metadata
|
| + */
|
| + Token get firstTokenAfterCommentAndMetadata;
|
| +
|
| + /**
|
| + * Return the annotations associated with this node.
|
| + *
|
| + * @return the annotations associated with this node
|
| + */
|
| + NodeList<Annotation> get metadata => _metadata;
|
| +
|
| + /**
|
| * Set the metadata associated with this node to the given metadata.
|
| *
|
| * @param metadata the metadata to be associated with this node
|
| @@ -154,6 +162,20 @@ abstract class AnnotatedNode extends AstNode {
|
| _metadata.addAll(metadata);
|
| }
|
|
|
| + /**
|
| + * Return an array containing the comment and annotations associated with this node, sorted in
|
| + * lexical order.
|
| + *
|
| + * @return the comment and annotations associated with this node in the order in which they
|
| + * appeared in the original source
|
| + */
|
| + List<AstNode> get sortedCommentAndAnnotations {
|
| + return <AstNode>[]
|
| + ..add(_comment)
|
| + ..addAll(_metadata)
|
| + ..sort(AstNode.LEXICAL_ORDER);
|
| + }
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| if (_commentIsBeforeAnnotations()) {
|
| @@ -167,13 +189,6 @@ abstract class AnnotatedNode extends AstNode {
|
| }
|
|
|
| /**
|
| - * Return the first token following the comment and metadata.
|
| - *
|
| - * @return the first token following the comment and metadata
|
| - */
|
| - Token get firstTokenAfterCommentAndMetadata;
|
| -
|
| - /**
|
| * Return `true` if the comment is lexically before any annotations.
|
| *
|
| * @return `true` if the comment is lexically before any annotations
|
| @@ -185,20 +200,6 @@ abstract class AnnotatedNode extends AstNode {
|
| Annotation firstAnnotation = _metadata[0];
|
| return _comment.offset < firstAnnotation.offset;
|
| }
|
| -
|
| - /**
|
| - * Return an array containing the comment and annotations associated with this node, sorted in
|
| - * lexical order.
|
| - *
|
| - * @return the comment and annotations associated with this node in the order in which they
|
| - * appeared in the original source
|
| - */
|
| - List<AstNode> get sortedCommentAndAnnotations {
|
| - return <AstNode>[]
|
| - ..add(_comment)
|
| - ..addAll(_metadata)
|
| - ..sort(AstNode.LEXICAL_ORDER);
|
| - }
|
| }
|
|
|
| /**
|
| @@ -267,15 +268,13 @@ class Annotation extends AstNode {
|
| * @param arguments the arguments to the constructor being invoked, or `null` if this
|
| * annotation is not the invocation of a constructor
|
| */
|
| - Annotation(this.atSign, Identifier name, this.period, SimpleIdentifier constructorName, ArgumentList arguments) {
|
| + Annotation(this.atSign, Identifier name, this.period,
|
| + SimpleIdentifier constructorName, ArgumentList arguments) {
|
| _name = becomeParentOf(name);
|
| _constructorName = becomeParentOf(constructorName);
|
| _arguments = becomeParentOf(arguments);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitAnnotation(this);
|
| -
|
| /**
|
| * Return the arguments to the constructor being invoked, or `null` if this annotation is
|
| * not the invocation of a constructor.
|
| @@ -284,6 +283,15 @@ class Annotation extends AstNode {
|
| */
|
| ArgumentList get arguments => _arguments;
|
|
|
| + /**
|
| + * Set the arguments to the constructor being invoked to the given arguments.
|
| + *
|
| + * @param arguments the arguments to the constructor being invoked
|
| + */
|
| + void set arguments(ArgumentList arguments) {
|
| + _arguments = becomeParentOf(arguments);
|
| + }
|
| +
|
| @override
|
| Token get beginToken => atSign;
|
|
|
| @@ -296,6 +304,15 @@ class Annotation extends AstNode {
|
| SimpleIdentifier get constructorName => _constructorName;
|
|
|
| /**
|
| + * Set the name of the constructor being invoked to the given name.
|
| + *
|
| + * @param constructorName the name of the constructor being invoked
|
| + */
|
| + void set constructorName(SimpleIdentifier constructorName) {
|
| + _constructorName = becomeParentOf(constructorName);
|
| + }
|
| +
|
| + /**
|
| * Return the element associated with this annotation, or `null` if the AST structure has
|
| * not been resolved or if this annotation could not be resolved.
|
| *
|
| @@ -310,6 +327,15 @@ class Annotation extends AstNode {
|
| return null;
|
| }
|
|
|
| + /**
|
| + * Set the element associated with this annotation based.
|
| + *
|
| + * @param element the element to be associated with this identifier
|
| + */
|
| + void set element(Element element) {
|
| + _element = element;
|
| + }
|
| +
|
| @override
|
| Token get endToken {
|
| if (_arguments != null) {
|
| @@ -329,33 +355,6 @@ class Annotation extends AstNode {
|
| Identifier get name => _name;
|
|
|
| /**
|
| - * Set the arguments to the constructor being invoked to the given arguments.
|
| - *
|
| - * @param arguments the arguments to the constructor being invoked
|
| - */
|
| - void set arguments(ArgumentList arguments) {
|
| - _arguments = becomeParentOf(arguments);
|
| - }
|
| -
|
| - /**
|
| - * Set the name of the constructor being invoked to the given name.
|
| - *
|
| - * @param constructorName the name of the constructor being invoked
|
| - */
|
| - void set constructorName(SimpleIdentifier constructorName) {
|
| - _constructorName = becomeParentOf(constructorName);
|
| - }
|
| -
|
| - /**
|
| - * Set the element associated with this annotation based.
|
| - *
|
| - * @param element the element to be associated with this identifier
|
| - */
|
| - void set element(Element element) {
|
| - _element = element;
|
| - }
|
| -
|
| - /**
|
| * 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.
|
| *
|
| @@ -366,6 +365,9 @@ class Annotation extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitAnnotation(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_constructorName, visitor);
|
| @@ -427,13 +429,11 @@ class ArgumentList extends AstNode {
|
| * @param arguments the expressions producing the values of the arguments
|
| * @param rightParenthesis the right parenthesis
|
| */
|
| - ArgumentList(this.leftParenthesis, List<Expression> arguments, this.rightParenthesis) {
|
| + ArgumentList(this.leftParenthesis, List<Expression> arguments,
|
| + this.rightParenthesis) {
|
| _arguments = new NodeList<Expression>(this, arguments);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitArgumentList(this);
|
| -
|
| /**
|
| * Return the expressions producing the values of the arguments. Although the language requires
|
| * that positional arguments appear before named arguments, this class allows them to be
|
| @@ -446,9 +446,6 @@ class ArgumentList extends AstNode {
|
| @override
|
| Token get beginToken => leftParenthesis;
|
|
|
| - @override
|
| - Token get endToken => rightParenthesis;
|
| -
|
| /**
|
| * Set the parameter elements corresponding to each of the arguments in this list to the given
|
| * array of parameters. The array of parameters must be the same length as the number of
|
| @@ -457,9 +454,11 @@ class ArgumentList extends AstNode {
|
| *
|
| * @param parameters the parameter elements corresponding to the arguments
|
| */
|
| - void set correspondingPropagatedParameters(List<ParameterElement> parameters) {
|
| + void set
|
| + correspondingPropagatedParameters(List<ParameterElement> parameters) {
|
| if (parameters.length != _arguments.length) {
|
| - throw new IllegalArgumentException("Expected ${_arguments.length} parameters, not ${parameters.length}");
|
| + throw new IllegalArgumentException(
|
| + "Expected ${_arguments.length} parameters, not ${parameters.length}");
|
| }
|
| _correspondingPropagatedParameters = parameters;
|
| }
|
| @@ -474,15 +473,17 @@ class ArgumentList extends AstNode {
|
| */
|
| void set correspondingStaticParameters(List<ParameterElement> parameters) {
|
| if (parameters.length != _arguments.length) {
|
| - throw new IllegalArgumentException("Expected ${_arguments.length} parameters, not ${parameters.length}");
|
| + throw new IllegalArgumentException(
|
| + "Expected ${_arguments.length} parameters, not ${parameters.length}");
|
| }
|
| _correspondingStaticParameters = parameters;
|
| }
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - _arguments.accept(visitor);
|
| - }
|
| + Token get endToken => rightParenthesis;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitArgumentList(this);
|
|
|
| /**
|
| * If the given expression is a child of this list, and the AST structure has been resolved, and
|
| @@ -499,8 +500,8 @@ class ArgumentList extends AstNode {
|
| */
|
| ParameterElement getPropagatedParameterElementFor(Expression expression) {
|
| if (_correspondingPropagatedParameters == null) {
|
| - // Either the AST structure has not been resolved or the invocation of which this list is a
|
| - // part could not be resolved.
|
| + // Either the AST structure has not been resolved or the invocation
|
| + // of which this list is a part could not be resolved.
|
| return null;
|
| }
|
| int index = _arguments.indexOf(expression);
|
| @@ -526,8 +527,8 @@ class ArgumentList extends AstNode {
|
| */
|
| ParameterElement getStaticParameterElementFor(Expression expression) {
|
| if (_correspondingStaticParameters == null) {
|
| - // Either the AST structure has not been resolved or the invocation of which this list is a
|
| - // part could not be resolved.
|
| + // Either the AST structure has not been resolved or the invocation
|
| + // of which this list is a part could not be resolved.
|
| return null;
|
| }
|
| int index = _arguments.indexOf(expression);
|
| @@ -537,6 +538,11 @@ class ArgumentList extends AstNode {
|
| }
|
| return _correspondingStaticParameters[index];
|
| }
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + _arguments.accept(visitor);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -576,9 +582,6 @@ class AsExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitAsExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _expression.beginToken;
|
|
|
| @override
|
| @@ -591,6 +594,15 @@ class AsExpression extends Expression {
|
| */
|
| Expression get expression => _expression;
|
|
|
| + /**
|
| + * Set the expression used to compute the value being cast to the given expression.
|
| + *
|
| + * @param expression the expression used to compute the value being cast
|
| + */
|
| + void set expression(Expression expression) {
|
| + _expression = becomeParentOf(expression);
|
| + }
|
| +
|
| @override
|
| int get precedence => 7;
|
|
|
| @@ -602,15 +614,6 @@ class AsExpression extends Expression {
|
| TypeName get type => _type;
|
|
|
| /**
|
| - * Set the expression used to compute the value being cast to the given expression.
|
| - *
|
| - * @param expression the expression used to compute the value being cast
|
| - */
|
| - void set expression(Expression expression) {
|
| - _expression = becomeParentOf(expression);
|
| - }
|
| -
|
| - /**
|
| * Set the name of the type being cast to to the given name.
|
| *
|
| * @param name the name of the type being cast to
|
| @@ -620,6 +623,9 @@ class AsExpression extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitAsExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| safelyVisitChild(_type, visitor);
|
| @@ -669,14 +675,12 @@ class AssertStatement extends Statement {
|
| * @param rightParenthesis the right parenthesis
|
| * @param semicolon the semicolon terminating the statement
|
| */
|
| - AssertStatement(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, this.semicolon) {
|
| + AssertStatement(this.keyword, this.leftParenthesis, Expression condition,
|
| + this.rightParenthesis, this.semicolon) {
|
| _condition = becomeParentOf(condition);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| /**
|
| @@ -686,9 +690,6 @@ class AssertStatement extends Statement {
|
| */
|
| Expression get condition => _condition;
|
|
|
| - @override
|
| - Token get endToken => semicolon;
|
| -
|
| /**
|
| * Set the condition that is being asserted to be `true` to the given expression.
|
| *
|
| @@ -699,6 +700,12 @@ class AssertStatement extends Statement {
|
| }
|
|
|
| @override
|
| + Token get endToken => semicolon;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_condition, visitor);
|
| }
|
| @@ -749,7 +756,8 @@ class AssignmentExpression extends Expression {
|
| * @param operator the assignment operator being applied
|
| * @param rightHandSide the expression used to compute the right hand side
|
| */
|
| - AssignmentExpression(Expression leftHandSide, this.operator, Expression rightHandSide) {
|
| + AssignmentExpression(Expression leftHandSide, this.operator,
|
| + Expression rightHandSide) {
|
| if (leftHandSide == null || rightHandSide == null) {
|
| String message;
|
| if (leftHandSide == null) {
|
| @@ -770,9 +778,6 @@ class AssignmentExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _leftHandSide.beginToken;
|
|
|
| /**
|
| @@ -801,16 +806,6 @@ class AssignmentExpression extends Expression {
|
| */
|
| Expression get leftHandSide => _leftHandSide;
|
|
|
| - @override
|
| - int get precedence => 1;
|
| -
|
| - /**
|
| - * Return the expression used to compute the right hand side.
|
| - *
|
| - * @return the expression used to compute the right hand side
|
| - */
|
| - Expression get rightHandSide => _rightHandSide;
|
| -
|
| /**
|
| * Return the expression used to compute the left hand side.
|
| *
|
| @@ -820,20 +815,8 @@ class AssignmentExpression extends Expression {
|
| _leftHandSide = becomeParentOf(expression);
|
| }
|
|
|
| - /**
|
| - * Set the expression used to compute the left hand side to the given expression.
|
| - *
|
| - * @param expression the expression used to compute the left hand side
|
| - */
|
| - void set rightHandSide(Expression expression) {
|
| - _rightHandSide = becomeParentOf(expression);
|
| - }
|
| -
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_leftHandSide, visitor);
|
| - safelyVisitChild(_rightHandSide, visitor);
|
| - }
|
| + int get precedence => 1;
|
|
|
| /**
|
| * If the AST structure has been resolved, and the function being invoked is known based on
|
| @@ -858,7 +841,8 @@ class AssignmentExpression extends Expression {
|
| }
|
| }
|
| if (_leftHandSide is PropertyAccess) {
|
| - SimpleIdentifier identifier = (_leftHandSide as PropertyAccess).propertyName;
|
| + SimpleIdentifier identifier =
|
| + (_leftHandSide as PropertyAccess).propertyName;
|
| Element leftElement = identifier.propagatedElement;
|
| if (leftElement is ExecutableElement) {
|
| executableElement = leftElement;
|
| @@ -876,6 +860,22 @@ class AssignmentExpression extends Expression {
|
| }
|
|
|
| /**
|
| + * Return the expression used to compute the right hand side.
|
| + *
|
| + * @return the expression used to compute the right hand side
|
| + */
|
| + Expression get rightHandSide => _rightHandSide;
|
| +
|
| + /**
|
| + * Set the expression used to compute the left hand side to the given expression.
|
| + *
|
| + * @param expression the expression used to compute the left hand side
|
| + */
|
| + void set rightHandSide(Expression expression) {
|
| + _rightHandSide = becomeParentOf(expression);
|
| + }
|
| +
|
| + /**
|
| * If the AST structure has been resolved, and the function being invoked is known based on static
|
| * type information, then return the parameter element representing the parameter to which the
|
| * value of the right operand will be bound. Otherwise, return `null`.
|
| @@ -897,7 +897,8 @@ class AssignmentExpression extends Expression {
|
| }
|
| }
|
| if (_leftHandSide is PropertyAccess) {
|
| - Element leftElement = (_leftHandSide as PropertyAccess).propertyName.staticElement;
|
| + Element leftElement =
|
| + (_leftHandSide as PropertyAccess).propertyName.staticElement;
|
| if (leftElement is ExecutableElement) {
|
| executableElement = leftElement;
|
| }
|
| @@ -912,6 +913,15 @@ class AssignmentExpression extends Expression {
|
| }
|
| return parameters[0];
|
| }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitAssignmentExpression(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_leftHandSide, visitor);
|
| + safelyVisitChild(_rightHandSide, visitor);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -977,12 +987,12 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - AdjacentStrings visitAdjacentStrings(AdjacentStrings node)
|
| - => new AdjacentStrings(cloneNodeList(node.strings));
|
| + AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
|
| + new AdjacentStrings(cloneNodeList(node.strings));
|
|
|
| @override
|
| - Annotation visitAnnotation(Annotation node)
|
| - => new Annotation(
|
| + Annotation visitAnnotation(Annotation node) =>
|
| + new Annotation(
|
| cloneToken(node.atSign),
|
| cloneNode(node.name),
|
| cloneToken(node.period),
|
| @@ -990,22 +1000,22 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.arguments));
|
|
|
| @override
|
| - ArgumentList visitArgumentList(ArgumentList node)
|
| - => new ArgumentList(
|
| + ArgumentList visitArgumentList(ArgumentList node) =>
|
| + new ArgumentList(
|
| cloneToken(node.leftParenthesis),
|
| cloneNodeList(node.arguments),
|
| cloneToken(node.rightParenthesis));
|
|
|
| @override
|
| - AsExpression visitAsExpression(AsExpression node)
|
| - => new AsExpression(
|
| + AsExpression visitAsExpression(AsExpression node) =>
|
| + new AsExpression(
|
| cloneNode(node.expression),
|
| cloneToken(node.asOperator),
|
| cloneNode(node.type));
|
|
|
| @override
|
| - AstNode visitAssertStatement(AssertStatement node)
|
| - => new AssertStatement(
|
| + AstNode visitAssertStatement(AssertStatement node) =>
|
| + new AssertStatement(
|
| cloneToken(node.keyword),
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.condition),
|
| @@ -1013,59 +1023,57 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - AssignmentExpression visitAssignmentExpression(AssignmentExpression node)
|
| - => new AssignmentExpression(
|
| + AssignmentExpression visitAssignmentExpression(AssignmentExpression node) =>
|
| + new AssignmentExpression(
|
| cloneNode(node.leftHandSide),
|
| cloneToken(node.operator),
|
| cloneNode(node.rightHandSide));
|
|
|
| @override
|
| - AwaitExpression visitAwaitExpression(AwaitExpression node)
|
| - => new AwaitExpression(
|
| - cloneToken(node.awaitKeyword),
|
| - cloneNode(node.expression));
|
| + AwaitExpression visitAwaitExpression(AwaitExpression node) =>
|
| + new AwaitExpression(cloneToken(node.awaitKeyword), cloneNode(node.expression));
|
|
|
| @override
|
| - BinaryExpression visitBinaryExpression(BinaryExpression node)
|
| - => new BinaryExpression(
|
| + BinaryExpression visitBinaryExpression(BinaryExpression node) =>
|
| + new BinaryExpression(
|
| cloneNode(node.leftOperand),
|
| cloneToken(node.operator),
|
| cloneNode(node.rightOperand));
|
|
|
| @override
|
| - Block visitBlock(Block node)
|
| - => new Block(
|
| + Block visitBlock(Block node) =>
|
| + new Block(
|
| cloneToken(node.leftBracket),
|
| cloneNodeList(node.statements),
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node)
|
| - => new BlockFunctionBody(
|
| + BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
|
| + new BlockFunctionBody(
|
| cloneToken(node.keyword),
|
| cloneToken(node.star),
|
| cloneNode(node.block));
|
|
|
| @override
|
| - BooleanLiteral visitBooleanLiteral(BooleanLiteral node)
|
| - => new BooleanLiteral(cloneToken(node.literal), node.value);
|
| + BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
|
| + new BooleanLiteral(cloneToken(node.literal), node.value);
|
|
|
| @override
|
| - BreakStatement visitBreakStatement(BreakStatement node)
|
| - => new BreakStatement(
|
| + BreakStatement visitBreakStatement(BreakStatement node) =>
|
| + new BreakStatement(
|
| cloneToken(node.keyword),
|
| cloneNode(node.label),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - CascadeExpression visitCascadeExpression(CascadeExpression node)
|
| - => new CascadeExpression(
|
| + CascadeExpression visitCascadeExpression(CascadeExpression node) =>
|
| + new CascadeExpression(
|
| cloneNode(node.target),
|
| cloneNodeList(node.cascadeSections));
|
|
|
| @override
|
| - CatchClause visitCatchClause(CatchClause node)
|
| - => new CatchClause(
|
| + CatchClause visitCatchClause(CatchClause node) =>
|
| + new CatchClause(
|
| cloneToken(node.onKeyword),
|
| cloneNode(node.exceptionType),
|
| cloneToken(node.catchKeyword),
|
| @@ -1096,8 +1104,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node)
|
| - => new ClassTypeAlias(
|
| + ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) =>
|
| + new ClassTypeAlias(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1123,10 +1131,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - CommentReference visitCommentReference(CommentReference node)
|
| - => new CommentReference(
|
| - cloneToken(node.newKeyword),
|
| - cloneNode(node.identifier));
|
| + CommentReference visitCommentReference(CommentReference node) =>
|
| + new CommentReference(cloneToken(node.newKeyword), cloneNode(node.identifier));
|
|
|
| @override
|
| CompilationUnit visitCompilationUnit(CompilationUnit node) {
|
| @@ -1141,8 +1147,9 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - ConditionalExpression visitConditionalExpression(ConditionalExpression node)
|
| - => new ConditionalExpression(
|
| + ConditionalExpression
|
| + visitConditionalExpression(ConditionalExpression node) =>
|
| + new ConditionalExpression(
|
| cloneNode(node.condition),
|
| cloneToken(node.question),
|
| cloneNode(node.thenExpression),
|
| @@ -1150,8 +1157,9 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.elseExpression));
|
|
|
| @override
|
| - ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node)
|
| - => new ConstructorDeclaration(
|
| + ConstructorDeclaration
|
| + visitConstructorDeclaration(ConstructorDeclaration node) =>
|
| + new ConstructorDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.externalKeyword),
|
| @@ -1167,8 +1175,9 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.body));
|
|
|
| @override
|
| - ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node)
|
| - => new ConstructorFieldInitializer(
|
| + ConstructorFieldInitializer
|
| + visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
|
| + new ConstructorFieldInitializer(
|
| cloneToken(node.keyword),
|
| cloneToken(node.period),
|
| cloneNode(node.fieldName),
|
| @@ -1176,22 +1185,22 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.expression));
|
|
|
| @override
|
| - ConstructorName visitConstructorName(ConstructorName node)
|
| - => new ConstructorName(
|
| + ConstructorName visitConstructorName(ConstructorName node) =>
|
| + new ConstructorName(
|
| cloneNode(node.type),
|
| cloneToken(node.period),
|
| cloneNode(node.name));
|
|
|
| @override
|
| - ContinueStatement visitContinueStatement(ContinueStatement node)
|
| - => new ContinueStatement(
|
| + ContinueStatement visitContinueStatement(ContinueStatement node) =>
|
| + new ContinueStatement(
|
| cloneToken(node.keyword),
|
| cloneNode(node.label),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node)
|
| - => new DeclaredIdentifier(
|
| + DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
|
| + new DeclaredIdentifier(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1199,16 +1208,17 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.identifier));
|
|
|
| @override
|
| - DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node)
|
| - => new DefaultFormalParameter(
|
| + DefaultFormalParameter
|
| + visitDefaultFormalParameter(DefaultFormalParameter node) =>
|
| + new DefaultFormalParameter(
|
| cloneNode(node.parameter),
|
| node.kind,
|
| cloneToken(node.separator),
|
| cloneNode(node.defaultValue));
|
|
|
| @override
|
| - DoStatement visitDoStatement(DoStatement node)
|
| - => new DoStatement(
|
| + DoStatement visitDoStatement(DoStatement node) =>
|
| + new DoStatement(
|
| cloneToken(node.doKeyword),
|
| cloneNode(node.body),
|
| cloneToken(node.whileKeyword),
|
| @@ -1218,27 +1228,27 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - DoubleLiteral visitDoubleLiteral(DoubleLiteral node)
|
| - => new DoubleLiteral(cloneToken(node.literal), node.value);
|
| + DoubleLiteral visitDoubleLiteral(DoubleLiteral node) =>
|
| + new DoubleLiteral(cloneToken(node.literal), node.value);
|
|
|
| @override
|
| - EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node)
|
| - => new EmptyFunctionBody(cloneToken(node.semicolon));
|
| + EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
|
| + new EmptyFunctionBody(cloneToken(node.semicolon));
|
|
|
| @override
|
| - EmptyStatement visitEmptyStatement(EmptyStatement node)
|
| - => new EmptyStatement(cloneToken(node.semicolon));
|
| + EmptyStatement visitEmptyStatement(EmptyStatement node) =>
|
| + new EmptyStatement(cloneToken(node.semicolon));
|
|
|
| @override
|
| - AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node)
|
| - => new EnumConstantDeclaration(
|
| + AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
|
| + new EnumConstantDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneNode(node.name));
|
|
|
| @override
|
| - EnumDeclaration visitEnumDeclaration(EnumDeclaration node)
|
| - => new EnumDeclaration(
|
| + EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
|
| + new EnumDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1262,28 +1272,25 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node)
|
| - => new ExpressionFunctionBody(
|
| + ExpressionFunctionBody
|
| + visitExpressionFunctionBody(ExpressionFunctionBody node) =>
|
| + new ExpressionFunctionBody(
|
| cloneToken(node.keyword),
|
| cloneToken(node.functionDefinition),
|
| cloneNode(node.expression),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - ExpressionStatement visitExpressionStatement(ExpressionStatement node)
|
| - => new ExpressionStatement(
|
| - cloneNode(node.expression),
|
| - cloneToken(node.semicolon));
|
| + ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
|
| + new ExpressionStatement(cloneNode(node.expression), cloneToken(node.semicolon));
|
|
|
| @override
|
| - ExtendsClause visitExtendsClause(ExtendsClause node)
|
| - => new ExtendsClause(
|
| - cloneToken(node.keyword),
|
| - cloneNode(node.superclass));
|
| + ExtendsClause visitExtendsClause(ExtendsClause node) =>
|
| + new ExtendsClause(cloneToken(node.keyword), cloneNode(node.superclass));
|
|
|
| @override
|
| - FieldDeclaration visitFieldDeclaration(FieldDeclaration node)
|
| - => new FieldDeclaration(
|
| + FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
|
| + new FieldDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.staticKeyword),
|
| @@ -1291,8 +1298,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node)
|
| - => new FieldFormalParameter(
|
| + FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
|
| + new FieldFormalParameter(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1328,8 +1335,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - FormalParameterList visitFormalParameterList(FormalParameterList node)
|
| - => new FormalParameterList(
|
| + FormalParameterList visitFormalParameterList(FormalParameterList node) =>
|
| + new FormalParameterList(
|
| cloneToken(node.leftParenthesis),
|
| cloneNodeList(node.parameters),
|
| cloneToken(node.leftDelimiter),
|
| @@ -1337,8 +1344,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.rightParenthesis));
|
|
|
| @override
|
| - ForStatement visitForStatement(ForStatement node)
|
| - => new ForStatement(
|
| + ForStatement visitForStatement(ForStatement node) =>
|
| + new ForStatement(
|
| cloneToken(node.forKeyword),
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.variables),
|
| @@ -1351,8 +1358,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.body));
|
|
|
| @override
|
| - FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node)
|
| - => new FunctionDeclaration(
|
| + FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
|
| + new FunctionDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.externalKeyword),
|
| @@ -1362,24 +1369,24 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.functionExpression));
|
|
|
| @override
|
| - FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node)
|
| - => new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
|
| + FunctionDeclarationStatement
|
| + visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
|
| + new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
|
|
|
| @override
|
| - FunctionExpression visitFunctionExpression(FunctionExpression node)
|
| - => new FunctionExpression(
|
| - cloneNode(node.parameters),
|
| - cloneNode(node.body));
|
| + FunctionExpression visitFunctionExpression(FunctionExpression node) =>
|
| + new FunctionExpression(cloneNode(node.parameters), cloneNode(node.body));
|
|
|
| @override
|
| - FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node)
|
| - => new FunctionExpressionInvocation(
|
| + FunctionExpressionInvocation
|
| + visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
|
| + new FunctionExpressionInvocation(
|
| cloneNode(node.function),
|
| cloneNode(node.argumentList));
|
|
|
| @override
|
| - FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node)
|
| - => new FunctionTypeAlias(
|
| + FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
|
| + new FunctionTypeAlias(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1390,8 +1397,9 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node)
|
| - => new FunctionTypedFormalParameter(
|
| + FunctionTypedFormalParameter
|
| + visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
|
| + new FunctionTypedFormalParameter(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneNode(node.returnType),
|
| @@ -1399,14 +1407,12 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.parameters));
|
|
|
| @override
|
| - HideCombinator visitHideCombinator(HideCombinator node)
|
| - => new HideCombinator(
|
| - cloneToken(node.keyword),
|
| - cloneNodeList(node.hiddenNames));
|
| + HideCombinator visitHideCombinator(HideCombinator node) =>
|
| + new HideCombinator(cloneToken(node.keyword), cloneNodeList(node.hiddenNames));
|
|
|
| @override
|
| - IfStatement visitIfStatement(IfStatement node)
|
| - => new IfStatement(
|
| + IfStatement visitIfStatement(IfStatement node) =>
|
| + new IfStatement(
|
| cloneToken(node.ifKeyword),
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.condition),
|
| @@ -1416,10 +1422,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.elseStatement));
|
|
|
| @override
|
| - ImplementsClause visitImplementsClause(ImplementsClause node)
|
| - => new ImplementsClause(
|
| - cloneToken(node.keyword),
|
| - cloneNodeList(node.interfaces));
|
| + ImplementsClause visitImplementsClause(ImplementsClause node) =>
|
| + new ImplementsClause(cloneToken(node.keyword), cloneNodeList(node.interfaces));
|
|
|
| @override
|
| ImportDirective visitImportDirective(ImportDirective node) {
|
| @@ -1457,48 +1461,48 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node)
|
| - => new InstanceCreationExpression(
|
| + InstanceCreationExpression
|
| + visitInstanceCreationExpression(InstanceCreationExpression node) =>
|
| + new InstanceCreationExpression(
|
| cloneToken(node.keyword),
|
| cloneNode(node.constructorName),
|
| cloneNode(node.argumentList));
|
|
|
| @override
|
| - IntegerLiteral visitIntegerLiteral(IntegerLiteral node)
|
| - => new IntegerLiteral(cloneToken(node.literal), node.value);
|
| + IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
|
| + new IntegerLiteral(cloneToken(node.literal), node.value);
|
|
|
| @override
|
| - InterpolationExpression visitInterpolationExpression(InterpolationExpression node)
|
| - => new InterpolationExpression(
|
| + InterpolationExpression
|
| + visitInterpolationExpression(InterpolationExpression node) =>
|
| + new InterpolationExpression(
|
| cloneToken(node.leftBracket),
|
| cloneNode(node.expression),
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - InterpolationString visitInterpolationString(InterpolationString node)
|
| - => new InterpolationString(cloneToken(node.contents), node.value);
|
| + InterpolationString visitInterpolationString(InterpolationString node) =>
|
| + new InterpolationString(cloneToken(node.contents), node.value);
|
|
|
| @override
|
| - IsExpression visitIsExpression(IsExpression node)
|
| - => new IsExpression(
|
| + IsExpression visitIsExpression(IsExpression node) =>
|
| + new IsExpression(
|
| cloneNode(node.expression),
|
| cloneToken(node.isOperator),
|
| cloneToken(node.notOperator),
|
| cloneNode(node.type));
|
|
|
| @override
|
| - Label visitLabel(Label node)
|
| - => new Label(cloneNode(node.label), cloneToken(node.colon));
|
| + Label visitLabel(Label node) =>
|
| + new Label(cloneNode(node.label), cloneToken(node.colon));
|
|
|
| @override
|
| - LabeledStatement visitLabeledStatement(LabeledStatement node)
|
| - => new LabeledStatement(
|
| - cloneNodeList(node.labels),
|
| - cloneNode(node.statement));
|
| + LabeledStatement visitLabeledStatement(LabeledStatement node) =>
|
| + new LabeledStatement(cloneNodeList(node.labels), cloneNode(node.statement));
|
|
|
| @override
|
| - LibraryDirective visitLibraryDirective(LibraryDirective node)
|
| - => new LibraryDirective(
|
| + LibraryDirective visitLibraryDirective(LibraryDirective node) =>
|
| + new LibraryDirective(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.libraryToken),
|
| @@ -1506,12 +1510,12 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node)
|
| - => new LibraryIdentifier(cloneNodeList(node.components));
|
| + LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
|
| + new LibraryIdentifier(cloneNodeList(node.components));
|
|
|
| @override
|
| - ListLiteral visitListLiteral(ListLiteral node)
|
| - => new ListLiteral(
|
| + ListLiteral visitListLiteral(ListLiteral node) =>
|
| + new ListLiteral(
|
| cloneToken(node.constKeyword),
|
| cloneNode(node.typeArguments),
|
| cloneToken(node.leftBracket),
|
| @@ -1519,8 +1523,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - MapLiteral visitMapLiteral(MapLiteral node)
|
| - => new MapLiteral(
|
| + MapLiteral visitMapLiteral(MapLiteral node) =>
|
| + new MapLiteral(
|
| cloneToken(node.constKeyword),
|
| cloneNode(node.typeArguments),
|
| cloneToken(node.leftBracket),
|
| @@ -1528,15 +1532,15 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node)
|
| - => new MapLiteralEntry(
|
| + MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
|
| + new MapLiteralEntry(
|
| cloneNode(node.key),
|
| cloneToken(node.separator),
|
| cloneNode(node.value));
|
|
|
| @override
|
| - MethodDeclaration visitMethodDeclaration(MethodDeclaration node)
|
| - => new MethodDeclaration(
|
| + MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
|
| + new MethodDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.externalKeyword),
|
| @@ -1549,35 +1553,36 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.body));
|
|
|
| @override
|
| - MethodInvocation visitMethodInvocation(MethodInvocation node)
|
| - => new MethodInvocation(
|
| + MethodInvocation visitMethodInvocation(MethodInvocation node) =>
|
| + new MethodInvocation(
|
| cloneNode(node.target),
|
| cloneToken(node.period),
|
| cloneNode(node.methodName),
|
| cloneNode(node.argumentList));
|
|
|
| @override
|
| - NamedExpression visitNamedExpression(NamedExpression node)
|
| - => new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
|
| + NamedExpression visitNamedExpression(NamedExpression node) =>
|
| + new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
|
|
|
| @override
|
| - AstNode visitNativeClause(NativeClause node)
|
| - => new NativeClause(cloneToken(node.keyword), cloneNode(node.name));
|
| + AstNode visitNativeClause(NativeClause node) =>
|
| + new NativeClause(cloneToken(node.keyword), cloneNode(node.name));
|
|
|
| @override
|
| - NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node)
|
| - => new NativeFunctionBody(
|
| + NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
|
| + new NativeFunctionBody(
|
| cloneToken(node.nativeToken),
|
| cloneNode(node.stringLiteral),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - NullLiteral visitNullLiteral(NullLiteral node)
|
| - => new NullLiteral(cloneToken(node.literal));
|
| + NullLiteral visitNullLiteral(NullLiteral node) =>
|
| + new NullLiteral(cloneToken(node.literal));
|
|
|
| @override
|
| - ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node)
|
| - => new ParenthesizedExpression(
|
| + ParenthesizedExpression
|
| + visitParenthesizedExpression(ParenthesizedExpression node) =>
|
| + new ParenthesizedExpression(
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.expression),
|
| cloneToken(node.rightParenthesis));
|
| @@ -1596,8 +1601,8 @@ class AstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - PartOfDirective visitPartOfDirective(PartOfDirective node)
|
| - => new PartOfDirective(
|
| + PartOfDirective visitPartOfDirective(PartOfDirective node) =>
|
| + new PartOfDirective(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.partToken),
|
| @@ -1606,63 +1611,59 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - PostfixExpression visitPostfixExpression(PostfixExpression node)
|
| - => new PostfixExpression(
|
| - cloneNode(node.operand),
|
| - cloneToken(node.operator));
|
| + PostfixExpression visitPostfixExpression(PostfixExpression node) =>
|
| + new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator));
|
|
|
| @override
|
| - PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node)
|
| - => new PrefixedIdentifier(
|
| + PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) =>
|
| + new PrefixedIdentifier(
|
| cloneNode(node.prefix),
|
| cloneToken(node.period),
|
| cloneNode(node.identifier));
|
|
|
| @override
|
| - PrefixExpression visitPrefixExpression(PrefixExpression node)
|
| - => new PrefixExpression(
|
| - cloneToken(node.operator),
|
| - cloneNode(node.operand));
|
| + PrefixExpression visitPrefixExpression(PrefixExpression node) =>
|
| + new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand));
|
|
|
| @override
|
| - PropertyAccess visitPropertyAccess(PropertyAccess node)
|
| - => new PropertyAccess(
|
| + PropertyAccess visitPropertyAccess(PropertyAccess node) =>
|
| + new PropertyAccess(
|
| cloneNode(node.target),
|
| cloneToken(node.operator),
|
| cloneNode(node.propertyName));
|
|
|
| @override
|
| - RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node)
|
| - => new RedirectingConstructorInvocation(
|
| + RedirectingConstructorInvocation
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
|
| + new RedirectingConstructorInvocation(
|
| cloneToken(node.keyword),
|
| cloneToken(node.period),
|
| cloneNode(node.constructorName),
|
| cloneNode(node.argumentList));
|
|
|
| @override
|
| - RethrowExpression visitRethrowExpression(RethrowExpression node)
|
| - => new RethrowExpression(cloneToken(node.keyword));
|
| + RethrowExpression visitRethrowExpression(RethrowExpression node) =>
|
| + new RethrowExpression(cloneToken(node.keyword));
|
|
|
| @override
|
| - ReturnStatement visitReturnStatement(ReturnStatement node)
|
| - => new ReturnStatement(
|
| + ReturnStatement visitReturnStatement(ReturnStatement node) =>
|
| + new ReturnStatement(
|
| cloneToken(node.keyword),
|
| cloneNode(node.expression),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - ScriptTag visitScriptTag(ScriptTag node)
|
| - => new ScriptTag(cloneToken(node.scriptTag));
|
| + ScriptTag visitScriptTag(ScriptTag node) =>
|
| + new ScriptTag(cloneToken(node.scriptTag));
|
|
|
| @override
|
| - ShowCombinator visitShowCombinator(ShowCombinator node)
|
| - => new ShowCombinator(
|
| - cloneToken(node.keyword),
|
| - cloneNodeList(node.shownNames));
|
| + ShowCombinator visitShowCombinator(ShowCombinator node) =>
|
| + new ShowCombinator(cloneToken(node.keyword), cloneNodeList(node.shownNames));
|
|
|
| @override
|
| - SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node)
|
| - => new SimpleFormalParameter(
|
| + SimpleFormalParameter
|
| + visitSimpleFormalParameter(SimpleFormalParameter node) =>
|
| + new SimpleFormalParameter(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1670,32 +1671,33 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.identifier));
|
|
|
| @override
|
| - SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node)
|
| - => new SimpleIdentifier(cloneToken(node.token));
|
| + SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
|
| + new SimpleIdentifier(cloneToken(node.token));
|
|
|
| @override
|
| - SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node)
|
| - => new SimpleStringLiteral(cloneToken(node.literal), node.value);
|
| + SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) =>
|
| + new SimpleStringLiteral(cloneToken(node.literal), node.value);
|
|
|
| @override
|
| - StringInterpolation visitStringInterpolation(StringInterpolation node)
|
| - => new StringInterpolation(cloneNodeList(node.elements));
|
| + StringInterpolation visitStringInterpolation(StringInterpolation node) =>
|
| + new StringInterpolation(cloneNodeList(node.elements));
|
|
|
| @override
|
| - SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node)
|
| - => new SuperConstructorInvocation(
|
| + SuperConstructorInvocation
|
| + visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
|
| + new SuperConstructorInvocation(
|
| cloneToken(node.keyword),
|
| cloneToken(node.period),
|
| cloneNode(node.constructorName),
|
| cloneNode(node.argumentList));
|
|
|
| @override
|
| - SuperExpression visitSuperExpression(SuperExpression node)
|
| - => new SuperExpression(cloneToken(node.keyword));
|
| + SuperExpression visitSuperExpression(SuperExpression node) =>
|
| + new SuperExpression(cloneToken(node.keyword));
|
|
|
| @override
|
| - SwitchCase visitSwitchCase(SwitchCase node)
|
| - => new SwitchCase(
|
| + SwitchCase visitSwitchCase(SwitchCase node) =>
|
| + new SwitchCase(
|
| cloneNodeList(node.labels),
|
| cloneToken(node.keyword),
|
| cloneNode(node.expression),
|
| @@ -1703,16 +1705,16 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNodeList(node.statements));
|
|
|
| @override
|
| - SwitchDefault visitSwitchDefault(SwitchDefault node)
|
| - => new SwitchDefault(
|
| + SwitchDefault visitSwitchDefault(SwitchDefault node) =>
|
| + new SwitchDefault(
|
| cloneNodeList(node.labels),
|
| cloneToken(node.keyword),
|
| cloneToken(node.colon),
|
| cloneNodeList(node.statements));
|
|
|
| @override
|
| - SwitchStatement visitSwitchStatement(SwitchStatement node)
|
| - => new SwitchStatement(
|
| + SwitchStatement visitSwitchStatement(SwitchStatement node) =>
|
| + new SwitchStatement(
|
| cloneToken(node.keyword),
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.expression),
|
| @@ -1722,32 +1724,29 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - SymbolLiteral visitSymbolLiteral(SymbolLiteral node)
|
| - => new SymbolLiteral(
|
| - cloneToken(node.poundSign),
|
| - cloneTokenList(node.components));
|
| + SymbolLiteral visitSymbolLiteral(SymbolLiteral node) =>
|
| + new SymbolLiteral(cloneToken(node.poundSign), cloneTokenList(node.components));
|
|
|
| @override
|
| - ThisExpression visitThisExpression(ThisExpression node)
|
| - => new ThisExpression(cloneToken(node.keyword));
|
| + ThisExpression visitThisExpression(ThisExpression node) =>
|
| + new ThisExpression(cloneToken(node.keyword));
|
|
|
| @override
|
| - ThrowExpression visitThrowExpression(ThrowExpression node)
|
| - => new ThrowExpression(
|
| - cloneToken(node.keyword),
|
| - cloneNode(node.expression));
|
| + ThrowExpression visitThrowExpression(ThrowExpression node) =>
|
| + new ThrowExpression(cloneToken(node.keyword), cloneNode(node.expression));
|
|
|
| @override
|
| - TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node)
|
| - => new TopLevelVariableDeclaration(
|
| + TopLevelVariableDeclaration
|
| + visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
|
| + new TopLevelVariableDeclaration(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneNode(node.variables),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - TryStatement visitTryStatement(TryStatement node)
|
| - => new TryStatement(
|
| + TryStatement visitTryStatement(TryStatement node) =>
|
| + new TryStatement(
|
| cloneToken(node.tryKeyword),
|
| cloneNode(node.body),
|
| cloneNodeList(node.catchClauses),
|
| @@ -1755,19 +1754,19 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.finallyBlock));
|
|
|
| @override
|
| - TypeArgumentList visitTypeArgumentList(TypeArgumentList node)
|
| - => new TypeArgumentList(
|
| + TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
|
| + new TypeArgumentList(
|
| cloneToken(node.leftBracket),
|
| cloneNodeList(node.arguments),
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - TypeName visitTypeName(TypeName node)
|
| - => new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
|
| + TypeName visitTypeName(TypeName node) =>
|
| + new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
|
|
|
| @override
|
| - TypeParameter visitTypeParameter(TypeParameter node)
|
| - => new TypeParameter(
|
| + TypeParameter visitTypeParameter(TypeParameter node) =>
|
| + new TypeParameter(
|
| cloneNode(node.documentationComment),
|
| cloneNodeList(node.metadata),
|
| cloneNode(node.name),
|
| @@ -1775,15 +1774,15 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.bound));
|
|
|
| @override
|
| - TypeParameterList visitTypeParameterList(TypeParameterList node)
|
| - => new TypeParameterList(
|
| + TypeParameterList visitTypeParameterList(TypeParameterList node) =>
|
| + new TypeParameterList(
|
| cloneToken(node.leftBracket),
|
| cloneNodeList(node.typeParameters),
|
| cloneToken(node.rightBracket));
|
|
|
| @override
|
| - VariableDeclaration visitVariableDeclaration(VariableDeclaration node)
|
| - => new VariableDeclaration(
|
| + VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
|
| + new VariableDeclaration(
|
| null,
|
| cloneNodeList(node.metadata),
|
| cloneNode(node.name),
|
| @@ -1791,8 +1790,9 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.initializer));
|
|
|
| @override
|
| - VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node)
|
| - => new VariableDeclarationList(
|
| + VariableDeclarationList
|
| + visitVariableDeclarationList(VariableDeclarationList node) =>
|
| + new VariableDeclarationList(
|
| null,
|
| cloneNodeList(node.metadata),
|
| cloneToken(node.keyword),
|
| @@ -1800,14 +1800,15 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNodeList(node.variables));
|
|
|
| @override
|
| - VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node)
|
| - => new VariableDeclarationStatement(
|
| + VariableDeclarationStatement
|
| + visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
|
| + new VariableDeclarationStatement(
|
| cloneNode(node.variables),
|
| cloneToken(node.semicolon));
|
|
|
| @override
|
| - WhileStatement visitWhileStatement(WhileStatement node)
|
| - => new WhileStatement(
|
| + WhileStatement visitWhileStatement(WhileStatement node) =>
|
| + new WhileStatement(
|
| cloneToken(node.keyword),
|
| cloneToken(node.leftParenthesis),
|
| cloneNode(node.condition),
|
| @@ -1815,14 +1816,12 @@ class AstCloner implements AstVisitor<AstNode> {
|
| cloneNode(node.body));
|
|
|
| @override
|
| - WithClause visitWithClause(WithClause node)
|
| - => new WithClause(
|
| - cloneToken(node.withKeyword),
|
| - cloneNodeList(node.mixinTypes));
|
| + WithClause visitWithClause(WithClause node) =>
|
| + new WithClause(cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes));
|
|
|
| @override
|
| - YieldStatement visitYieldStatement(YieldStatement node)
|
| - => new YieldStatement(
|
| + YieldStatement visitYieldStatement(YieldStatement node) =>
|
| + new YieldStatement(
|
| cloneToken(node.yieldKeyword),
|
| cloneToken(node.star),
|
| cloneNode(node.expression),
|
| @@ -1835,18 +1834,49 @@ class AstCloner implements AstVisitor<AstNode> {
|
| */
|
| class AstComparator implements AstVisitor<bool> {
|
| /**
|
| - * Return `true` if the [first] node and the [second] node are equal.
|
| + * The AST node with which the node being visited is to be compared. This is only valid at the
|
| + * beginning of each visit method (until [isEqualNodes] is invoked).
|
| */
|
| - static bool equalNodes(AstNode first, AstNode second) {
|
| - AstComparator comparator = new AstComparator();
|
| - return comparator.isEqualNodes(first, second);
|
| + AstNode _other;
|
| +
|
| + /**
|
| + * Return `true` if the [first] node and the [second] node have the same
|
| + * structure.
|
| + *
|
| + * *Note:* This method is only visible for testing purposes and should not be
|
| + * used by clients.
|
| + */
|
| + bool isEqualNodes(AstNode first, AstNode second) {
|
| + if (first == null) {
|
| + return second == null;
|
| + } else if (second == null) {
|
| + return false;
|
| + } else if (first.runtimeType != second.runtimeType) {
|
| + return false;
|
| + }
|
| + _other = second;
|
| + return first.accept(this);
|
| }
|
|
|
| /**
|
| - * The AST node with which the node being visited is to be compared. This is only valid at the
|
| - * beginning of each visit method (until [isEqualNodes] is invoked).
|
| + * Return `true` if the [first] token and the [second] token have the same
|
| + * structure.
|
| + *
|
| + * *Note:* This method is only visible for testing purposes and should not be
|
| + * used by clients.
|
| */
|
| - AstNode _other;
|
| + bool isEqualTokens(Token first, Token second) {
|
| + if (first == null) {
|
| + return second == null;
|
| + } else if (second == null) {
|
| + return false;
|
| + } else if (identical(first, second)) {
|
| + return true;
|
| + }
|
| + return first.offset == second.offset &&
|
| + first.length == second.length &&
|
| + first.lexeme == second.lexeme;
|
| + }
|
|
|
| @override
|
| bool visitAdjacentStrings(AdjacentStrings node) {
|
| @@ -1857,49 +1887,68 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitAnnotation(Annotation node) {
|
| Annotation other = _other as Annotation;
|
| - return isEqualTokens(node.atSign, other.atSign) && isEqualNodes(node.name, other.name) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.arguments, other.arguments);
|
| + return isEqualTokens(node.atSign, other.atSign) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.constructorName, other.constructorName) &&
|
| + isEqualNodes(node.arguments, other.arguments);
|
| }
|
|
|
| @override
|
| bool visitArgumentList(ArgumentList node) {
|
| ArgumentList other = _other as ArgumentList;
|
| - return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| + return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + _isEqualNodeLists(node.arguments, other.arguments) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| }
|
|
|
| @override
|
| bool visitAsExpression(AsExpression node) {
|
| AsExpression other = _other as AsExpression;
|
| - return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.asOperator, other.asOperator) && isEqualNodes(node.type, other.type);
|
| + return isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.asOperator, other.asOperator) &&
|
| + isEqualNodes(node.type, other.type);
|
| }
|
|
|
| @override
|
| bool visitAssertStatement(AssertStatement node) {
|
| AssertStatement other = _other as AssertStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitAssignmentExpression(AssignmentExpression node) {
|
| AssignmentExpression other = _other as AssignmentExpression;
|
| - return isEqualNodes(node.leftHandSide, other.leftHandSide) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.rightHandSide, other.rightHandSide);
|
| + return isEqualNodes(node.leftHandSide, other.leftHandSide) &&
|
| + isEqualTokens(node.operator, other.operator) &&
|
| + isEqualNodes(node.rightHandSide, other.rightHandSide);
|
| }
|
|
|
| @override
|
| bool visitAwaitExpression(AwaitExpression node) {
|
| AwaitExpression other = _other as AwaitExpression;
|
| - return isEqualTokens(node.awaitKeyword, other.awaitKeyword) && isEqualNodes(node.expression, other.expression);
|
| + return isEqualTokens(node.awaitKeyword, other.awaitKeyword) &&
|
| + isEqualNodes(node.expression, other.expression);
|
| }
|
|
|
| @override
|
| bool visitBinaryExpression(BinaryExpression node) {
|
| BinaryExpression other = _other as BinaryExpression;
|
| - return isEqualNodes(node.leftOperand, other.leftOperand) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.rightOperand, other.rightOperand);
|
| + return isEqualNodes(node.leftOperand, other.leftOperand) &&
|
| + isEqualTokens(node.operator, other.operator) &&
|
| + isEqualNodes(node.rightOperand, other.rightOperand);
|
| }
|
|
|
| @override
|
| bool visitBlock(Block node) {
|
| Block other = _other as Block;
|
| - return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.statements, other.statements) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.statements, other.statements) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| @@ -1911,37 +1960,74 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitBooleanLiteral(BooleanLiteral node) {
|
| BooleanLiteral other = _other as BooleanLiteral;
|
| - return isEqualTokens(node.literal, other.literal) && node.value == other.value;
|
| + return isEqualTokens(node.literal, other.literal) &&
|
| + node.value == other.value;
|
| }
|
|
|
| @override
|
| bool visitBreakStatement(BreakStatement node) {
|
| BreakStatement other = _other as BreakStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label, other.label) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.label, other.label) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitCascadeExpression(CascadeExpression node) {
|
| CascadeExpression other = _other as CascadeExpression;
|
| - return isEqualNodes(node.target, other.target) && _isEqualNodeLists(node.cascadeSections, other.cascadeSections);
|
| + return isEqualNodes(node.target, other.target) &&
|
| + _isEqualNodeLists(node.cascadeSections, other.cascadeSections);
|
| }
|
|
|
| @override
|
| bool visitCatchClause(CatchClause node) {
|
| CatchClause other = _other as CatchClause;
|
| - return isEqualTokens(node.onKeyword, other.onKeyword) && isEqualNodes(node.exceptionType, other.exceptionType) && isEqualTokens(node.catchKeyword, other.catchKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.exceptionParameter, other.exceptionParameter) && isEqualTokens(node.comma, other.comma) && isEqualNodes(node.stackTraceParameter, other.stackTraceParameter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
|
| + return isEqualTokens(node.onKeyword, other.onKeyword) &&
|
| + isEqualNodes(node.exceptionType, other.exceptionType) &&
|
| + isEqualTokens(node.catchKeyword, other.catchKeyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.exceptionParameter, other.exceptionParameter) &&
|
| + isEqualTokens(node.comma, other.comma) &&
|
| + isEqualNodes(node.stackTraceParameter, other.stackTraceParameter) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitClassDeclaration(ClassDeclaration node) {
|
| ClassDeclaration other = _other as ClassDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualTokens(node.classKeyword, other.classKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualNodes(node.extendsClause, other.extendsClause) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.abstractKeyword, other.abstractKeyword) &&
|
| + isEqualTokens(node.classKeyword, other.classKeyword) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.typeParameters, other.typeParameters) &&
|
| + isEqualNodes(node.extendsClause, other.extendsClause) &&
|
| + isEqualNodes(node.withClause, other.withClause) &&
|
| + isEqualNodes(node.implementsClause, other.implementsClause) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.members, other.members) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitClassTypeAlias(ClassTypeAlias node) {
|
| ClassTypeAlias other = _other as ClassTypeAlias;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualTokens(node.equals, other.equals) && isEqualTokens(node.abstractKeyword, other.abstractKeyword) && isEqualNodes(node.superclass, other.superclass) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.implementsClause, other.implementsClause) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.typeParameters, other.typeParameters) &&
|
| + isEqualTokens(node.equals, other.equals) &&
|
| + isEqualTokens(node.abstractKeyword, other.abstractKeyword) &&
|
| + isEqualNodes(node.superclass, other.superclass) &&
|
| + isEqualNodes(node.withClause, other.withClause) &&
|
| + isEqualNodes(node.implementsClause, other.implementsClause) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| @@ -1953,67 +2039,114 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitCommentReference(CommentReference node) {
|
| CommentReference other = _other as CommentReference;
|
| - return isEqualTokens(node.newKeyword, other.newKeyword) && isEqualNodes(node.identifier, other.identifier);
|
| + return isEqualTokens(node.newKeyword, other.newKeyword) &&
|
| + isEqualNodes(node.identifier, other.identifier);
|
| }
|
|
|
| @override
|
| bool visitCompilationUnit(CompilationUnit node) {
|
| CompilationUnit other = _other as CompilationUnit;
|
| - return isEqualTokens(node.beginToken, other.beginToken) && isEqualNodes(node.scriptTag, other.scriptTag) && _isEqualNodeLists(node.directives, other.directives) && _isEqualNodeLists(node.declarations, other.declarations) && isEqualTokens(node.endToken, other.endToken);
|
| + return isEqualTokens(node.beginToken, other.beginToken) &&
|
| + isEqualNodes(node.scriptTag, other.scriptTag) &&
|
| + _isEqualNodeLists(node.directives, other.directives) &&
|
| + _isEqualNodeLists(node.declarations, other.declarations) &&
|
| + isEqualTokens(node.endToken, other.endToken);
|
| }
|
|
|
| @override
|
| bool visitConditionalExpression(ConditionalExpression node) {
|
| ConditionalExpression other = _other as ConditionalExpression;
|
| - return isEqualNodes(node.condition, other.condition) && isEqualTokens(node.question, other.question) && isEqualNodes(node.thenExpression, other.thenExpression) && isEqualTokens(node.colon, other.colon) && isEqualNodes(node.elseExpression, other.elseExpression);
|
| + return isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.question, other.question) &&
|
| + isEqualNodes(node.thenExpression, other.thenExpression) &&
|
| + isEqualTokens(node.colon, other.colon) &&
|
| + isEqualNodes(node.elseExpression, other.elseExpression);
|
| }
|
|
|
| @override
|
| bool visitConstructorDeclaration(ConstructorDeclaration node) {
|
| ConstructorDeclaration other = _other as ConstructorDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualTokens(node.constKeyword, other.constKeyword) && isEqualTokens(node.factoryKeyword, other.factoryKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.period, other.period) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.separator, other.separator) && _isEqualNodeLists(node.initializers, other.initializers) && isEqualNodes(node.redirectedConstructor, other.redirectedConstructor) && isEqualNodes(node.body, other.body);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.externalKeyword, other.externalKeyword) &&
|
| + isEqualTokens(node.constKeyword, other.constKeyword) &&
|
| + isEqualTokens(node.factoryKeyword, other.factoryKeyword) &&
|
| + isEqualNodes(node.returnType, other.returnType) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.parameters, other.parameters) &&
|
| + isEqualTokens(node.separator, other.separator) &&
|
| + _isEqualNodeLists(node.initializers, other.initializers) &&
|
| + isEqualNodes(node.redirectedConstructor, other.redirectedConstructor) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
|
| ConstructorFieldInitializer other = _other as ConstructorFieldInitializer;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.fieldName, other.fieldName) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.expression, other.expression);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.fieldName, other.fieldName) &&
|
| + isEqualTokens(node.equals, other.equals) &&
|
| + isEqualNodes(node.expression, other.expression);
|
| }
|
|
|
| @override
|
| bool visitConstructorName(ConstructorName node) {
|
| ConstructorName other = _other as ConstructorName;
|
| - return isEqualNodes(node.type, other.type) && isEqualTokens(node.period, other.period) && isEqualNodes(node.name, other.name);
|
| + return isEqualNodes(node.type, other.type) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.name, other.name);
|
| }
|
|
|
| @override
|
| bool visitContinueStatement(ContinueStatement node) {
|
| ContinueStatement other = _other as ContinueStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label, other.label) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.label, other.label) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitDeclaredIdentifier(DeclaredIdentifier node) {
|
| DeclaredIdentifier other = _other as DeclaredIdentifier;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.identifier, other.identifier);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.type, other.type) &&
|
| + isEqualNodes(node.identifier, other.identifier);
|
| }
|
|
|
| @override
|
| bool visitDefaultFormalParameter(DefaultFormalParameter node) {
|
| DefaultFormalParameter other = _other as DefaultFormalParameter;
|
| - return isEqualNodes(node.parameter, other.parameter) && node.kind == other.kind && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.defaultValue, other.defaultValue);
|
| + return isEqualNodes(node.parameter, other.parameter) &&
|
| + node.kind == other.kind &&
|
| + isEqualTokens(node.separator, other.separator) &&
|
| + isEqualNodes(node.defaultValue, other.defaultValue);
|
| }
|
|
|
| @override
|
| bool visitDoStatement(DoStatement node) {
|
| DoStatement other = _other as DoStatement;
|
| - return isEqualTokens(node.doKeyword, other.doKeyword) && isEqualNodes(node.body, other.body) && isEqualTokens(node.whileKeyword, other.whileKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.doKeyword, other.doKeyword) &&
|
| + isEqualNodes(node.body, other.body) &&
|
| + isEqualTokens(node.whileKeyword, other.whileKeyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitDoubleLiteral(DoubleLiteral node) {
|
| DoubleLiteral other = _other as DoubleLiteral;
|
| - return isEqualTokens(node.literal, other.literal) && node.value == other.value;
|
| + return isEqualTokens(node.literal, other.literal) &&
|
| + node.value == other.value;
|
| }
|
|
|
| @override
|
| @@ -2031,73 +2164,137 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitEnumConstantDeclaration(EnumConstantDeclaration node) {
|
| EnumConstantDeclaration other = _other as EnumConstantDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualNodes(node.name, other.name);
|
| }
|
|
|
| @override
|
| bool visitEnumDeclaration(EnumDeclaration node) {
|
| EnumDeclaration other = _other as EnumDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.constants, other.constants) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.constants, other.constants) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitExportDirective(ExportDirective node) {
|
| ExportDirective other = _other as ExportDirective;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && _isEqualNodeLists(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.uri, other.uri) &&
|
| + _isEqualNodeLists(node.combinators, other.combinators) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
|
| ExpressionFunctionBody other = _other as ExpressionFunctionBody;
|
| - return isEqualTokens(node.functionDefinition, other.functionDefinition) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.functionDefinition, other.functionDefinition) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitExpressionStatement(ExpressionStatement node) {
|
| ExpressionStatement other = _other as ExpressionStatement;
|
| - return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitExtendsClause(ExtendsClause node) {
|
| ExtendsClause other = _other as ExtendsClause;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.superclass, other.superclass);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.superclass, other.superclass);
|
| }
|
|
|
| @override
|
| bool visitFieldDeclaration(FieldDeclaration node) {
|
| FieldDeclaration other = _other as FieldDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.staticKeyword, other.staticKeyword) && isEqualNodes(node.fields, other.fields) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.staticKeyword, other.staticKeyword) &&
|
| + isEqualNodes(node.fields, other.fields) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitFieldFormalParameter(FieldFormalParameter node) {
|
| FieldFormalParameter other = _other as FieldFormalParameter;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualTokens(node.thisToken, other.thisToken) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.type, other.type) &&
|
| + isEqualTokens(node.thisToken, other.thisToken) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.identifier, other.identifier);
|
| }
|
|
|
| @override
|
| bool visitForEachStatement(ForEachStatement node) {
|
| ForEachStatement other = _other as ForEachStatement;
|
| - return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.loopVariable, other.loopVariable) && isEqualTokens(node.inKeyword, other.inKeyword) && isEqualNodes(node.iterable, other.iterable) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
|
| + return isEqualTokens(node.forKeyword, other.forKeyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.loopVariable, other.loopVariable) &&
|
| + isEqualTokens(node.inKeyword, other.inKeyword) &&
|
| + isEqualNodes(node.iterable, other.iterable) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitFormalParameterList(FormalParameterList node) {
|
| FormalParameterList other = _other as FormalParameterList;
|
| - return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && _isEqualNodeLists(node.parameters, other.parameters) && isEqualTokens(node.leftDelimiter, other.leftDelimiter) && isEqualTokens(node.rightDelimiter, other.rightDelimiter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| + return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + _isEqualNodeLists(node.parameters, other.parameters) &&
|
| + isEqualTokens(node.leftDelimiter, other.leftDelimiter) &&
|
| + isEqualTokens(node.rightDelimiter, other.rightDelimiter) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| }
|
|
|
| @override
|
| bool visitForStatement(ForStatement node) {
|
| ForStatement other = _other as ForStatement;
|
| - return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.variables, other.variables) && isEqualNodes(node.initialization, other.initialization) && isEqualTokens(node.leftSeparator, other.leftSeparator) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightSeparator, other.rightSeparator) && _isEqualNodeLists(node.updaters, other.updaters) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
|
| + return isEqualTokens(node.forKeyword, other.forKeyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.variables, other.variables) &&
|
| + isEqualNodes(node.initialization, other.initialization) &&
|
| + isEqualTokens(node.leftSeparator, other.leftSeparator) &&
|
| + isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.rightSeparator, other.rightSeparator) &&
|
| + _isEqualNodeLists(node.updaters, other.updaters) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitFunctionDeclaration(FunctionDeclaration node) {
|
| FunctionDeclaration other = _other as FunctionDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.functionExpression, other.functionExpression);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.externalKeyword, other.externalKeyword) &&
|
| + isEqualNodes(node.returnType, other.returnType) &&
|
| + isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.functionExpression, other.functionExpression);
|
| }
|
|
|
| @override
|
| @@ -2109,103 +2306,157 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitFunctionExpression(FunctionExpression node) {
|
| FunctionExpression other = _other as FunctionExpression;
|
| - return isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
|
| + return isEqualNodes(node.parameters, other.parameters) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
|
| FunctionExpressionInvocation other = _other as FunctionExpressionInvocation;
|
| - return isEqualNodes(node.function, other.function) && isEqualNodes(node.argumentList, other.argumentList);
|
| + return isEqualNodes(node.function, other.function) &&
|
| + isEqualNodes(node.argumentList, other.argumentList);
|
| }
|
|
|
| @override
|
| bool visitFunctionTypeAlias(FunctionTypeAlias node) {
|
| FunctionTypeAlias other = _other as FunctionTypeAlias;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.returnType, other.returnType) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParameters) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.returnType, other.returnType) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.typeParameters, other.typeParameters) &&
|
| + isEqualNodes(node.parameters, other.parameters) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
|
| FunctionTypedFormalParameter other = _other as FunctionTypedFormalParameter;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.returnType, other.returnType) && isEqualNodes(node.identifier, other.identifier) && isEqualNodes(node.parameters, other.parameters);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualNodes(node.returnType, other.returnType) &&
|
| + isEqualNodes(node.identifier, other.identifier) &&
|
| + isEqualNodes(node.parameters, other.parameters);
|
| }
|
|
|
| @override
|
| bool visitHideCombinator(HideCombinator node) {
|
| HideCombinator other = _other as HideCombinator;
|
| - return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.hiddenNames, other.hiddenNames);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + _isEqualNodeLists(node.hiddenNames, other.hiddenNames);
|
| }
|
|
|
| @override
|
| bool visitIfStatement(IfStatement node) {
|
| IfStatement other = _other as IfStatement;
|
| - return isEqualTokens(node.ifKeyword, other.ifKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.thenStatement, other.thenStatement) && isEqualTokens(node.elseKeyword, other.elseKeyword) && isEqualNodes(node.elseStatement, other.elseStatement);
|
| + return isEqualTokens(node.ifKeyword, other.ifKeyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualNodes(node.thenStatement, other.thenStatement) &&
|
| + isEqualTokens(node.elseKeyword, other.elseKeyword) &&
|
| + isEqualNodes(node.elseStatement, other.elseStatement);
|
| }
|
|
|
| @override
|
| bool visitImplementsClause(ImplementsClause node) {
|
| ImplementsClause other = _other as ImplementsClause;
|
| - return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.interfaces, other.interfaces);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + _isEqualNodeLists(node.interfaces, other.interfaces);
|
| }
|
|
|
| @override
|
| bool visitImportDirective(ImportDirective node) {
|
| ImportDirective other = _other as ImportDirective;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.asToken, other.asToken) && isEqualNodes(node.prefix, other.prefix) && _isEqualNodeLists(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.uri, other.uri) &&
|
| + isEqualTokens(node.asToken, other.asToken) &&
|
| + isEqualNodes(node.prefix, other.prefix) &&
|
| + _isEqualNodeLists(node.combinators, other.combinators) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitIndexExpression(IndexExpression node) {
|
| IndexExpression other = _other as IndexExpression;
|
| - return isEqualNodes(node.target, other.target) && isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(node.index, other.index) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualNodes(node.target, other.target) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + isEqualNodes(node.index, other.index) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitInstanceCreationExpression(InstanceCreationExpression node) {
|
| InstanceCreationExpression other = _other as InstanceCreationExpression;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.constructorName, other.constructorName) &&
|
| + isEqualNodes(node.argumentList, other.argumentList);
|
| }
|
|
|
| @override
|
| bool visitIntegerLiteral(IntegerLiteral node) {
|
| IntegerLiteral other = _other as IntegerLiteral;
|
| - return isEqualTokens(node.literal, other.literal) && (node.value == other.value);
|
| + return isEqualTokens(node.literal, other.literal) &&
|
| + (node.value == other.value);
|
| }
|
|
|
| @override
|
| bool visitInterpolationExpression(InterpolationExpression node) {
|
| InterpolationExpression other = _other as InterpolationExpression;
|
| - return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitInterpolationString(InterpolationString node) {
|
| InterpolationString other = _other as InterpolationString;
|
| - return isEqualTokens(node.contents, other.contents) && node.value == other.value;
|
| + return isEqualTokens(node.contents, other.contents) &&
|
| + node.value == other.value;
|
| }
|
|
|
| @override
|
| bool visitIsExpression(IsExpression node) {
|
| IsExpression other = _other as IsExpression;
|
| - return isEqualNodes(node.expression, other.expression) && isEqualTokens(node.isOperator, other.isOperator) && isEqualTokens(node.notOperator, other.notOperator) && isEqualNodes(node.type, other.type);
|
| + return isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.isOperator, other.isOperator) &&
|
| + isEqualTokens(node.notOperator, other.notOperator) &&
|
| + isEqualNodes(node.type, other.type);
|
| }
|
|
|
| @override
|
| bool visitLabel(Label node) {
|
| Label other = _other as Label;
|
| - return isEqualNodes(node.label, other.label) && isEqualTokens(node.colon, other.colon);
|
| + return isEqualNodes(node.label, other.label) &&
|
| + isEqualTokens(node.colon, other.colon);
|
| }
|
|
|
| @override
|
| bool visitLabeledStatement(LabeledStatement node) {
|
| LabeledStatement other = _other as LabeledStatement;
|
| - return _isEqualNodeLists(node.labels, other.labels) && isEqualNodes(node.statement, other.statement);
|
| + return _isEqualNodeLists(node.labels, other.labels) &&
|
| + isEqualNodes(node.statement, other.statement);
|
| }
|
|
|
| @override
|
| bool visitLibraryDirective(LibraryDirective node) {
|
| LibraryDirective other = _other as LibraryDirective;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.libraryToken, other.libraryToken) && isEqualNodes(node.name, other.name) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.libraryToken, other.libraryToken) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| @@ -2217,49 +2468,77 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitListLiteral(ListLiteral node) {
|
| ListLiteral other = _other as ListLiteral;
|
| - return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes(node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.elements, other.elements) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.constKeyword, other.constKeyword) &&
|
| + isEqualNodes(node.typeArguments, other.typeArguments) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.elements, other.elements) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitMapLiteral(MapLiteral node) {
|
| MapLiteral other = _other as MapLiteral;
|
| - return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes(node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.entries, other.entries) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.constKeyword, other.constKeyword) &&
|
| + isEqualNodes(node.typeArguments, other.typeArguments) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.entries, other.entries) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitMapLiteralEntry(MapLiteralEntry node) {
|
| MapLiteralEntry other = _other as MapLiteralEntry;
|
| - return isEqualNodes(node.key, other.key) && isEqualTokens(node.separator, other.separator) && isEqualNodes(node.value, other.value);
|
| + return isEqualNodes(node.key, other.key) &&
|
| + isEqualTokens(node.separator, other.separator) &&
|
| + isEqualNodes(node.value, other.value);
|
| }
|
|
|
| @override
|
| bool visitMethodDeclaration(MethodDeclaration node) {
|
| MethodDeclaration other = _other as MethodDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.externalKeyword, other.externalKeyword) && isEqualTokens(node.modifierKeyword, other.modifierKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.externalKeyword, other.externalKeyword) &&
|
| + isEqualTokens(node.modifierKeyword, other.modifierKeyword) &&
|
| + isEqualNodes(node.returnType, other.returnType) &&
|
| + isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
|
| + isEqualTokens(node.propertyKeyword, other.propertyKeyword) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.parameters, other.parameters) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitMethodInvocation(MethodInvocation node) {
|
| MethodInvocation other = _other as MethodInvocation;
|
| - return isEqualNodes(node.target, other.target) && isEqualTokens(node.period, other.period) && isEqualNodes(node.methodName, other.methodName) && isEqualNodes(node.argumentList, other.argumentList);
|
| + return isEqualNodes(node.target, other.target) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.methodName, other.methodName) &&
|
| + isEqualNodes(node.argumentList, other.argumentList);
|
| }
|
|
|
| @override
|
| bool visitNamedExpression(NamedExpression node) {
|
| NamedExpression other = _other as NamedExpression;
|
| - return isEqualNodes(node.name, other.name) && isEqualNodes(node.expression, other.expression);
|
| + return isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.expression, other.expression);
|
| }
|
|
|
| @override
|
| bool visitNativeClause(NativeClause node) {
|
| NativeClause other = _other as NativeClause;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.name, other.name);
|
| }
|
|
|
| @override
|
| bool visitNativeFunctionBody(NativeFunctionBody node) {
|
| NativeFunctionBody other = _other as NativeFunctionBody;
|
| - return isEqualTokens(node.nativeToken, other.nativeToken) && isEqualNodes(node.stringLiteral, other.stringLiteral) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.nativeToken, other.nativeToken) &&
|
| + isEqualNodes(node.stringLiteral, other.stringLiteral) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| @@ -2271,49 +2550,75 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitParenthesizedExpression(ParenthesizedExpression node) {
|
| ParenthesizedExpression other = _other as ParenthesizedExpression;
|
| - return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| + return isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis);
|
| }
|
|
|
| @override
|
| bool visitPartDirective(PartDirective node) {
|
| PartDirective other = _other as PartDirective;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToken, other.partToken) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.partToken, other.partToken) &&
|
| + isEqualNodes(node.uri, other.uri) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitPartOfDirective(PartOfDirective node) {
|
| PartOfDirective other = _other as PartOfDirective;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToken, other.partToken) && isEqualTokens(node.ofToken, other.ofToken) && isEqualNodes(node.libraryName, other.libraryName) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.partToken, other.partToken) &&
|
| + isEqualTokens(node.ofToken, other.ofToken) &&
|
| + isEqualNodes(node.libraryName, other.libraryName) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitPostfixExpression(PostfixExpression node) {
|
| PostfixExpression other = _other as PostfixExpression;
|
| - return isEqualNodes(node.operand, other.operand) && isEqualTokens(node.operator, other.operator);
|
| + return isEqualNodes(node.operand, other.operand) &&
|
| + isEqualTokens(node.operator, other.operator);
|
| }
|
|
|
| @override
|
| bool visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| PrefixedIdentifier other = _other as PrefixedIdentifier;
|
| - return isEqualNodes(node.prefix, other.prefix) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
|
| + return isEqualNodes(node.prefix, other.prefix) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.identifier, other.identifier);
|
| }
|
|
|
| @override
|
| bool visitPrefixExpression(PrefixExpression node) {
|
| PrefixExpression other = _other as PrefixExpression;
|
| - return isEqualTokens(node.operator, other.operator) && isEqualNodes(node.operand, other.operand);
|
| + return isEqualTokens(node.operator, other.operator) &&
|
| + isEqualNodes(node.operand, other.operand);
|
| }
|
|
|
| @override
|
| bool visitPropertyAccess(PropertyAccess node) {
|
| PropertyAccess other = _other as PropertyAccess;
|
| - return isEqualNodes(node.target, other.target) && isEqualTokens(node.operator, other.operator) && isEqualNodes(node.propertyName, other.propertyName);
|
| + return isEqualNodes(node.target, other.target) &&
|
| + isEqualTokens(node.operator, other.operator) &&
|
| + isEqualNodes(node.propertyName, other.propertyName);
|
| }
|
|
|
| @override
|
| - bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| - RedirectingConstructorInvocation other = _other as RedirectingConstructorInvocation;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
|
| + bool
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| + RedirectingConstructorInvocation other =
|
| + _other as RedirectingConstructorInvocation;
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.constructorName, other.constructorName) &&
|
| + isEqualNodes(node.argumentList, other.argumentList);
|
| }
|
|
|
| @override
|
| @@ -2325,7 +2630,9 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitReturnStatement(ReturnStatement node) {
|
| ReturnStatement other = _other as ReturnStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| @@ -2337,13 +2644,20 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitShowCombinator(ShowCombinator node) {
|
| ShowCombinator other = _other as ShowCombinator;
|
| - return isEqualTokens(node.keyword, other.keyword) && _isEqualNodeLists(node.shownNames, other.shownNames);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + _isEqualNodeLists(node.shownNames, other.shownNames);
|
| }
|
|
|
| @override
|
| bool visitSimpleFormalParameter(SimpleFormalParameter node) {
|
| SimpleFormalParameter other = _other as SimpleFormalParameter;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.identifier, other.identifier);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.type, other.type) &&
|
| + isEqualNodes(node.identifier, other.identifier);
|
| }
|
|
|
| @override
|
| @@ -2355,7 +2669,8 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitSimpleStringLiteral(SimpleStringLiteral node) {
|
| SimpleStringLiteral other = _other as SimpleStringLiteral;
|
| - return isEqualTokens(node.literal, other.literal) && (node.value == other.value);
|
| + return isEqualTokens(node.literal, other.literal) &&
|
| + (node.value == other.value);
|
| }
|
|
|
| @override
|
| @@ -2367,7 +2682,10 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
|
| SuperConstructorInvocation other = _other as SuperConstructorInvocation;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.period, other.period) && isEqualNodes(node.constructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argumentList);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.period, other.period) &&
|
| + isEqualNodes(node.constructorName, other.constructorName) &&
|
| + isEqualNodes(node.argumentList, other.argumentList);
|
| }
|
|
|
| @override
|
| @@ -2379,25 +2697,39 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitSwitchCase(SwitchCase node) {
|
| SwitchCase other = _other as SwitchCase;
|
| - return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.statements);
|
| + return _isEqualNodeLists(node.labels, other.labels) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.colon, other.colon) &&
|
| + _isEqualNodeLists(node.statements, other.statements);
|
| }
|
|
|
| @override
|
| bool visitSwitchDefault(SwitchDefault node) {
|
| SwitchDefault other = _other as SwitchDefault;
|
| - return _isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.colon, other.colon) && _isEqualNodeLists(node.statements, other.statements);
|
| + return _isEqualNodeLists(node.labels, other.labels) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.colon, other.colon) &&
|
| + _isEqualNodeLists(node.statements, other.statements);
|
| }
|
|
|
| @override
|
| bool visitSwitchStatement(SwitchStatement node) {
|
| SwitchStatement other = _other as SwitchStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.members, other.members) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.members, other.members) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitSymbolLiteral(SymbolLiteral node) {
|
| SymbolLiteral other = _other as SymbolLiteral;
|
| - return isEqualTokens(node.poundSign, other.poundSign) && _isEqualTokenLists(node.components, other.components);
|
| + return isEqualTokens(node.poundSign, other.poundSign) &&
|
| + _isEqualTokenLists(node.components, other.components);
|
| }
|
|
|
| @override
|
| @@ -2409,79 +2741,120 @@ class AstComparator implements AstVisitor<bool> {
|
| @override
|
| bool visitThrowExpression(ThrowExpression node) {
|
| ThrowExpression other = _other as ThrowExpression;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expression, other.expression);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.expression, other.expression);
|
| }
|
|
|
| @override
|
| bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
|
| TopLevelVariableDeclaration other = _other as TopLevelVariableDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.variables, other.variables) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualNodes(node.variables, other.variables) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitTryStatement(TryStatement node) {
|
| TryStatement other = _other as TryStatement;
|
| - return isEqualTokens(node.tryKeyword, other.tryKeyword) && isEqualNodes(node.body, other.body) && _isEqualNodeLists(node.catchClauses, other.catchClauses) && isEqualTokens(node.finallyKeyword, other.finallyKeyword) && isEqualNodes(node.finallyBlock, other.finallyBlock);
|
| + return isEqualTokens(node.tryKeyword, other.tryKeyword) &&
|
| + isEqualNodes(node.body, other.body) &&
|
| + _isEqualNodeLists(node.catchClauses, other.catchClauses) &&
|
| + isEqualTokens(node.finallyKeyword, other.finallyKeyword) &&
|
| + isEqualNodes(node.finallyBlock, other.finallyBlock);
|
| }
|
|
|
| @override
|
| bool visitTypeArgumentList(TypeArgumentList node) {
|
| TypeArgumentList other = _other as TypeArgumentList;
|
| - return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.arguments, other.arguments) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitTypeName(TypeName node) {
|
| TypeName other = _other as TypeName;
|
| - return isEqualNodes(node.name, other.name) && isEqualNodes(node.typeArguments, other.typeArguments);
|
| + return isEqualNodes(node.name, other.name) &&
|
| + isEqualNodes(node.typeArguments, other.typeArguments);
|
| }
|
|
|
| @override
|
| bool visitTypeParameter(TypeParameter node) {
|
| TypeParameter other = _other as TypeParameter;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.bound, other.bound);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.bound, other.bound);
|
| }
|
|
|
| @override
|
| bool visitTypeParameterList(TypeParameterList node) {
|
| TypeParameterList other = _other as TypeParameterList;
|
| - return isEqualTokens(node.leftBracket, other.leftBracket) && _isEqualNodeLists(node.typeParameters, other.typeParameters) && isEqualTokens(node.rightBracket, other.rightBracket);
|
| + return isEqualTokens(node.leftBracket, other.leftBracket) &&
|
| + _isEqualNodeLists(node.typeParameters, other.typeParameters) &&
|
| + isEqualTokens(node.rightBracket, other.rightBracket);
|
| }
|
|
|
| @override
|
| bool visitVariableDeclaration(VariableDeclaration node) {
|
| VariableDeclaration other = _other as VariableDeclaration;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, other.name) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.initializer, other.initializer);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualNodes(node.name, other.name) &&
|
| + isEqualTokens(node.equals, other.equals) &&
|
| + isEqualNodes(node.initializer, other.initializer);
|
| }
|
|
|
| @override
|
| bool visitVariableDeclarationList(VariableDeclarationList node) {
|
| VariableDeclarationList other = _other as VariableDeclarationList;
|
| - return isEqualNodes(node.documentationComment, other.documentationComment) && _isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && _isEqualNodeLists(node.variables, other.variables);
|
| + return isEqualNodes(
|
| + node.documentationComment,
|
| + other.documentationComment) &&
|
| + _isEqualNodeLists(node.metadata, other.metadata) &&
|
| + isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualNodes(node.type, other.type) &&
|
| + _isEqualNodeLists(node.variables, other.variables);
|
| }
|
|
|
| @override
|
| bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
|
| VariableDeclarationStatement other = _other as VariableDeclarationStatement;
|
| - return isEqualNodes(node.variables, other.variables) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualNodes(node.variables, other.variables) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| @override
|
| bool visitWhileStatement(WhileStatement node) {
|
| WhileStatement other = _other as WhileStatement;
|
| - return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
|
| + return isEqualTokens(node.keyword, other.keyword) &&
|
| + isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
|
| + isEqualNodes(node.condition, other.condition) &&
|
| + isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
|
| + isEqualNodes(node.body, other.body);
|
| }
|
|
|
| @override
|
| bool visitWithClause(WithClause node) {
|
| WithClause other = _other as WithClause;
|
| - return isEqualTokens(node.withKeyword, other.withKeyword) && _isEqualNodeLists(node.mixinTypes, other.mixinTypes);
|
| + return isEqualTokens(node.withKeyword, other.withKeyword) &&
|
| + _isEqualNodeLists(node.mixinTypes, other.mixinTypes);
|
| }
|
|
|
| @override
|
| bool visitYieldStatement(YieldStatement node) {
|
| YieldStatement other = _other as YieldStatement;
|
| - return isEqualTokens(node.yieldKeyword, other.yieldKeyword) && isEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
|
| + return isEqualTokens(node.yieldKeyword, other.yieldKeyword) &&
|
| + isEqualNodes(node.expression, other.expression) &&
|
| + isEqualTokens(node.semicolon, other.semicolon);
|
| }
|
|
|
| /**
|
| @@ -2512,25 +2885,6 @@ class AstComparator implements AstVisitor<bool> {
|
| }
|
|
|
| /**
|
| - * Return `true` if the [first] node and the [second] node have the same
|
| - * structure.
|
| - *
|
| - * *Note:* This method is only visible for testing purposes and should not be
|
| - * used by clients.
|
| - */
|
| - bool isEqualNodes(AstNode first, AstNode second) {
|
| - if (first == null) {
|
| - return second == null;
|
| - } else if (second == null) {
|
| - return false;
|
| - } else if (first.runtimeType != second.runtimeType) {
|
| - return false;
|
| - }
|
| - _other = second;
|
| - return first.accept(this);
|
| - }
|
| -
|
| - /**
|
| * Return `true` if the given arrays of tokens have the same length and corresponding
|
| * elements are equal.
|
| *
|
| @@ -2553,23 +2907,11 @@ class AstComparator implements AstVisitor<bool> {
|
| }
|
|
|
| /**
|
| - * Return `true` if the [first] token and the [second] token have the same
|
| - * structure.
|
| - *
|
| - * *Note:* This method is only visible for testing purposes and should not be
|
| - * used by clients.
|
| + * Return `true` if the [first] node and the [second] node are equal.
|
| */
|
| - bool isEqualTokens(Token first, Token second) {
|
| - if (first == null) {
|
| - return second == null;
|
| - } else if (second == null) {
|
| - return false;
|
| - } else if (identical(first, second)) {
|
| - return true;
|
| - }
|
| - return first.offset == second.offset
|
| - && first.length == second.length
|
| - && first.lexeme == second.lexeme;
|
| + static bool equalNodes(AstNode first, AstNode second) {
|
| + AstComparator comparator = new AstComparator();
|
| + return comparator.isEqualNodes(first, second);
|
| }
|
| }
|
|
|
| @@ -2579,17 +2921,6 @@ class AstComparator implements AstVisitor<bool> {
|
| */
|
| abstract class AstNode {
|
| /**
|
| - * The parent of the node, or `null` if the node is the root of an AST structure.
|
| - */
|
| - AstNode _parent;
|
| -
|
| - /**
|
| - * A table mapping the names of properties to their values, or `null` if this node does not
|
| - * have any properties associated with it.
|
| - */
|
| - Map<String, Object> _propertyMap;
|
| -
|
| - /**
|
| * An empty array of ast nodes.
|
| */
|
| static const List<AstNode> EMPTY_ARRAY = const <AstNode>[];
|
| @@ -2600,30 +2931,19 @@ abstract class AstNode {
|
| * offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
|
| * if the offset of the first node is greater than the offset of the second node.
|
| */
|
| - static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) => second.offset - first.offset;
|
| + static Comparator<AstNode> LEXICAL_ORDER =
|
| + (AstNode first, AstNode second) => second.offset - first.offset;
|
|
|
| /**
|
| - * Use the given visitor to visit this node.
|
| - *
|
| - * @param visitor the visitor that will visit this node
|
| - * @return the value returned by the visitor as a result of visiting this node
|
| + * The parent of the node, or `null` if the node is the root of an AST structure.
|
| */
|
| - accept(AstVisitor visitor);
|
| + AstNode _parent;
|
|
|
| /**
|
| - * Return the node of the given class that most immediately encloses this node, or `null` if
|
| - * there is no enclosing node of the given class.
|
| - *
|
| - * @param nodeClass the class of the node to be returned
|
| - * @return the node of the given type that encloses this node
|
| + * A table mapping the names of properties to their values, or `null` if this node does not
|
| + * have any properties associated with it.
|
| */
|
| - AstNode getAncestor(Predicate<AstNode> predicate) {
|
| - AstNode node = this;
|
| - while (node != null && !predicate(node)) {
|
| - node = node.parent;
|
| - }
|
| - return node;
|
| - }
|
| + Map<String, Object> _propertyMap;
|
|
|
| /**
|
| * Return the first token included in this node's source range.
|
| @@ -2650,6 +2970,15 @@ abstract class AstNode {
|
| Token get endToken;
|
|
|
| /**
|
| + * Return `true` if this node is a synthetic node. A synthetic node is a node that was
|
| + * introduced by the parser in order to recover from an error in the code. Synthetic nodes always
|
| + * have a length of zero (`0`).
|
| + *
|
| + * @return `true` if this node is a synthetic node
|
| + */
|
| + bool get isSynthetic => false;
|
| +
|
| + /**
|
| * Return the number of characters in the node's source range.
|
| *
|
| * @return the number of characters in the node's source range
|
| @@ -2689,16 +3018,13 @@ abstract class AstNode {
|
| AstNode get parent => _parent;
|
|
|
| /**
|
| - * Return the value of the property with the given name, or `null` if this node does not
|
| - * have a property with the given name.
|
| + * Set the parent of this node to the given node.
|
| *
|
| - * @return the value of the property with the given name
|
| + * @param newParent the node that is to be made the parent of this node
|
| */
|
| - Object getProperty(String propertyName) {
|
| - if (_propertyMap == null) {
|
| - return null;
|
| - }
|
| - return _propertyMap[propertyName];
|
| + @deprecated
|
| + void set parent(AstNode newParent) {
|
| + _parent = newParent;
|
| }
|
|
|
| /**
|
| @@ -2718,13 +3044,65 @@ abstract class AstNode {
|
| }
|
|
|
| /**
|
| - * Return `true` if this node is a synthetic node. A synthetic node is a node that was
|
| - * introduced by the parser in order to recover from an error in the code. Synthetic nodes always
|
| - * have a length of zero (`0`).
|
| + * Use the given visitor to visit this node.
|
| *
|
| - * @return `true` if this node is a synthetic node
|
| + * @param visitor the visitor that will visit this node
|
| + * @return the value returned by the visitor as a result of visiting this node
|
| */
|
| - bool get isSynthetic => false;
|
| + accept(AstVisitor visitor);
|
| +
|
| + /**
|
| + * Make this node the parent of the given child node.
|
| + *
|
| + * @param child the node that will become a child of this node
|
| + * @return the node that was made a child of this node
|
| + */
|
| + AstNode becomeParentOf(AstNode child) {
|
| + if (child != null) {
|
| + child._parent = this;
|
| + }
|
| + return child;
|
| + }
|
| +
|
| + /**
|
| + * Return the node of the given class that most immediately encloses this node, or `null` if
|
| + * there is no enclosing node of the given class.
|
| + *
|
| + * @param nodeClass the class of the node to be returned
|
| + * @return the node of the given type that encloses this node
|
| + */
|
| + AstNode getAncestor(Predicate<AstNode> predicate) {
|
| + AstNode node = this;
|
| + while (node != null && !predicate(node)) {
|
| + node = node.parent;
|
| + }
|
| + return node;
|
| + }
|
| +
|
| + /**
|
| + * Return the value of the property with the given name, or `null` if this node does not
|
| + * have a property with the given name.
|
| + *
|
| + * @return the value of the property with the given name
|
| + */
|
| + Object getProperty(String propertyName) {
|
| + if (_propertyMap == null) {
|
| + return null;
|
| + }
|
| + return _propertyMap[propertyName];
|
| + }
|
| +
|
| + /**
|
| + * If the given child is not `null`, use the given visitor to visit it.
|
| + *
|
| + * @param child the child to be visited
|
| + * @param visitor the visitor that will be used to visit the child
|
| + */
|
| + void safelyVisitChild(AstNode child, AstVisitor visitor) {
|
| + if (child != null) {
|
| + child.accept(visitor);
|
| + }
|
| + }
|
|
|
| /**
|
| * Set the value of the property with the given name to the given value. If the value is
|
| @@ -2771,41 +3149,6 @@ abstract class AstNode {
|
| * @param visitor the visitor that will be used to visit the children of this node
|
| */
|
| void visitChildren(AstVisitor visitor);
|
| -
|
| - /**
|
| - * Make this node the parent of the given child node.
|
| - *
|
| - * @param child the node that will become a child of this node
|
| - * @return the node that was made a child of this node
|
| - */
|
| - AstNode becomeParentOf(AstNode child) {
|
| - if (child != null) {
|
| - child._parent = this;
|
| - }
|
| - return child;
|
| - }
|
| -
|
| - /**
|
| - * If the given child is not `null`, use the given visitor to visit it.
|
| - *
|
| - * @param child the child to be visited
|
| - * @param visitor the visitor that will be used to visit the child
|
| - */
|
| - void safelyVisitChild(AstNode child, AstVisitor visitor) {
|
| - if (child != null) {
|
| - child.accept(visitor);
|
| - }
|
| - }
|
| -
|
| - /**
|
| - * Set the parent of this node to the given node.
|
| - *
|
| - * @param newParent the node that is to be made the parent of this node
|
| - */
|
| - @deprecated
|
| - void set parent(AstNode newParent) {
|
| - _parent = newParent;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -2967,7 +3310,8 @@ abstract class AstVisitor<R> {
|
|
|
| R visitPropertyAccess(PropertyAccess node);
|
|
|
| - R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node);
|
| + R
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node);
|
|
|
| R visitRethrowExpression(RethrowExpression node);
|
|
|
| @@ -3051,9 +3395,6 @@ class AwaitExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (awaitKeyword != null) {
|
| return awaitKeyword;
|
| @@ -3071,9 +3412,6 @@ class AwaitExpression extends Expression {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - int get precedence => 0;
|
| -
|
| /**
|
| * Set the expression whose value is being waited on to the given expression.
|
| *
|
| @@ -3084,6 +3422,12 @@ class AwaitExpression extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 0;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitAwaitExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -3134,15 +3478,13 @@ class BinaryExpression extends Expression {
|
| * @param operator the binary operator being applied
|
| * @param rightOperand the expression used to compute the right operand
|
| */
|
| - BinaryExpression(Expression leftOperand, this.operator, Expression rightOperand) {
|
| + BinaryExpression(Expression leftOperand, this.operator,
|
| + Expression rightOperand) {
|
| _leftOperand = becomeParentOf(leftOperand);
|
| _rightOperand = becomeParentOf(rightOperand);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitBinaryExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _leftOperand.beginToken;
|
|
|
| /**
|
| @@ -3171,16 +3513,6 @@ class BinaryExpression extends Expression {
|
| */
|
| Expression get leftOperand => _leftOperand;
|
|
|
| - @override
|
| - int get precedence => operator.type.precedence;
|
| -
|
| - /**
|
| - * Return the expression used to compute the right operand.
|
| - *
|
| - * @return the expression used to compute the right operand
|
| - */
|
| - Expression get rightOperand => _rightOperand;
|
| -
|
| /**
|
| * Set the expression used to compute the left operand to the given expression.
|
| *
|
| @@ -3190,20 +3522,8 @@ class BinaryExpression extends Expression {
|
| _leftOperand = becomeParentOf(expression);
|
| }
|
|
|
| - /**
|
| - * Set the expression used to compute the right operand to the given expression.
|
| - *
|
| - * @param expression the expression used to compute the right operand
|
| - */
|
| - void set rightOperand(Expression expression) {
|
| - _rightOperand = becomeParentOf(expression);
|
| - }
|
| -
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_leftOperand, visitor);
|
| - safelyVisitChild(_rightOperand, visitor);
|
| - }
|
| + int get precedence => operator.type.precedence;
|
|
|
| /**
|
| * If the AST structure has been resolved, and the function being invoked is known based on
|
| @@ -3227,6 +3547,22 @@ class BinaryExpression extends Expression {
|
| }
|
|
|
| /**
|
| + * Return the expression used to compute the right operand.
|
| + *
|
| + * @return the expression used to compute the right operand
|
| + */
|
| + Expression get rightOperand => _rightOperand;
|
| +
|
| + /**
|
| + * Set the expression used to compute the right operand to the given expression.
|
| + *
|
| + * @param expression the expression used to compute the right operand
|
| + */
|
| + void set rightOperand(Expression expression) {
|
| + _rightOperand = becomeParentOf(expression);
|
| + }
|
| +
|
| + /**
|
| * If the AST structure has been resolved, and the function being invoked is known based on static
|
| * type information, then return the parameter element representing the parameter to which the
|
| * value of the right operand will be bound. Otherwise, return `null`.
|
| @@ -3246,6 +3582,15 @@ class BinaryExpression extends Expression {
|
| }
|
| return parameters[0];
|
| }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitBinaryExpression(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_leftOperand, visitor);
|
| + safelyVisitChild(_rightOperand, visitor);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -3284,9 +3629,6 @@ class Block extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitBlock(this);
|
| -
|
| - @override
|
| Token get beginToken => leftBracket;
|
|
|
| @override
|
| @@ -3300,6 +3642,9 @@ class Block extends Statement {
|
| NodeList<Statement> get statements => _statements;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitBlock(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _statements.accept(visitor);
|
| }
|
| @@ -3343,9 +3688,6 @@ class BlockFunctionBody extends FunctionBody {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
|
| -
|
| - @override
|
| Token get beginToken => _block.beginToken;
|
|
|
| /**
|
| @@ -3355,6 +3697,15 @@ class BlockFunctionBody extends FunctionBody {
|
| */
|
| Block get block => _block;
|
|
|
| + /**
|
| + * Set the block representing the body of the function to the given block.
|
| + *
|
| + * @param block the block representing the body of the function
|
| + */
|
| + void set block(Block block) {
|
| + _block = becomeParentOf(block);
|
| + }
|
| +
|
| @override
|
| Token get endToken => _block.endToken;
|
|
|
| @@ -3373,14 +3724,8 @@ class BlockFunctionBody extends FunctionBody {
|
| @override
|
| bool get isSynchronous => keyword == null || keyword.lexeme != Parser.ASYNC;
|
|
|
| - /**
|
| - * Set the block representing the body of the function to the given block.
|
| - *
|
| - * @param block the block representing the body of the function
|
| - */
|
| - void set block(Block block) {
|
| - _block = becomeParentOf(block);
|
| - }
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitBlockFunctionBody(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| @@ -3416,9 +3761,6 @@ class BooleanLiteral extends Literal {
|
| BooleanLiteral(this.literal, this.value);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken => literal;
|
|
|
| @override
|
| @@ -3428,6 +3770,9 @@ class BooleanLiteral extends Literal {
|
| bool get isSynthetic => literal.isSynthetic;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitBooleanLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -3461,6 +3806,10 @@ class BreadthFirstVisitor<R> extends GeneralizingAstVisitor<R> {
|
| */
|
| GeneralizingAstVisitor<Object> _childVisitor;
|
|
|
| + BreadthFirstVisitor() {
|
| + _childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this);
|
| + }
|
| +
|
| /**
|
| * Visit all nodes in the tree starting at the given `root` node, in breadth-first order.
|
| *
|
| @@ -3479,10 +3828,6 @@ class BreadthFirstVisitor<R> extends GeneralizingAstVisitor<R> {
|
| node.visitChildren(_childVisitor);
|
| return null;
|
| }
|
| -
|
| - BreadthFirstVisitor() {
|
| - _childVisitor = new GeneralizingAstVisitor_BreadthFirstVisitor(this);
|
| - }
|
| }
|
|
|
| /**
|
| @@ -3521,9 +3866,6 @@ class BreakStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitBreakStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -3546,6 +3888,9 @@ class BreakStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitBreakStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_label, visitor);
|
| }
|
| @@ -3592,9 +3937,6 @@ class CascadeExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitCascadeExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _target.beginToken;
|
|
|
| /**
|
| @@ -3627,6 +3969,9 @@ class CascadeExpression extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitCascadeExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_target, visitor);
|
| _cascadeSections.accept(visitor);
|
| @@ -3707,7 +4052,9 @@ class CatchClause extends AstNode {
|
| * @param rightParenthesis the right parenthesis
|
| * @param body the body of the catch block
|
| */
|
| - CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) {
|
| + CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword,
|
| + this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma,
|
| + SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) {
|
| _exceptionType = becomeParentOf(exceptionType);
|
| _exceptionParameter = becomeParentOf(exceptionParameter);
|
| _stackTraceParameter = becomeParentOf(stackTraceParameter);
|
| @@ -3715,9 +4062,6 @@ class CatchClause extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitCatchClause(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (onKeyword != null) {
|
| return onKeyword;
|
| @@ -3732,6 +4076,15 @@ class CatchClause extends AstNode {
|
| */
|
| Block get body => _body;
|
|
|
| + /**
|
| + * Set the body of the catch block to the given block.
|
| + *
|
| + * @param block the body of the catch block
|
| + */
|
| + void set body(Block block) {
|
| + _body = becomeParentOf(block);
|
| + }
|
| +
|
| @override
|
| Token get endToken => _body.endToken;
|
|
|
| @@ -3743,31 +4096,6 @@ class CatchClause extends AstNode {
|
| SimpleIdentifier get exceptionParameter => _exceptionParameter;
|
|
|
| /**
|
| - * Return the type of exceptions caught by this catch clause, or `null` if this catch clause
|
| - * catches every type of exception.
|
| - *
|
| - * @return the type of exceptions caught by this catch clause
|
| - */
|
| - TypeName get exceptionType => _exceptionType;
|
| -
|
| - /**
|
| - * Return the parameter whose value will be the stack trace associated with the exception, or
|
| - * `null` if there is no stack trace parameter.
|
| - *
|
| - * @return the parameter whose value will be the stack trace associated with the exception
|
| - */
|
| - SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
|
| -
|
| - /**
|
| - * Set the body of the catch block to the given block.
|
| - *
|
| - * @param block the body of the catch block
|
| - */
|
| - void set body(Block block) {
|
| - _body = becomeParentOf(block);
|
| - }
|
| -
|
| - /**
|
| * Set the parameter whose value will be the exception that was thrown to the given parameter.
|
| *
|
| * @param parameter the parameter whose value will be the exception that was thrown
|
| @@ -3777,6 +4105,14 @@ class CatchClause extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the type of exceptions caught by this catch clause, or `null` if this catch clause
|
| + * catches every type of exception.
|
| + *
|
| + * @return the type of exceptions caught by this catch clause
|
| + */
|
| + TypeName get exceptionType => _exceptionType;
|
| +
|
| + /**
|
| * Set the type of exceptions caught by this catch clause to the given type.
|
| *
|
| * @param exceptionType the type of exceptions caught by this catch clause
|
| @@ -3786,6 +4122,14 @@ class CatchClause extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the parameter whose value will be the stack trace associated with the exception, or
|
| + * `null` if there is no stack trace parameter.
|
| + *
|
| + * @return the parameter whose value will be the stack trace associated with the exception
|
| + */
|
| + SimpleIdentifier get stackTraceParameter => _stackTraceParameter;
|
| +
|
| + /**
|
| * Set the parameter whose value will be the stack trace associated with the exception to the
|
| * given parameter.
|
| *
|
| @@ -3797,6 +4141,9 @@ class CatchClause extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitCatchClause(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_exceptionType, visitor);
|
| safelyVisitChild(_exceptionParameter, visitor);
|
| @@ -3890,7 +4237,12 @@ class ClassDeclaration extends CompilationUnitMember {
|
| * @param members the members defined by the class
|
| * @param rightBracket the right curly bracket
|
| */
|
| - ClassDeclaration(Comment comment, List<Annotation> metadata, this.abstractKeyword, this.classKeyword, SimpleIdentifier name, TypeParameterList typeParameters, ExtendsClause extendsClause, WithClause withClause, ImplementsClause implementsClause, this.leftBracket, List<ClassMember> members, this.rightBracket) : super(comment, metadata) {
|
| + ClassDeclaration(Comment comment, List<Annotation> metadata,
|
| + this.abstractKeyword, this.classKeyword, SimpleIdentifier name,
|
| + TypeParameterList typeParameters, ExtendsClause extendsClause,
|
| + WithClause withClause, ImplementsClause implementsClause, this.leftBracket,
|
| + List<ClassMember> members, this.rightBracket)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| _typeParameters = becomeParentOf(typeParameters);
|
| _extendsClause = becomeParentOf(extendsClause);
|
| @@ -3900,32 +4252,8 @@ class ClassDeclaration extends CompilationUnitMember {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitClassDeclaration(this);
|
| -
|
| - /**
|
| - * Return the constructor declared in the class with the given name.
|
| - *
|
| - * @param name the name of the constructor to find, `null` for default
|
| - * @return the found constructor or `null` if not found
|
| - */
|
| - ConstructorDeclaration getConstructor(String name) {
|
| - for (ClassMember classMember in _members) {
|
| - if (classMember is ConstructorDeclaration) {
|
| - ConstructorDeclaration constructor = classMember;
|
| - SimpleIdentifier constructorName = constructor.name;
|
| - if (name == null && constructorName == null) {
|
| - return constructor;
|
| - }
|
| - if (constructorName != null && constructorName.name == name) {
|
| - return constructor;
|
| - }
|
| - }
|
| - }
|
| - return null;
|
| - }
|
| -
|
| - @override
|
| - ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
|
| + ClassElement get element =>
|
| + _name != null ? (_name.staticElement as ClassElement) : null;
|
|
|
| @override
|
| Token get endToken => rightBracket;
|
| @@ -3939,25 +4267,20 @@ class ClassDeclaration extends CompilationUnitMember {
|
| ExtendsClause get extendsClause => _extendsClause;
|
|
|
| /**
|
| - * Return the field declared in the class with the given name.
|
| + * Set the extends clause for this class to the given clause.
|
| *
|
| - * @param name the name of the field to find
|
| - * @return the found field or `null` if not found
|
| + * @param extendsClause the extends clause for this class
|
| */
|
| - VariableDeclaration getField(String name) {
|
| - for (ClassMember classMember in _members) {
|
| - if (classMember is FieldDeclaration) {
|
| - FieldDeclaration fieldDeclaration = classMember;
|
| - NodeList<VariableDeclaration> fields = fieldDeclaration.fields.variables;
|
| - for (VariableDeclaration field in fields) {
|
| - SimpleIdentifier fieldName = field.name;
|
| - if (fieldName != null && name == fieldName.name) {
|
| - return field;
|
| - }
|
| - }
|
| - }
|
| + void set extendsClause(ExtendsClause extendsClause) {
|
| + _extendsClause = becomeParentOf(extendsClause);
|
| + }
|
| +
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + if (abstractKeyword != null) {
|
| + return abstractKeyword;
|
| }
|
| - return null;
|
| + return classKeyword;
|
| }
|
|
|
| /**
|
| @@ -3969,30 +4292,27 @@ class ClassDeclaration extends CompilationUnitMember {
|
| ImplementsClause get implementsClause => _implementsClause;
|
|
|
| /**
|
| - * Return the members defined by the class.
|
| + * Set the implements clause for the class to the given clause.
|
| *
|
| - * @return the members defined by the class
|
| + * @param implementsClause the implements clause for the class
|
| */
|
| - NodeList<ClassMember> get members => _members;
|
| + void set implementsClause(ImplementsClause implementsClause) {
|
| + _implementsClause = becomeParentOf(implementsClause);
|
| + }
|
|
|
| /**
|
| - * Return the method declared in the class with the given name.
|
| + * Return `true` if this class is declared to be an abstract class.
|
| *
|
| - * @param name the name of the method to find
|
| - * @return the found method or `null` if not found
|
| + * @return `true` if this class is declared to be an abstract class
|
| */
|
| - MethodDeclaration getMethod(String name) {
|
| - for (ClassMember classMember in _members) {
|
| - if (classMember is MethodDeclaration) {
|
| - MethodDeclaration method = classMember;
|
| - SimpleIdentifier methodName = method.name;
|
| - if (methodName != null && name == methodName.name) {
|
| - return method;
|
| - }
|
| - }
|
| - }
|
| - return null;
|
| - }
|
| + bool get isAbstract => abstractKeyword != null;
|
| +
|
| + /**
|
| + * Return the members defined by the class.
|
| + *
|
| + * @return the members defined by the class
|
| + */
|
| + NodeList<ClassMember> get members => _members;
|
|
|
| /**
|
| * Return the name of the class being declared.
|
| @@ -4002,6 +4322,15 @@ class ClassDeclaration extends CompilationUnitMember {
|
| SimpleIdentifier get name => _name;
|
|
|
| /**
|
| + * Set the name of the class being declared to the given identifier.
|
| + *
|
| + * @param identifier the name of the class being declared
|
| + */
|
| + void set name(SimpleIdentifier identifier) {
|
| + _name = becomeParentOf(identifier);
|
| + }
|
| +
|
| + /**
|
| * Return the native clause for this class, or `null` if the class does not have a native
|
| * cluse.
|
| *
|
| @@ -4010,6 +4339,15 @@ class ClassDeclaration extends CompilationUnitMember {
|
| NativeClause get nativeClause => _nativeClause;
|
|
|
| /**
|
| + * Set the native clause for this class to the given clause.
|
| + *
|
| + * @param nativeClause the native clause for this class
|
| + */
|
| + void set nativeClause(NativeClause nativeClause) {
|
| + _nativeClause = becomeParentOf(nativeClause);
|
| + }
|
| +
|
| + /**
|
| * Return the type parameters for the class, or `null` if the class does not have any type
|
| * parameters.
|
| *
|
| @@ -4018,71 +4356,95 @@ class ClassDeclaration extends CompilationUnitMember {
|
| TypeParameterList get typeParameters => _typeParameters;
|
|
|
| /**
|
| - * Return the with clause for the class, or `null` if the class does not have a with clause.
|
| + * Set the type parameters for the class to the given list of type parameters.
|
| *
|
| - * @return the with clause for the class
|
| + * @param typeParameters the type parameters for the class
|
| */
|
| - WithClause get withClause => _withClause;
|
| -
|
| - /**
|
| - * Return `true` if this class is declared to be an abstract class.
|
| - *
|
| - * @return `true` if this class is declared to be an abstract class
|
| - */
|
| - bool get isAbstract => abstractKeyword != null;
|
| -
|
| - /**
|
| - * Set the extends clause for this class to the given clause.
|
| - *
|
| - * @param extendsClause the extends clause for this class
|
| - */
|
| - void set extendsClause(ExtendsClause extendsClause) {
|
| - _extendsClause = becomeParentOf(extendsClause);
|
| + void set typeParameters(TypeParameterList typeParameters) {
|
| + _typeParameters = becomeParentOf(typeParameters);
|
| }
|
|
|
| /**
|
| - * Set the implements clause for the class to the given clause.
|
| + * Return the with clause for the class, or `null` if the class does not have a with clause.
|
| *
|
| - * @param implementsClause the implements clause for the class
|
| + * @return the with clause for the class
|
| */
|
| - void set implementsClause(ImplementsClause implementsClause) {
|
| - _implementsClause = becomeParentOf(implementsClause);
|
| - }
|
| + WithClause get withClause => _withClause;
|
|
|
| /**
|
| - * Set the name of the class being declared to the given identifier.
|
| + * Set the with clause for the class to the given clause.
|
| *
|
| - * @param identifier the name of the class being declared
|
| + * @param withClause the with clause for the class
|
| */
|
| - void set name(SimpleIdentifier identifier) {
|
| - _name = becomeParentOf(identifier);
|
| + void set withClause(WithClause withClause) {
|
| + _withClause = becomeParentOf(withClause);
|
| }
|
|
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitClassDeclaration(this);
|
| +
|
| /**
|
| - * Set the native clause for this class to the given clause.
|
| + * Return the constructor declared in the class with the given name.
|
| *
|
| - * @param nativeClause the native clause for this class
|
| + * @param name the name of the constructor to find, `null` for default
|
| + * @return the found constructor or `null` if not found
|
| */
|
| - void set nativeClause(NativeClause nativeClause) {
|
| - _nativeClause = becomeParentOf(nativeClause);
|
| + ConstructorDeclaration getConstructor(String name) {
|
| + for (ClassMember classMember in _members) {
|
| + if (classMember is ConstructorDeclaration) {
|
| + ConstructorDeclaration constructor = classMember;
|
| + SimpleIdentifier constructorName = constructor.name;
|
| + if (name == null && constructorName == null) {
|
| + return constructor;
|
| + }
|
| + if (constructorName != null && constructorName.name == name) {
|
| + return constructor;
|
| + }
|
| + }
|
| + }
|
| + return null;
|
| }
|
|
|
| /**
|
| - * Set the type parameters for the class to the given list of type parameters.
|
| + * Return the field declared in the class with the given name.
|
| *
|
| - * @param typeParameters the type parameters for the class
|
| + * @param name the name of the field to find
|
| + * @return the found field or `null` if not found
|
| */
|
| - void set typeParameters(TypeParameterList typeParameters) {
|
| - _typeParameters = becomeParentOf(typeParameters);
|
| + VariableDeclaration getField(String name) {
|
| + for (ClassMember classMember in _members) {
|
| + if (classMember is FieldDeclaration) {
|
| + FieldDeclaration fieldDeclaration = classMember;
|
| + NodeList<VariableDeclaration> fields =
|
| + fieldDeclaration.fields.variables;
|
| + for (VariableDeclaration field in fields) {
|
| + SimpleIdentifier fieldName = field.name;
|
| + if (fieldName != null && name == fieldName.name) {
|
| + return field;
|
| + }
|
| + }
|
| + }
|
| + }
|
| + return null;
|
| }
|
|
|
| /**
|
| - * Set the with clause for the class to the given clause.
|
| + * Return the method declared in the class with the given name.
|
| *
|
| - * @param withClause the with clause for the class
|
| + * @param name the name of the method to find
|
| + * @return the found method or `null` if not found
|
| */
|
| - void set withClause(WithClause withClause) {
|
| - _withClause = becomeParentOf(withClause);
|
| + MethodDeclaration getMethod(String name) {
|
| + for (ClassMember classMember in _members) {
|
| + if (classMember is MethodDeclaration) {
|
| + MethodDeclaration method = classMember;
|
| + SimpleIdentifier methodName = method.name;
|
| + if (methodName != null && name == methodName.name) {
|
| + return method;
|
| + }
|
| + }
|
| + }
|
| + return null;
|
| }
|
|
|
| @override
|
| @@ -4096,14 +4458,6 @@ class ClassDeclaration extends CompilationUnitMember {
|
| safelyVisitChild(_nativeClause, visitor);
|
| members.accept(visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - if (abstractKeyword != null) {
|
| - return abstractKeyword;
|
| - }
|
| - return classKeyword;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -4117,7 +4471,8 @@ abstract class ClassMember extends Declaration {
|
| * @param comment the documentation comment associated with this member
|
| * @param metadata the annotations associated with this member
|
| */
|
| - ClassMember(Comment comment, List<Annotation> metadata) : super(comment, metadata);
|
| + ClassMember(Comment comment, List<Annotation> metadata)
|
| + : super(comment, metadata);
|
| }
|
|
|
| /**
|
| @@ -4184,7 +4539,11 @@ class ClassTypeAlias extends TypeAlias {
|
| * @param implementsClause the implements clause for this class
|
| * @param semicolon the semicolon terminating the declaration
|
| */
|
| - ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, SimpleIdentifier name, TypeParameterList typeParameters, this.equals, this.abstractKeyword, TypeName superclass, WithClause withClause, ImplementsClause implementsClause, Token semicolon) : super(comment, metadata, keyword, semicolon) {
|
| + ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
|
| + SimpleIdentifier name, TypeParameterList typeParameters, this.equals,
|
| + this.abstractKeyword, TypeName superclass, WithClause withClause,
|
| + ImplementsClause implementsClause, Token semicolon)
|
| + : super(comment, metadata, keyword, semicolon) {
|
| _name = becomeParentOf(name);
|
| _typeParameters = becomeParentOf(typeParameters);
|
| _superclass = becomeParentOf(superclass);
|
| @@ -4193,10 +4552,8 @@ class ClassTypeAlias extends TypeAlias {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this);
|
| -
|
| - @override
|
| - ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
|
| + ClassElement get element =>
|
| + _name != null ? (_name.staticElement as ClassElement) : null;
|
|
|
| /**
|
| * Return the implements clause for this class, or `null` if there is no implements clause.
|
| @@ -4206,33 +4563,13 @@ class ClassTypeAlias extends TypeAlias {
|
| ImplementsClause get implementsClause => _implementsClause;
|
|
|
| /**
|
| - * Return the name of the class being declared.
|
| - *
|
| - * @return the name of the class being declared
|
| - */
|
| - SimpleIdentifier get name => _name;
|
| -
|
| - /**
|
| - * Return the name of the superclass of the class being declared.
|
| - *
|
| - * @return the name of the superclass of the class being declared
|
| - */
|
| - TypeName get superclass => _superclass;
|
| -
|
| - /**
|
| - * Return the type parameters for the class, or `null` if the class does not have any type
|
| - * parameters.
|
| - *
|
| - * @return the type parameters for the class
|
| - */
|
| - TypeParameterList get typeParameters => _typeParameters;
|
| -
|
| - /**
|
| - * Return the with clause for this class.
|
| + * Set the implements clause for this class to the given implements clause.
|
| *
|
| - * @return the with clause for this class
|
| + * @param implementsClause the implements clause for this class
|
| */
|
| - WithClause get withClause => _withClause;
|
| + void set implementsClause(ImplementsClause implementsClause) {
|
| + _implementsClause = becomeParentOf(implementsClause);
|
| + }
|
|
|
| /**
|
| * Return `true` if this class is declared to be an abstract class.
|
| @@ -4242,13 +4579,11 @@ class ClassTypeAlias extends TypeAlias {
|
| bool get isAbstract => abstractKeyword != null;
|
|
|
| /**
|
| - * Set the implements clause for this class to the given implements clause.
|
| + * Return the name of the class being declared.
|
| *
|
| - * @param implementsClause the implements clause for this class
|
| + * @return the name of the class being declared
|
| */
|
| - void set implementsClause(ImplementsClause implementsClause) {
|
| - _implementsClause = becomeParentOf(implementsClause);
|
| - }
|
| + SimpleIdentifier get name => _name;
|
|
|
| /**
|
| * Set the name of the class being declared to the given identifier.
|
| @@ -4260,6 +4595,13 @@ class ClassTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the name of the superclass of the class being declared.
|
| + *
|
| + * @return the name of the superclass of the class being declared
|
| + */
|
| + TypeName get superclass => _superclass;
|
| +
|
| + /**
|
| * Set the name of the superclass of the class being declared to the given name.
|
| *
|
| * @param superclass the name of the superclass of the class being declared
|
| @@ -4269,6 +4611,14 @@ class ClassTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the type parameters for the class, or `null` if the class does not have any type
|
| + * parameters.
|
| + *
|
| + * @return the type parameters for the class
|
| + */
|
| + TypeParameterList get typeParameters => _typeParameters;
|
| +
|
| + /**
|
| * Set the type parameters for the class to the given list of parameters.
|
| *
|
| * @param typeParameters the type parameters for the class
|
| @@ -4278,6 +4628,13 @@ class ClassTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the with clause for this class.
|
| + *
|
| + * @return the with clause for this class
|
| + */
|
| + WithClause get withClause => _withClause;
|
| +
|
| + /**
|
| * Set the with clause for this class to the given with clause.
|
| *
|
| * @param withClause the with clause for this class
|
| @@ -4287,6 +4644,9 @@ class ClassTypeAlias extends TypeAlias {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitClassTypeAlias(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_name, visitor);
|
| @@ -4347,39 +4707,6 @@ abstract class Combinator extends AstNode {
|
| */
|
| class Comment extends AstNode {
|
| /**
|
| - * Create a block comment.
|
| - *
|
| - * @param tokens the tokens representing the comment
|
| - * @return the block comment that was created
|
| - */
|
| - static Comment createBlockComment(List<Token> tokens) => new Comment(tokens, CommentType.BLOCK, null);
|
| -
|
| - /**
|
| - * Create a documentation comment.
|
| - *
|
| - * @param tokens the tokens representing the comment
|
| - * @return the documentation comment that was created
|
| - */
|
| - static Comment createDocumentationComment(List<Token> tokens) => new Comment(tokens, CommentType.DOCUMENTATION, new List<CommentReference>());
|
| -
|
| - /**
|
| - * Create a documentation comment.
|
| - *
|
| - * @param tokens the tokens representing the comment
|
| - * @param references the references embedded within the documentation comment
|
| - * @return the documentation comment that was created
|
| - */
|
| - static Comment createDocumentationCommentWithReferences(List<Token> tokens, List<CommentReference> references) => new Comment(tokens, CommentType.DOCUMENTATION, references);
|
| -
|
| - /**
|
| - * Create an end-of-line comment.
|
| - *
|
| - * @param tokens the tokens representing the comment
|
| - * @return the end-of-line comment that was created
|
| - */
|
| - static Comment createEndOfLineComment(List<Token> tokens) => new Comment(tokens, CommentType.END_OF_LINE, null);
|
| -
|
| - /**
|
| * The tokens representing the comment.
|
| */
|
| final List<Token> tokens;
|
| @@ -4407,22 +4734,12 @@ class Comment extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitComment(this);
|
| -
|
| - @override
|
| Token get beginToken => tokens[0];
|
|
|
| @override
|
| Token get endToken => tokens[tokens.length - 1];
|
|
|
| /**
|
| - * Return the references embedded within the documentation comment.
|
| - *
|
| - * @return the references embedded within the documentation comment
|
| - */
|
| - NodeList<CommentReference> get references => _references;
|
| -
|
| - /**
|
| * Return `true` if this is a block comment.
|
| *
|
| * @return `true` if this is a block comment
|
| @@ -4443,10 +4760,58 @@ class Comment extends AstNode {
|
| */
|
| bool get isEndOfLine => _type == CommentType.END_OF_LINE;
|
|
|
| + /**
|
| + * Return the references embedded within the documentation comment.
|
| + *
|
| + * @return the references embedded within the documentation comment
|
| + */
|
| + NodeList<CommentReference> get references => _references;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitComment(this);
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| _references.accept(visitor);
|
| }
|
| +
|
| + /**
|
| + * Create a block comment.
|
| + *
|
| + * @param tokens the tokens representing the comment
|
| + * @return the block comment that was created
|
| + */
|
| + static Comment createBlockComment(List<Token> tokens) =>
|
| + new Comment(tokens, CommentType.BLOCK, null);
|
| +
|
| + /**
|
| + * Create a documentation comment.
|
| + *
|
| + * @param tokens the tokens representing the comment
|
| + * @return the documentation comment that was created
|
| + */
|
| + static Comment createDocumentationComment(List<Token> tokens) =>
|
| + new Comment(tokens, CommentType.DOCUMENTATION, new List<CommentReference>());
|
| +
|
| + /**
|
| + * Create a documentation comment.
|
| + *
|
| + * @param tokens the tokens representing the comment
|
| + * @param references the references embedded within the documentation comment
|
| + * @return the documentation comment that was created
|
| + */
|
| + static Comment createDocumentationCommentWithReferences(List<Token> tokens,
|
| + List<CommentReference> references) =>
|
| + new Comment(tokens, CommentType.DOCUMENTATION, references);
|
| +
|
| + /**
|
| + * Create an end-of-line comment.
|
| + *
|
| + * @param tokens the tokens representing the comment
|
| + * @return the end-of-line comment that was created
|
| + */
|
| + static Comment createEndOfLineComment(List<Token> tokens) =>
|
| + new Comment(tokens, CommentType.END_OF_LINE, null);
|
| }
|
|
|
| /**
|
| @@ -4480,9 +4845,6 @@ class CommentReference extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitCommentReference(this);
|
| -
|
| - @override
|
| Token get beginToken => _identifier.beginToken;
|
|
|
| @override
|
| @@ -4505,6 +4867,9 @@ class CommentReference extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitCommentReference(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_identifier, visitor);
|
| }
|
| @@ -4516,14 +4881,9 @@ class CommentReference extends AstNode {
|
| */
|
| class CommentType {
|
| /**
|
| - * The name of the comment type.
|
| + * A block comment.
|
| */
|
| - final String name;
|
| -
|
| - /**
|
| - * A block comment.
|
| - */
|
| - static const CommentType BLOCK = const CommentType('BLOCK');
|
| + static const CommentType BLOCK = const CommentType('BLOCK');
|
|
|
| /**
|
| * A documentation comment.
|
| @@ -4536,6 +4896,11 @@ class CommentType {
|
| static const CommentType END_OF_LINE = const CommentType('END_OF_LINE');
|
|
|
| /**
|
| + * The name of the comment type.
|
| + */
|
| + final String name;
|
| +
|
| + /**
|
| * Initialize a newly created comment type to have the given [name].
|
| */
|
| const CommentType(this.name);
|
| @@ -4616,15 +4981,14 @@ class CompilationUnit extends AstNode {
|
| * @param declarations the declarations contained in this compilation unit
|
| * @param endToken the last token in the token stream
|
| */
|
| - CompilationUnit(this.beginToken, ScriptTag scriptTag, List<Directive> directives, List<CompilationUnitMember> declarations, this.endToken) {
|
| + CompilationUnit(this.beginToken, ScriptTag scriptTag,
|
| + List<Directive> directives, List<CompilationUnitMember> declarations,
|
| + this.endToken) {
|
| _scriptTag = becomeParentOf(scriptTag);
|
| _directives = new NodeList<Directive>(this, directives);
|
| _declarations = new NodeList<CompilationUnitMember>(this, declarations);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitCompilationUnit(this);
|
| -
|
| /**
|
| * Return the declarations contained in this compilation unit.
|
| *
|
| @@ -4668,6 +5032,23 @@ class CompilationUnit extends AstNode {
|
| _scriptTag = becomeParentOf(scriptTag);
|
| }
|
|
|
| + /**
|
| + * Return an array containing all of the directives and declarations in this compilation unit,
|
| + * sorted in lexical order.
|
| + *
|
| + * @return the directives and declarations in this compilation unit in the order in which they
|
| + * appeared in the original source
|
| + */
|
| + List<AstNode> get sortedDirectivesAndDeclarations {
|
| + return <AstNode>[]
|
| + ..addAll(_directives)
|
| + ..addAll(_declarations)
|
| + ..sort(AstNode.LEXICAL_ORDER);
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitCompilationUnit(this);
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_scriptTag, visitor);
|
| @@ -4694,20 +5075,6 @@ class CompilationUnit extends AstNode {
|
| CompilationUnitMember firstDeclaration = _declarations[0];
|
| return lastDirective.offset < firstDeclaration.offset;
|
| }
|
| -
|
| - /**
|
| - * Return an array containing all of the directives and declarations in this compilation unit,
|
| - * sorted in lexical order.
|
| - *
|
| - * @return the directives and declarations in this compilation unit in the order in which they
|
| - * appeared in the original source
|
| - */
|
| - List<AstNode> get sortedDirectivesAndDeclarations {
|
| - return <AstNode>[]
|
| - ..addAll(_directives)
|
| - ..addAll(_declarations)
|
| - ..sort(AstNode.LEXICAL_ORDER);
|
| - }
|
| }
|
|
|
| /**
|
| @@ -4731,7 +5098,8 @@ abstract class CompilationUnitMember extends Declaration {
|
| * @param comment the documentation comment associated with this member
|
| * @param metadata the annotations associated with this member
|
| */
|
| - CompilationUnitMember(Comment comment, List<Annotation> metadata) : super(comment, metadata);
|
| + CompilationUnitMember(Comment comment, List<Annotation> metadata)
|
| + : super(comment, metadata);
|
| }
|
|
|
| /**
|
| @@ -4779,16 +5147,14 @@ class ConditionalExpression extends Expression {
|
| * @param elseExpression the expression that is executed if the condition evaluates to
|
| * `false`
|
| */
|
| - ConditionalExpression(Expression condition, this.question, Expression thenExpression, this.colon, Expression elseExpression) {
|
| + ConditionalExpression(Expression condition, this.question,
|
| + Expression thenExpression, this.colon, Expression elseExpression) {
|
| _condition = becomeParentOf(condition);
|
| _thenExpression = becomeParentOf(thenExpression);
|
| _elseExpression = becomeParentOf(elseExpression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _condition.beginToken;
|
|
|
| /**
|
| @@ -4799,26 +5165,6 @@ class ConditionalExpression extends Expression {
|
| Expression get condition => _condition;
|
|
|
| /**
|
| - * Return the expression that is executed if the condition evaluates to `false`.
|
| - *
|
| - * @return the expression that is executed if the condition evaluates to `false`
|
| - */
|
| - Expression get elseExpression => _elseExpression;
|
| -
|
| - @override
|
| - Token get endToken => _elseExpression.endToken;
|
| -
|
| - @override
|
| - int get precedence => 3;
|
| -
|
| - /**
|
| - * Return the expression that is executed if the condition evaluates to `true`.
|
| - *
|
| - * @return the expression that is executed if the condition evaluates to `true`
|
| - */
|
| - Expression get thenExpression => _thenExpression;
|
| -
|
| - /**
|
| * Set the condition used to determine which of the expressions is executed next to the given
|
| * expression.
|
| *
|
| @@ -4829,6 +5175,13 @@ class ConditionalExpression extends Expression {
|
| }
|
|
|
| /**
|
| + * Return the expression that is executed if the condition evaluates to `false`.
|
| + *
|
| + * @return the expression that is executed if the condition evaluates to `false`
|
| + */
|
| + Expression get elseExpression => _elseExpression;
|
| +
|
| + /**
|
| * Set the expression that is executed if the condition evaluates to `false` to the given
|
| * expression.
|
| *
|
| @@ -4838,6 +5191,19 @@ class ConditionalExpression extends Expression {
|
| _elseExpression = becomeParentOf(expression);
|
| }
|
|
|
| + @override
|
| + Token get endToken => _elseExpression.endToken;
|
| +
|
| + @override
|
| + int get precedence => 3;
|
| +
|
| + /**
|
| + * Return the expression that is executed if the condition evaluates to `true`.
|
| + *
|
| + * @return the expression that is executed if the condition evaluates to `true`
|
| + */
|
| + Expression get thenExpression => _thenExpression;
|
| +
|
| /**
|
| * Set the expression that is executed if the condition evaluates to `true` to the given
|
| * expression.
|
| @@ -4849,6 +5215,9 @@ class ConditionalExpression extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_condition, visitor);
|
| safelyVisitChild(_thenExpression, visitor);
|
| @@ -5079,7 +5448,11 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
|
| @override
|
| Object visitInterpolationExpression(InterpolationExpression node) {
|
| Object value = node.expression.accept(this);
|
| - if (value == null || value is bool || value is String || value is int || value is double) {
|
| + if (value == null ||
|
| + value is bool ||
|
| + value is String ||
|
| + value is int ||
|
| + value is double) {
|
| return value;
|
| }
|
| return NOT_A_CONSTANT;
|
| @@ -5125,10 +5498,12 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
|
| Object visitNullLiteral(NullLiteral node) => null;
|
|
|
| @override
|
| - Object visitParenthesizedExpression(ParenthesizedExpression node) => node.expression.accept(this);
|
| + Object visitParenthesizedExpression(ParenthesizedExpression node) =>
|
| + node.expression.accept(this);
|
|
|
| @override
|
| - Object visitPrefixedIdentifier(PrefixedIdentifier node) => _getConstantValue(null);
|
| + Object visitPrefixedIdentifier(PrefixedIdentifier node) =>
|
| + _getConstantValue(null);
|
|
|
| @override
|
| Object visitPrefixExpression(PrefixExpression node) {
|
| @@ -5166,7 +5541,8 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
|
| Object visitPropertyAccess(PropertyAccess node) => _getConstantValue(null);
|
|
|
| @override
|
| - Object visitSimpleIdentifier(SimpleIdentifier node) => _getConstantValue(null);
|
| + Object visitSimpleIdentifier(SimpleIdentifier node) =>
|
| + _getConstantValue(null);
|
|
|
| @override
|
| Object visitSimpleStringLiteral(SimpleStringLiteral node) => node.value;
|
| @@ -5329,7 +5705,13 @@ class ConstructorDeclaration extends ClassMember {
|
| * redirected
|
| * @param body the body of the constructor
|
| */
|
| - ConstructorDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, this.constKeyword, this.factoryKeyword, Identifier returnType, this.period, SimpleIdentifier name, FormalParameterList parameters, this.separator, List<ConstructorInitializer> initializers, ConstructorName redirectedConstructor, FunctionBody body) : super(comment, metadata) {
|
| + ConstructorDeclaration(Comment comment, List<Annotation> metadata,
|
| + this.externalKeyword, this.constKeyword, this.factoryKeyword,
|
| + Identifier returnType, this.period, SimpleIdentifier name,
|
| + FormalParameterList parameters, this.separator,
|
| + List<ConstructorInitializer> initializers,
|
| + ConstructorName redirectedConstructor, FunctionBody body)
|
| + : super(comment, metadata) {
|
| _returnType = becomeParentOf(returnType);
|
| _name = becomeParentOf(name);
|
| _parameters = becomeParentOf(parameters);
|
| @@ -5338,9 +5720,6 @@ class ConstructorDeclaration extends ClassMember {
|
| _body = becomeParentOf(body);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this);
|
| -
|
| /**
|
| * Return the body of the constructor, or `null` if the constructor does not have a body.
|
| *
|
| @@ -5348,6 +5727,15 @@ class ConstructorDeclaration extends ClassMember {
|
| */
|
| FunctionBody get body => _body;
|
|
|
| + /**
|
| + * Set the body of the constructor to the given function body.
|
| + *
|
| + * @param functionBody the body of the constructor
|
| + */
|
| + void set body(FunctionBody functionBody) {
|
| + _body = becomeParentOf(functionBody);
|
| + }
|
| +
|
| @override
|
| Token get endToken {
|
| if (_body != null) {
|
| @@ -5358,6 +5746,16 @@ class ConstructorDeclaration extends ClassMember {
|
| return _parameters.endToken;
|
| }
|
|
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + Token leftMost =
|
| + Token.lexicallyFirst([externalKeyword, constKeyword, factoryKeyword]);
|
| + if (leftMost != null) {
|
| + return leftMost;
|
| + }
|
| + return _returnType.beginToken;
|
| + }
|
| +
|
| /**
|
| * Return the initializers associated with the constructor.
|
| *
|
| @@ -5374,39 +5772,6 @@ class ConstructorDeclaration extends ClassMember {
|
| SimpleIdentifier get name => _name;
|
|
|
| /**
|
| - * Return the parameters associated with the constructor.
|
| - *
|
| - * @return the parameters associated with the constructor
|
| - */
|
| - FormalParameterList get parameters => _parameters;
|
| -
|
| - /**
|
| - * Return the name of the constructor to which this constructor will be redirected, or
|
| - * `null` if this is not a redirecting factory constructor.
|
| - *
|
| - * @return the name of the constructor to which this constructor will be redirected
|
| - */
|
| - ConstructorName get redirectedConstructor => _redirectedConstructor;
|
| -
|
| - /**
|
| - * Return the type of object being created. This can be different than the type in which the
|
| - * constructor is being declared if the constructor is the implementation of a factory
|
| - * constructor.
|
| - *
|
| - * @return the type of object being created
|
| - */
|
| - Identifier get returnType => _returnType;
|
| -
|
| - /**
|
| - * Set the body of the constructor to the given function body.
|
| - *
|
| - * @param functionBody the body of the constructor
|
| - */
|
| - void set body(FunctionBody functionBody) {
|
| - _body = becomeParentOf(functionBody);
|
| - }
|
| -
|
| - /**
|
| * Set the name of the constructor to the given identifier.
|
| *
|
| * @param identifier the name of the constructor
|
| @@ -5416,6 +5781,13 @@ class ConstructorDeclaration extends ClassMember {
|
| }
|
|
|
| /**
|
| + * Return the parameters associated with the constructor.
|
| + *
|
| + * @return the parameters associated with the constructor
|
| + */
|
| + FormalParameterList get parameters => _parameters;
|
| +
|
| + /**
|
| * Set the parameters associated with the constructor to the given list of parameters.
|
| *
|
| * @param parameters the parameters associated with the constructor
|
| @@ -5425,6 +5797,14 @@ class ConstructorDeclaration extends ClassMember {
|
| }
|
|
|
| /**
|
| + * Return the name of the constructor to which this constructor will be redirected, or
|
| + * `null` if this is not a redirecting factory constructor.
|
| + *
|
| + * @return the name of the constructor to which this constructor will be redirected
|
| + */
|
| + ConstructorName get redirectedConstructor => _redirectedConstructor;
|
| +
|
| + /**
|
| * Set the name of the constructor to which this constructor will be redirected to the given
|
| * constructor name.
|
| *
|
| @@ -5436,6 +5816,15 @@ class ConstructorDeclaration extends ClassMember {
|
| }
|
|
|
| /**
|
| + * Return the type of object being created. This can be different than the type in which the
|
| + * constructor is being declared if the constructor is the implementation of a factory
|
| + * constructor.
|
| + *
|
| + * @return the type of object being created
|
| + */
|
| + Identifier get returnType => _returnType;
|
| +
|
| + /**
|
| * Set the type of object being created to the given type name.
|
| *
|
| * @param typeName the type of object being created
|
| @@ -5445,6 +5834,9 @@ class ConstructorDeclaration extends ClassMember {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitConstructorDeclaration(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_returnType, visitor);
|
| @@ -5454,15 +5846,6 @@ class ConstructorDeclaration extends ClassMember {
|
| safelyVisitChild(_redirectedConstructor, visitor);
|
| safelyVisitChild(_body, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - Token leftMost = Token.lexicallyFirst([externalKeyword, constKeyword, factoryKeyword]);
|
| - if (leftMost != null) {
|
| - return leftMost;
|
| - }
|
| - return _returnType.beginToken;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -5511,15 +5894,13 @@ class ConstructorFieldInitializer extends ConstructorInitializer {
|
| * @param equals the token for the equal sign between the field name and the expression
|
| * @param expression the expression computing the value to which the field will be initialized
|
| */
|
| - ConstructorFieldInitializer(this.keyword, this.period, SimpleIdentifier fieldName, this.equals, Expression expression) {
|
| + ConstructorFieldInitializer(this.keyword, this.period,
|
| + SimpleIdentifier fieldName, this.equals, Expression expression) {
|
| _fieldName = becomeParentOf(fieldName);
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (keyword != null) {
|
| return keyword;
|
| @@ -5538,13 +5919,6 @@ class ConstructorFieldInitializer extends ConstructorInitializer {
|
| Expression get expression => _expression;
|
|
|
| /**
|
| - * Return the name of the field being initialized.
|
| - *
|
| - * @return the name of the field being initialized
|
| - */
|
| - SimpleIdentifier get fieldName => _fieldName;
|
| -
|
| - /**
|
| * Set the expression computing the value to which the field will be initialized to the given
|
| * expression.
|
| *
|
| @@ -5555,6 +5929,13 @@ class ConstructorFieldInitializer extends ConstructorInitializer {
|
| }
|
|
|
| /**
|
| + * Return the name of the field being initialized.
|
| + *
|
| + * @return the name of the field being initialized
|
| + */
|
| + SimpleIdentifier get fieldName => _fieldName;
|
| +
|
| + /**
|
| * Set the name of the field being initialized to the given identifier.
|
| *
|
| * @param identifier the name of the field being initialized
|
| @@ -5564,6 +5945,9 @@ class ConstructorFieldInitializer extends ConstructorInitializer {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitConstructorFieldInitializer(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_fieldName, visitor);
|
| safelyVisitChild(_expression, visitor);
|
| @@ -5629,9 +6013,6 @@ class ConstructorName extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitConstructorName(this);
|
| -
|
| - @override
|
| Token get beginToken => _type.beginToken;
|
|
|
| @override
|
| @@ -5651,13 +6032,6 @@ class ConstructorName extends AstNode {
|
| SimpleIdentifier get name => _name;
|
|
|
| /**
|
| - * Return the name of the type defining the constructor.
|
| - *
|
| - * @return the name of the type defining the constructor
|
| - */
|
| - TypeName get type => _type;
|
| -
|
| - /**
|
| * Set the name of the constructor to the given name.
|
| *
|
| * @param name the name of the constructor
|
| @@ -5667,6 +6041,13 @@ class ConstructorName extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the name of the type defining the constructor.
|
| + *
|
| + * @return the name of the type defining the constructor
|
| + */
|
| + TypeName get type => _type;
|
| +
|
| + /**
|
| * Set the name of the type defining the constructor to the given type name.
|
| *
|
| * @param type the name of the type defining the constructor
|
| @@ -5676,6 +6057,9 @@ class ConstructorName extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitConstructorName(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_type, visitor);
|
| safelyVisitChild(_name, visitor);
|
| @@ -5718,9 +6102,6 @@ class ContinueStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitContinueStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -5743,6 +6124,9 @@ class ContinueStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitContinueStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_label, visitor);
|
| }
|
| @@ -5759,7 +6143,8 @@ abstract class Declaration extends AnnotatedNode {
|
| * @param comment the documentation comment associated with this declaration
|
| * @param metadata the annotations associated with this declaration
|
| */
|
| - Declaration(Comment comment, List<Annotation> metadata) : super(comment, metadata);
|
| + Declaration(Comment comment, List<Annotation> metadata)
|
| + : super(comment, metadata);
|
|
|
| /**
|
| * Return the element associated with this declaration, or `null` if either this node
|
| @@ -5806,15 +6191,14 @@ class DeclaredIdentifier extends Declaration {
|
| * @param type the name of the declared type of the parameter
|
| * @param identifier the name of the parameter being declared
|
| */
|
| - DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, SimpleIdentifier identifier) : super(comment, metadata) {
|
| + DeclaredIdentifier(Comment comment, List<Annotation> metadata, this.keyword,
|
| + TypeName type, SimpleIdentifier identifier)
|
| + : super(comment, metadata) {
|
| _type = becomeParentOf(type);
|
| _identifier = becomeParentOf(identifier);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this);
|
| -
|
| - @override
|
| LocalVariableElement get element {
|
| if (_identifier == null) {
|
| return null;
|
| @@ -5825,6 +6209,16 @@ class DeclaredIdentifier extends Declaration {
|
| @override
|
| Token get endToken => _identifier.endToken;
|
|
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + if (keyword != null) {
|
| + return keyword;
|
| + } else if (_type != null) {
|
| + return _type.beginToken;
|
| + }
|
| + return _identifier.beginToken;
|
| + }
|
| +
|
| /**
|
| * Return the name of the variable being declared.
|
| *
|
| @@ -5833,19 +6227,21 @@ class DeclaredIdentifier extends Declaration {
|
| SimpleIdentifier get identifier => _identifier;
|
|
|
| /**
|
| - * Return the name of the declared type of the parameter, or `null` if the parameter does
|
| - * not have a declared type.
|
| + * Set the name of the variable being declared to the given name.
|
| *
|
| - * @return the name of the declared type of the parameter
|
| + * @param identifier the new name of the variable being declared
|
| */
|
| - TypeName get type => _type;
|
| + void set identifier(SimpleIdentifier identifier) {
|
| + _identifier = becomeParentOf(identifier);
|
| + }
|
|
|
| /**
|
| * Return `true` if this variable was declared with the 'const' modifier.
|
| *
|
| * @return `true` if this variable was declared with the 'const' modifier
|
| */
|
| - bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| + bool get isConst =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
|
|
| /**
|
| * Return `true` if this variable was declared with the 'final' modifier. Variables that are
|
| @@ -5854,16 +6250,16 @@ class DeclaredIdentifier extends Declaration {
|
| *
|
| * @return `true` if this variable was declared with the 'final' modifier
|
| */
|
| - bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| + bool get isFinal =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
|
|
| /**
|
| - * Set the name of the variable being declared to the given name.
|
| + * Return the name of the declared type of the parameter, or `null` if the parameter does
|
| + * not have a declared type.
|
| *
|
| - * @param identifier the new name of the variable being declared
|
| + * @return the name of the declared type of the parameter
|
| */
|
| - void set identifier(SimpleIdentifier identifier) {
|
| - _identifier = becomeParentOf(identifier);
|
| - }
|
| + TypeName get type => _type;
|
|
|
| /**
|
| * Set the name of the declared type of the parameter to the given type name.
|
| @@ -5875,22 +6271,15 @@ class DeclaredIdentifier extends Declaration {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitDeclaredIdentifier(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_type, visitor);
|
| safelyVisitChild(_identifier, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - if (keyword != null) {
|
| - return keyword;
|
| - } else if (_type != null) {
|
| - return _type.beginToken;
|
| - }
|
| - return _identifier.beginToken;
|
| - }
|
| -}
|
| +}
|
|
|
| /**
|
| * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default
|
| @@ -5936,15 +6325,13 @@ class DefaultFormalParameter extends FormalParameter {
|
| * @param separator the token separating the parameter from the default value
|
| * @param defaultValue the expression computing the default value for the parameter
|
| */
|
| - DefaultFormalParameter(NormalFormalParameter parameter, this.kind, this.separator, Expression defaultValue) {
|
| + DefaultFormalParameter(NormalFormalParameter parameter, this.kind,
|
| + this.separator, Expression defaultValue) {
|
| _parameter = becomeParentOf(parameter);
|
| _defaultValue = becomeParentOf(defaultValue);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this);
|
| -
|
| - @override
|
| Token get beginToken => _parameter.beginToken;
|
|
|
| /**
|
| @@ -5955,6 +6342,15 @@ class DefaultFormalParameter extends FormalParameter {
|
| */
|
| Expression get defaultValue => _defaultValue;
|
|
|
| + /**
|
| + * Set the expression computing the default value for the parameter to the given expression.
|
| + *
|
| + * @param expression the expression computing the default value for the parameter
|
| + */
|
| + void set defaultValue(Expression expression) {
|
| + _defaultValue = becomeParentOf(expression);
|
| + }
|
| +
|
| @override
|
| Token get endToken {
|
| if (_defaultValue != null) {
|
| @@ -5966,13 +6362,6 @@ class DefaultFormalParameter extends FormalParameter {
|
| @override
|
| SimpleIdentifier get identifier => _parameter.identifier;
|
|
|
| - /**
|
| - * Return the formal parameter with which the default value is associated.
|
| - *
|
| - * @return the formal parameter with which the default value is associated
|
| - */
|
| - NormalFormalParameter get parameter => _parameter;
|
| -
|
| @override
|
| bool get isConst => _parameter != null && _parameter.isConst;
|
|
|
| @@ -5980,13 +6369,11 @@ class DefaultFormalParameter extends FormalParameter {
|
| bool get isFinal => _parameter != null && _parameter.isFinal;
|
|
|
| /**
|
| - * Set the expression computing the default value for the parameter to the given expression.
|
| + * Return the formal parameter with which the default value is associated.
|
| *
|
| - * @param expression the expression computing the default value for the parameter
|
| + * @return the formal parameter with which the default value is associated
|
| */
|
| - void set defaultValue(Expression expression) {
|
| - _defaultValue = becomeParentOf(expression);
|
| - }
|
| + NormalFormalParameter get parameter => _parameter;
|
|
|
| /**
|
| * Set the formal parameter with which the default value is associated to the given parameter.
|
| @@ -5998,6 +6385,9 @@ class DefaultFormalParameter extends FormalParameter {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitDefaultFormalParameter(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_parameter, visitor);
|
| safelyVisitChild(_defaultValue, visitor);
|
| @@ -6056,7 +6446,8 @@ abstract class Directive extends AnnotatedNode {
|
| * @param comment the documentation comment associated with this directive
|
| * @param metadata the annotations associated with the directive
|
| */
|
| - Directive(Comment comment, List<Annotation> metadata) : super(comment, metadata);
|
| + Directive(Comment comment, List<Annotation> metadata)
|
| + : super(comment, metadata);
|
|
|
| /**
|
| * Return the token representing the keyword that introduces this directive ('import', 'export',
|
| @@ -6122,15 +6513,14 @@ class DoStatement extends Statement {
|
| * @param rightParenthesis the right parenthesis
|
| * @param semicolon the semicolon terminating the statement
|
| */
|
| - DoStatement(this.doKeyword, Statement body, this.whileKeyword, this.leftParenthesis, Expression condition, this.rightParenthesis, this.semicolon) {
|
| + DoStatement(this.doKeyword, Statement body, this.whileKeyword,
|
| + this.leftParenthesis, Expression condition, this.rightParenthesis,
|
| + this.semicolon) {
|
| _body = becomeParentOf(body);
|
| _condition = becomeParentOf(condition);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitDoStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => doKeyword;
|
|
|
| /**
|
| @@ -6141,16 +6531,6 @@ class DoStatement extends Statement {
|
| Statement get body => _body;
|
|
|
| /**
|
| - * Return the condition that determines when the loop will terminate.
|
| - *
|
| - * @return the condition that determines when the loop will terminate
|
| - */
|
| - Expression get condition => _condition;
|
| -
|
| - @override
|
| - Token get endToken => semicolon;
|
| -
|
| - /**
|
| * Set the body of the loop to the given statement.
|
| *
|
| * @param statement the body of the loop
|
| @@ -6160,6 +6540,13 @@ class DoStatement extends Statement {
|
| }
|
|
|
| /**
|
| + * Return the condition that determines when the loop will terminate.
|
| + *
|
| + * @return the condition that determines when the loop will terminate
|
| + */
|
| + Expression get condition => _condition;
|
| +
|
| + /**
|
| * Set the condition that determines when the loop will terminate to the given expression.
|
| *
|
| * @param expression the condition that determines when the loop will terminate
|
| @@ -6169,6 +6556,12 @@ class DoStatement extends Statement {
|
| }
|
|
|
| @override
|
| + Token get endToken => semicolon;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitDoStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_body, visitor);
|
| safelyVisitChild(_condition, visitor);
|
| @@ -6207,15 +6600,15 @@ class DoubleLiteral extends Literal {
|
| DoubleLiteral(this.literal, this.value);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken => literal;
|
|
|
| @override
|
| Token get endToken => literal;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitDoubleLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -6281,7 +6674,8 @@ class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
|
| Element visitAnnotation(Annotation node) => node.element;
|
|
|
| @override
|
| - Element visitAssignmentExpression(AssignmentExpression node) => node.bestElement;
|
| + Element visitAssignmentExpression(AssignmentExpression node) =>
|
| + node.bestElement;
|
|
|
| @override
|
| Element visitBinaryExpression(BinaryExpression node) => node.bestElement;
|
| @@ -6293,7 +6687,8 @@ class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
|
| Element visitCompilationUnit(CompilationUnit node) => node.element;
|
|
|
| @override
|
| - Element visitConstructorDeclaration(ConstructorDeclaration node) => node.element;
|
| + Element visitConstructorDeclaration(ConstructorDeclaration node) =>
|
| + node.element;
|
|
|
| @override
|
| Element visitFunctionDeclaration(FunctionDeclaration node) => node.element;
|
| @@ -6304,11 +6699,13 @@ class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
|
| // Type name in Annotation
|
| if (parent is Annotation) {
|
| Annotation annotation = parent;
|
| - if (identical(annotation.name, node) && annotation.constructorName == null) {
|
| + if (identical(annotation.name, node) &&
|
| + annotation.constructorName == null) {
|
| return annotation.element;
|
| }
|
| }
|
| - // Extra work to map Constructor Declarations to their associated Constructor Elements
|
| + // Extra work to map Constructor Declarations to their associated
|
| + // Constructor Elements
|
| if (parent is ConstructorDeclaration) {
|
| ConstructorDeclaration decl = parent;
|
| Identifier returnType = decl.returnType;
|
| @@ -6342,7 +6739,8 @@ class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
|
| Element visitIndexExpression(IndexExpression node) => node.bestElement;
|
|
|
| @override
|
| - Element visitInstanceCreationExpression(InstanceCreationExpression node) => node.staticElement;
|
| + Element visitInstanceCreationExpression(InstanceCreationExpression node) =>
|
| + node.staticElement;
|
|
|
| @override
|
| Element visitLibraryDirective(LibraryDirective node) => node.element;
|
| @@ -6351,7 +6749,8 @@ class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
|
| Element visitMethodDeclaration(MethodDeclaration node) => node.element;
|
|
|
| @override
|
| - Element visitMethodInvocation(MethodInvocation node) => node.methodName.bestElement;
|
| + Element visitMethodInvocation(MethodInvocation node) =>
|
| + node.methodName.bestElement;
|
|
|
| @override
|
| Element visitPostfixExpression(PostfixExpression node) => node.bestElement;
|
| @@ -6398,15 +6797,15 @@ class EmptyFunctionBody extends FunctionBody {
|
| EmptyFunctionBody(this.semicolon);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this);
|
| -
|
| - @override
|
| Token get beginToken => semicolon;
|
|
|
| @override
|
| Token get endToken => semicolon;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitEmptyFunctionBody(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // Empty function bodies have no children.
|
| }
|
| @@ -6434,15 +6833,15 @@ class EmptyStatement extends Statement {
|
| EmptyStatement(this.semicolon);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitEmptyStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => semicolon;
|
|
|
| @override
|
| Token get endToken => semicolon;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitEmptyStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -6465,18 +6864,21 @@ class EnumConstantDeclaration extends Declaration {
|
| * @param metadata the annotations associated with this declaration
|
| * @param name the name of the constant
|
| */
|
| - EnumConstantDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifier name) : super(comment, metadata) {
|
| + EnumConstantDeclaration(Comment comment, List<Annotation> metadata,
|
| + SimpleIdentifier name)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this);
|
| + FieldElement get element =>
|
| + _name == null ? null : (_name.staticElement as FieldElement);
|
|
|
| @override
|
| - FieldElement get element => _name == null ? null : (_name.staticElement as FieldElement);
|
| + Token get endToken => _name.endToken;
|
|
|
| @override
|
| - Token get endToken => _name.endToken;
|
| + Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
|
|
| /**
|
| * Return the name of the constant.
|
| @@ -6495,7 +6897,7 @@ class EnumConstantDeclaration extends Declaration {
|
| }
|
|
|
| @override
|
| - Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
| + accept(AstVisitor visitor) => visitor.visitEnumConstantDeclaration(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| @@ -6549,14 +6951,14 @@ class EnumDeclaration extends CompilationUnitMember {
|
| * @param constants the enumeration constants being declared
|
| * @param rightBracket the right curly bracket
|
| */
|
| - EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword, SimpleIdentifier name, this.leftBracket, List<EnumConstantDeclaration> constants, this.rightBracket) : super(comment, metadata) {
|
| + EnumDeclaration(Comment comment, List<Annotation> metadata, this.keyword,
|
| + SimpleIdentifier name, this.leftBracket,
|
| + List<EnumConstantDeclaration> constants, this.rightBracket)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| _constants = new NodeList<EnumConstantDeclaration>(this, constants);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this);
|
| -
|
| /**
|
| * Return the enumeration constants being declared.
|
| *
|
| @@ -6565,11 +6967,15 @@ class EnumDeclaration extends CompilationUnitMember {
|
| NodeList<EnumConstantDeclaration> get constants => _constants;
|
|
|
| @override
|
| - ClassElement get element => _name != null ? (_name.staticElement as ClassElement) : null;
|
| + ClassElement get element =>
|
| + _name != null ? (_name.staticElement as ClassElement) : null;
|
|
|
| @override
|
| Token get endToken => rightBracket;
|
|
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata => keyword;
|
| +
|
| /**
|
| * Return the name of the enumeration.
|
| *
|
| @@ -6587,7 +6993,7 @@ class EnumDeclaration extends CompilationUnitMember {
|
| }
|
|
|
| @override
|
| - Token get firstTokenAfterCommentAndMetadata => keyword;
|
| + accept(AstVisitor visitor) => visitor.visitEnumDeclaration(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| @@ -6601,7 +7007,8 @@ class EnumDeclaration extends CompilationUnitMember {
|
| * Ephemeral identifiers are created as needed to mimic the presence of an empty identifier.
|
| */
|
| class EphemeralIdentifier extends SimpleIdentifier {
|
| - EphemeralIdentifier(AstNode parent, int location) : super(new StringToken(TokenType.IDENTIFIER, "", location)) {
|
| + EphemeralIdentifier(AstNode parent, int location)
|
| + : super(new StringToken(TokenType.IDENTIFIER, "", location)) {
|
| parent.becomeParentOf(this);
|
| }
|
| }
|
| @@ -6625,10 +7032,9 @@ class ExportDirective extends NamespaceDirective {
|
| * @param combinators the combinators used to control which names are exported
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - ExportDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, combinators, semicolon);
|
| -
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitExportDirective(this);
|
| + ExportDirective(Comment comment, List<Annotation> metadata, Token keyword,
|
| + StringLiteral libraryUri, List<Combinator> combinators, Token semicolon)
|
| + : super(comment, metadata, keyword, libraryUri, combinators, semicolon);
|
|
|
| @override
|
| ExportElement get element => super.element as ExportElement;
|
| @@ -6642,6 +7048,9 @@ class ExportDirective extends NamespaceDirective {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitExportDirective(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| combinators.accept(visitor);
|
| @@ -6661,6 +7070,11 @@ class ExportDirective extends NamespaceDirective {
|
| */
|
| abstract class Expression extends AstNode {
|
| /**
|
| + * An empty list of expressions.
|
| + */
|
| + static const List<Expression> EMPTY_ARRAY = const <Expression>[];
|
| +
|
| + /**
|
| * The static type of this expression, or `null` if the AST structure has not been resolved.
|
| */
|
| DartType staticType;
|
| @@ -6672,11 +7086,6 @@ abstract class Expression extends AstNode {
|
| DartType propagatedType;
|
|
|
| /**
|
| - * An empty list of expressions.
|
| - */
|
| - static const List<Expression> EMPTY_ARRAY = const <Expression>[];
|
| -
|
| - /**
|
| * Return the best parameter element information available for this expression. If type
|
| * propagation was able to find a better parameter element than static analysis, that type will be
|
| * returned. Otherwise, the result of static analysis will be returned.
|
| @@ -6710,6 +7119,14 @@ abstract class Expression extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return `true` if this expression is syntactically valid for the LHS of an
|
| + * [AssignmentExpression].
|
| + *
|
| + * @return `true` if this expression matches the `assignableExpression` production
|
| + */
|
| + bool get isAssignable => false;
|
| +
|
| + /**
|
| * Return the precedence of this expression. The precedence is a positive integer value that
|
| * defines how the source code is parsed into an AST. For example `a * b + c` is parsed as
|
| * `(a * b) + c` because the precedence of `*` is greater than the precedence of
|
| @@ -6795,14 +7212,6 @@ abstract class Expression extends AstNode {
|
| }
|
| return null;
|
| }
|
| -
|
| - /**
|
| - * Return `true` if this expression is syntactically valid for the LHS of an
|
| - * [AssignmentExpression].
|
| - *
|
| - * @return `true` if this expression matches the `assignableExpression` production
|
| - */
|
| - bool get isAssignable => false;
|
| }
|
|
|
| /**
|
| @@ -6844,14 +7253,12 @@ class ExpressionFunctionBody extends FunctionBody {
|
| * @param expression the expression representing the body of the function
|
| * @param semicolon the semicolon terminating the statement
|
| */
|
| - ExpressionFunctionBody(this.keyword, this.functionDefinition, Expression expression, this.semicolon) {
|
| + ExpressionFunctionBody(this.keyword, this.functionDefinition,
|
| + Expression expression, this.semicolon) {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
|
| -
|
| - @override
|
| Token get beginToken => functionDefinition;
|
|
|
| @override
|
| @@ -6869,12 +7276,6 @@ class ExpressionFunctionBody extends FunctionBody {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - bool get isAsynchronous => keyword != null;
|
| -
|
| - @override
|
| - bool get isSynchronous => keyword == null;
|
| -
|
| /**
|
| * Set the expression representing the body of the function to the given expression.
|
| *
|
| @@ -6885,6 +7286,15 @@ class ExpressionFunctionBody extends FunctionBody {
|
| }
|
|
|
| @override
|
| + bool get isAsynchronous => keyword != null;
|
| +
|
| + @override
|
| + bool get isSynchronous => keyword == null;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitExpressionFunctionBody(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -6921,9 +7331,6 @@ class ExpressionStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitExpressionStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => _expression.beginToken;
|
|
|
| @override
|
| @@ -6941,9 +7348,6 @@ class ExpressionStatement extends Statement {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
|
| -
|
| /**
|
| * Set the expression that comprises the statement to the given expression.
|
| *
|
| @@ -6954,6 +7358,12 @@ class ExpressionStatement extends Statement {
|
| }
|
|
|
| @override
|
| + bool get isSynthetic => _expression.isSynthetic && semicolon.isSynthetic;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitExpressionStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -6990,9 +7400,6 @@ class ExtendsClause extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitExtendsClause(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -7015,6 +7422,9 @@ class ExtendsClause extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitExtendsClause(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_superclass, visitor);
|
| }
|
| @@ -7054,14 +7464,13 @@ class FieldDeclaration extends ClassMember {
|
| * @param fieldList the fields being declared
|
| * @param semicolon the semicolon terminating the declaration
|
| */
|
| - FieldDeclaration(Comment comment, List<Annotation> metadata, this.staticKeyword, VariableDeclarationList fieldList, this.semicolon) : super(comment, metadata) {
|
| + FieldDeclaration(Comment comment, List<Annotation> metadata,
|
| + this.staticKeyword, VariableDeclarationList fieldList, this.semicolon)
|
| + : super(comment, metadata) {
|
| _fieldList = becomeParentOf(fieldList);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this);
|
| -
|
| - @override
|
| Element get element => null;
|
|
|
| @override
|
| @@ -7075,13 +7484,6 @@ class FieldDeclaration extends ClassMember {
|
| VariableDeclarationList get fields => _fieldList;
|
|
|
| /**
|
| - * Return `true` if the fields are static.
|
| - *
|
| - * @return `true` if the fields are declared to be static
|
| - */
|
| - bool get isStatic => staticKeyword != null;
|
| -
|
| - /**
|
| * Set the fields being declared to the given list of variables.
|
| *
|
| * @param fieldList the fields being declared
|
| @@ -7091,18 +7493,28 @@ class FieldDeclaration extends ClassMember {
|
| }
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - super.visitChildren(visitor);
|
| - safelyVisitChild(_fieldList, visitor);
|
| - }
|
| -
|
| - @override
|
| Token get firstTokenAfterCommentAndMetadata {
|
| if (staticKeyword != null) {
|
| return staticKeyword;
|
| }
|
| return _fieldList.beginToken;
|
| }
|
| +
|
| + /**
|
| + * Return `true` if the fields are static.
|
| + *
|
| + * @return `true` if the fields are declared to be static
|
| + */
|
| + bool get isStatic => staticKeyword != null;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitFieldDeclaration(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + super.visitChildren(visitor);
|
| + safelyVisitChild(_fieldList, visitor);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -7155,15 +7567,15 @@ class FieldFormalParameter extends NormalFormalParameter {
|
| * @param parameters the parameters of the function-typed parameter, or `null` if this is
|
| * not a function-typed field formal parameter
|
| */
|
| - FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, this.thisToken, this.period, SimpleIdentifier identifier, FormalParameterList parameters) : super(comment, metadata, identifier) {
|
| + FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword,
|
| + TypeName type, this.thisToken, this.period, SimpleIdentifier identifier,
|
| + FormalParameterList parameters)
|
| + : super(comment, metadata, identifier) {
|
| _type = becomeParentOf(type);
|
| _parameters = becomeParentOf(parameters);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (keyword != null) {
|
| return keyword;
|
| @@ -7176,6 +7588,14 @@ class FieldFormalParameter extends NormalFormalParameter {
|
| @override
|
| Token get endToken => identifier.endToken;
|
|
|
| + @override
|
| + bool get isConst =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| +
|
| + @override
|
| + bool get isFinal =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| +
|
| /**
|
| * Return the parameters of the function-typed parameter, or `null` if this is not a
|
| * function-typed field formal parameter.
|
| @@ -7185,21 +7605,6 @@ class FieldFormalParameter extends NormalFormalParameter {
|
| FormalParameterList get parameters => _parameters;
|
|
|
| /**
|
| - * Return the name of the declared type of the parameter, or `null` if the parameter does
|
| - * not have a declared type. Note that if this is a function-typed field formal parameter this is
|
| - * the return type of the function.
|
| - *
|
| - * @return the name of the declared type of the parameter
|
| - */
|
| - TypeName get type => _type;
|
| -
|
| - @override
|
| - bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| -
|
| - @override
|
| - bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| -
|
| - /**
|
| * Set the parameters of the function-typed parameter to the given parameters.
|
| *
|
| * @param parameters the parameters of the function-typed parameter
|
| @@ -7209,6 +7614,15 @@ class FieldFormalParameter extends NormalFormalParameter {
|
| }
|
|
|
| /**
|
| + * Return the name of the declared type of the parameter, or `null` if the parameter does
|
| + * not have a declared type. Note that if this is a function-typed field formal parameter this is
|
| + * the return type of the function.
|
| + *
|
| + * @return the name of the declared type of the parameter
|
| + */
|
| + TypeName get type => _type;
|
| +
|
| + /**
|
| * Set the name of the declared type of the parameter to the given type name.
|
| *
|
| * @param typeName the name of the declared type of the parameter
|
| @@ -7218,6 +7632,9 @@ class FieldFormalParameter extends NormalFormalParameter {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitFieldFormalParameter(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_type, visitor);
|
| @@ -7293,7 +7710,9 @@ class ForEachStatement extends Statement {
|
| * @param rightParenthesis the right parenthesis
|
| * @param body the body of the loop
|
| */
|
| - ForEachStatement.con1(this.awaitKeyword, this.forKeyword, this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, Expression iterator, this.rightParenthesis, Statement body) {
|
| + ForEachStatement.con1(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);
|
| @@ -7310,16 +7729,15 @@ class ForEachStatement extends Statement {
|
| * @param rightParenthesis the right parenthesis
|
| * @param body the body of the loop
|
| */
|
| - ForEachStatement.con2(this.awaitKeyword, this.forKeyword, this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, Expression iterator, this.rightParenthesis, Statement body) {
|
| + ForEachStatement.con2(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
|
| - accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => forKeyword;
|
|
|
| /**
|
| @@ -7329,6 +7747,15 @@ class ForEachStatement extends Statement {
|
| */
|
| Statement get body => _body;
|
|
|
| + /**
|
| + * Set the body of the loop to the given block.
|
| + *
|
| + * @param body the body of the loop
|
| + */
|
| + void set body(Statement body) {
|
| + _body = becomeParentOf(body);
|
| + }
|
| +
|
| @override
|
| Token get endToken => _body.endToken;
|
|
|
| @@ -7340,6 +7767,15 @@ class ForEachStatement extends Statement {
|
| SimpleIdentifier get identifier => _identifier;
|
|
|
| /**
|
| + * Set the loop variable to the given variable.
|
| + *
|
| + * @param identifier the loop variable
|
| + */
|
| + void set identifier(SimpleIdentifier identifier) {
|
| + _identifier = becomeParentOf(identifier);
|
| + }
|
| +
|
| + /**
|
| * Return the expression evaluated to produce the iterator.
|
| *
|
| * @return the expression evaluated to produce the iterator
|
| @@ -7347,39 +7783,21 @@ class ForEachStatement extends Statement {
|
| Expression get iterable => _iterable;
|
|
|
| /**
|
| - * Return the declaration of the loop variable, or `null` if the loop variable is a simple
|
| - * identifier.
|
| + * Set the expression evaluated to produce the iterator to the given expression.
|
| *
|
| - * @return the declaration of the loop variable
|
| + * @param expression the expression evaluated to produce the iterator
|
| */
|
| - DeclaredIdentifier get loopVariable => _loopVariable;
|
| -
|
| - /**
|
| - * Set the body of the loop to the given block.
|
| - *
|
| - * @param body the body of the loop
|
| - */
|
| - void set body(Statement body) {
|
| - _body = becomeParentOf(body);
|
| - }
|
| -
|
| - /**
|
| - * Set the loop variable to the given variable.
|
| - *
|
| - * @param identifier the loop variable
|
| - */
|
| - void set identifier(SimpleIdentifier identifier) {
|
| - _identifier = becomeParentOf(identifier);
|
| + void set iterable(Expression expression) {
|
| + _iterable = becomeParentOf(expression);
|
| }
|
|
|
| /**
|
| - * Set the expression evaluated to produce the iterator to the given expression.
|
| + * Return the declaration of the loop variable, or `null` if the loop variable is a simple
|
| + * identifier.
|
| *
|
| - * @param expression the expression evaluated to produce the iterator
|
| + * @return the declaration of the loop variable
|
| */
|
| - void set iterable(Expression expression) {
|
| - _iterable = becomeParentOf(expression);
|
| - }
|
| + DeclaredIdentifier get loopVariable => _loopVariable;
|
|
|
| /**
|
| * Set the declaration of the loop variable to the given variable.
|
| @@ -7391,6 +7809,9 @@ class ForEachStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitForEachStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_loopVariable, visitor);
|
| safelyVisitChild(_identifier, visitor);
|
| @@ -7400,190 +7821,6 @@ class ForEachStatement extends Statement {
|
| }
|
|
|
| /**
|
| - * Instances of the class `ForStatement` represent a for statement.
|
| - *
|
| - * <pre>
|
| - * forStatement ::=
|
| - * 'for' '(' forLoopParts ')' [Statement]
|
| - *
|
| - * forLoopParts ::=
|
| - * forInitializerStatement ';' [Expression]? ';' [Expression]?
|
| - *
|
| - * forInitializerStatement ::=
|
| - * [DefaultFormalParameter]
|
| - * | [Expression]?
|
| - * </pre>
|
| - */
|
| -class ForStatement extends Statement {
|
| - /**
|
| - * The token representing the 'for' keyword.
|
| - */
|
| - Token forKeyword;
|
| -
|
| - /**
|
| - * The left parenthesis.
|
| - */
|
| - Token leftParenthesis;
|
| -
|
| - /**
|
| - * The declaration of the loop variables, or `null` if there are no variables. Note that a
|
| - * for statement cannot have both a variable list and an initialization expression, but can
|
| - * validly have neither.
|
| - */
|
| - VariableDeclarationList _variableList;
|
| -
|
| - /**
|
| - * The initialization expression, or `null` if there is no initialization expression. Note
|
| - * that a for statement cannot have both a variable list and an initialization expression, but can
|
| - * validly have neither.
|
| - */
|
| - Expression _initialization;
|
| -
|
| - /**
|
| - * The semicolon separating the initializer and the condition.
|
| - */
|
| - Token leftSeparator;
|
| -
|
| - /**
|
| - * The condition used to determine when to terminate the loop, or `null` if there is no
|
| - * condition.
|
| - */
|
| - Expression _condition;
|
| -
|
| - /**
|
| - * The semicolon separating the condition and the updater.
|
| - */
|
| - Token rightSeparator;
|
| -
|
| - /**
|
| - * The list of expressions run after each execution of the loop body.
|
| - */
|
| - NodeList<Expression> _updaters;
|
| -
|
| - /**
|
| - * The right parenthesis.
|
| - */
|
| - Token rightParenthesis;
|
| -
|
| - /**
|
| - * The body of the loop.
|
| - */
|
| - Statement _body;
|
| -
|
| - /**
|
| - * Initialize a newly created for statement.
|
| - *
|
| - * @param forKeyword the token representing the 'for' keyword
|
| - * @param leftParenthesis the left parenthesis
|
| - * @param variableList the declaration of the loop variables
|
| - * @param initialization the initialization expression
|
| - * @param leftSeparator the semicolon separating the initializer and the condition
|
| - * @param condition the condition used to determine when to terminate the loop
|
| - * @param rightSeparator the semicolon separating the condition and the updater
|
| - * @param updaters the list of expressions run after each execution of the loop body
|
| - * @param rightParenthesis the right parenthesis
|
| - * @param body the body of the loop
|
| - */
|
| - ForStatement(this.forKeyword, this.leftParenthesis, VariableDeclarationList variableList, Expression initialization, this.leftSeparator, Expression condition, this.rightSeparator, List<Expression> updaters, this.rightParenthesis, Statement body) {
|
| - _variableList = becomeParentOf(variableList);
|
| - _initialization = becomeParentOf(initialization);
|
| - _condition = becomeParentOf(condition);
|
| - _updaters = new NodeList<Expression>(this, updaters);
|
| - _body = becomeParentOf(body);
|
| - }
|
| -
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitForStatement(this);
|
| -
|
| - @override
|
| - Token get beginToken => forKeyword;
|
| -
|
| - /**
|
| - * Return the body of the loop.
|
| - *
|
| - * @return the body of the loop
|
| - */
|
| - Statement get body => _body;
|
| -
|
| - /**
|
| - * Return the condition used to determine when to terminate the loop, or `null` if there is
|
| - * no condition.
|
| - *
|
| - * @return the condition used to determine when to terminate the loop
|
| - */
|
| - Expression get condition => _condition;
|
| -
|
| - @override
|
| - Token get endToken => _body.endToken;
|
| -
|
| - /**
|
| - * Return the initialization expression, or `null` if there is no initialization expression.
|
| - *
|
| - * @return the initialization expression
|
| - */
|
| - Expression get initialization => _initialization;
|
| -
|
| - /**
|
| - * Return the list of expressions run after each execution of the loop body.
|
| - *
|
| - * @return the list of expressions run after each execution of the loop body
|
| - */
|
| - NodeList<Expression> get updaters => _updaters;
|
| -
|
| - /**
|
| - * Return the declaration of the loop variables, or `null` if there are no variables.
|
| - *
|
| - * @return the declaration of the loop variables, or `null` if there are no variables
|
| - */
|
| - VariableDeclarationList get variables => _variableList;
|
| -
|
| - /**
|
| - * Set the body of the loop to the given statement.
|
| - *
|
| - * @param body the body of the loop
|
| - */
|
| - void set body(Statement body) {
|
| - _body = becomeParentOf(body);
|
| - }
|
| -
|
| - /**
|
| - * Set the condition used to determine when to terminate the loop to the given expression.
|
| - *
|
| - * @param expression the condition used to determine when to terminate the loop
|
| - */
|
| - void set condition(Expression expression) {
|
| - _condition = becomeParentOf(expression);
|
| - }
|
| -
|
| - /**
|
| - * Set the initialization expression to the given expression.
|
| - *
|
| - * @param initialization the initialization expression
|
| - */
|
| - void set initialization(Expression initialization) {
|
| - _initialization = becomeParentOf(initialization);
|
| - }
|
| -
|
| - /**
|
| - * Set the declaration of the loop variables to the given parameter.
|
| - *
|
| - * @param variableList the declaration of the loop variables
|
| - */
|
| - void set variables(VariableDeclarationList variableList) {
|
| - _variableList = becomeParentOf(variableList);
|
| - }
|
| -
|
| - @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_variableList, visitor);
|
| - safelyVisitChild(_initialization, visitor);
|
| - safelyVisitChild(_condition, visitor);
|
| - _updaters.accept(visitor);
|
| - safelyVisitChild(_body, visitor);
|
| - }
|
| -}
|
| -
|
| -/**
|
| * The abstract class `FormalParameter` defines the behavior of objects representing a
|
| * parameter to a function.
|
| *
|
| @@ -7616,13 +7853,6 @@ abstract class FormalParameter extends AstNode {
|
| SimpleIdentifier get identifier;
|
|
|
| /**
|
| - * Return the kind of this parameter.
|
| - *
|
| - * @return the kind of this parameter
|
| - */
|
| - ParameterKind get kind;
|
| -
|
| - /**
|
| * Return `true` if this parameter was declared with the 'const' modifier.
|
| *
|
| * @return `true` if this parameter was declared with the 'const' modifier
|
| @@ -7637,6 +7867,13 @@ abstract class FormalParameter extends AstNode {
|
| * @return `true` if this parameter was declared with the 'final' modifier
|
| */
|
| bool get isFinal;
|
| +
|
| + /**
|
| + * Return the kind of this parameter.
|
| + *
|
| + * @return the kind of this parameter
|
| + */
|
| + ParameterKind get kind;
|
| }
|
|
|
| /**
|
| @@ -7675,21 +7912,138 @@ class FormalParameterList extends AstNode {
|
| Token leftParenthesis;
|
|
|
| /**
|
| - * The parameters associated with the method.
|
| + * The parameters associated with the method.
|
| + */
|
| + NodeList<FormalParameter> _parameters;
|
| +
|
| + /**
|
| + * The left square bracket ('[') or left curly brace ('{') introducing the optional parameters, or
|
| + * `null` if there are no optional parameters.
|
| + */
|
| + Token leftDelimiter;
|
| +
|
| + /**
|
| + * The right square bracket (']') or right curly brace ('}') introducing the optional parameters,
|
| + * or `null` if there are no optional parameters.
|
| + */
|
| + Token rightDelimiter;
|
| +
|
| + /**
|
| + * The right parenthesis.
|
| + */
|
| + Token rightParenthesis;
|
| +
|
| + /**
|
| + * Initialize a newly created parameter list.
|
| + *
|
| + * @param leftParenthesis the left parenthesis
|
| + * @param parameters the parameters associated with the method
|
| + * @param leftDelimiter the left delimiter introducing the optional parameters
|
| + * @param rightDelimiter the right delimiter introducing the optional parameters
|
| + * @param rightParenthesis the right parenthesis
|
| + */
|
| + FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters,
|
| + this.leftDelimiter, this.rightDelimiter, this.rightParenthesis) {
|
| + _parameters = new NodeList<FormalParameter>(this, parameters);
|
| + }
|
| +
|
| + @override
|
| + Token get beginToken => leftParenthesis;
|
| +
|
| + @override
|
| + Token get endToken => rightParenthesis;
|
| +
|
| + /**
|
| + * Return an array containing the elements representing the parameters in this list. The array
|
| + * will contain `null`s if the parameters in this list have not been resolved.
|
| + *
|
| + * @return the elements representing the parameters in this list
|
| + */
|
| + List<ParameterElement> get parameterElements {
|
| + int count = _parameters.length;
|
| + List<ParameterElement> types = new List<ParameterElement>(count);
|
| + for (int i = 0; i < count; i++) {
|
| + types[i] = _parameters[i].element;
|
| + }
|
| + return types;
|
| + }
|
| +
|
| + /**
|
| + * Return the parameters associated with the method.
|
| + *
|
| + * @return the parameters associated with the method
|
| + */
|
| + NodeList<FormalParameter> get parameters => _parameters;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitFormalParameterList(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + _parameters.accept(visitor);
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * Instances of the class `ForStatement` represent a for statement.
|
| + *
|
| + * <pre>
|
| + * forStatement ::=
|
| + * 'for' '(' forLoopParts ')' [Statement]
|
| + *
|
| + * forLoopParts ::=
|
| + * forInitializerStatement ';' [Expression]? ';' [Expression]?
|
| + *
|
| + * forInitializerStatement ::=
|
| + * [DefaultFormalParameter]
|
| + * | [Expression]?
|
| + * </pre>
|
| + */
|
| +class ForStatement extends Statement {
|
| + /**
|
| + * The token representing the 'for' keyword.
|
| + */
|
| + Token forKeyword;
|
| +
|
| + /**
|
| + * The left parenthesis.
|
| + */
|
| + Token leftParenthesis;
|
| +
|
| + /**
|
| + * The declaration of the loop variables, or `null` if there are no variables. Note that a
|
| + * for statement cannot have both a variable list and an initialization expression, but can
|
| + * validly have neither.
|
| */
|
| - NodeList<FormalParameter> _parameters;
|
| + VariableDeclarationList _variableList;
|
|
|
| /**
|
| - * The left square bracket ('[') or left curly brace ('{') introducing the optional parameters, or
|
| - * `null` if there are no optional parameters.
|
| + * The initialization expression, or `null` if there is no initialization expression. Note
|
| + * that a for statement cannot have both a variable list and an initialization expression, but can
|
| + * validly have neither.
|
| */
|
| - Token leftDelimiter;
|
| + Expression _initialization;
|
|
|
| /**
|
| - * The right square bracket (']') or right curly brace ('}') introducing the optional parameters,
|
| - * or `null` if there are no optional parameters.
|
| + * The semicolon separating the initializer and the condition.
|
| */
|
| - Token rightDelimiter;
|
| + Token leftSeparator;
|
| +
|
| + /**
|
| + * The condition used to determine when to terminate the loop, or `null` if there is no
|
| + * condition.
|
| + */
|
| + Expression _condition;
|
| +
|
| + /**
|
| + * The semicolon separating the condition and the updater.
|
| + */
|
| + Token rightSeparator;
|
| +
|
| + /**
|
| + * The list of expressions run after each execution of the loop body.
|
| + */
|
| + NodeList<Expression> _updaters;
|
|
|
| /**
|
| * The right parenthesis.
|
| @@ -7697,52 +8051,123 @@ class FormalParameterList extends AstNode {
|
| Token rightParenthesis;
|
|
|
| /**
|
| - * Initialize a newly created parameter list.
|
| + * The body of the loop.
|
| + */
|
| + Statement _body;
|
| +
|
| + /**
|
| + * Initialize a newly created for statement.
|
| *
|
| + * @param forKeyword the token representing the 'for' keyword
|
| * @param leftParenthesis the left parenthesis
|
| - * @param parameters the parameters associated with the method
|
| - * @param leftDelimiter the left delimiter introducing the optional parameters
|
| - * @param rightDelimiter the right delimiter introducing the optional parameters
|
| + * @param variableList the declaration of the loop variables
|
| + * @param initialization the initialization expression
|
| + * @param leftSeparator the semicolon separating the initializer and the condition
|
| + * @param condition the condition used to determine when to terminate the loop
|
| + * @param rightSeparator the semicolon separating the condition and the updater
|
| + * @param updaters the list of expressions run after each execution of the loop body
|
| * @param rightParenthesis the right parenthesis
|
| + * @param body the body of the loop
|
| */
|
| - FormalParameterList(this.leftParenthesis, List<FormalParameter> parameters, this.leftDelimiter, this.rightDelimiter, this.rightParenthesis) {
|
| - _parameters = new NodeList<FormalParameter>(this, parameters);
|
| + ForStatement(this.forKeyword, this.leftParenthesis,
|
| + VariableDeclarationList variableList, Expression initialization,
|
| + this.leftSeparator, Expression condition, this.rightSeparator,
|
| + List<Expression> updaters, this.rightParenthesis, Statement body) {
|
| + _variableList = becomeParentOf(variableList);
|
| + _initialization = becomeParentOf(initialization);
|
| + _condition = becomeParentOf(condition);
|
| + _updaters = new NodeList<Expression>(this, updaters);
|
| + _body = becomeParentOf(body);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFormalParameterList(this);
|
| + Token get beginToken => forKeyword;
|
|
|
| - @override
|
| - Token get beginToken => leftParenthesis;
|
| + /**
|
| + * Return the body of the loop.
|
| + *
|
| + * @return the body of the loop
|
| + */
|
| + Statement get body => _body;
|
| +
|
| + /**
|
| + * Set the body of the loop to the given statement.
|
| + *
|
| + * @param body the body of the loop
|
| + */
|
| + void set body(Statement body) {
|
| + _body = becomeParentOf(body);
|
| + }
|
| +
|
| + /**
|
| + * Return the condition used to determine when to terminate the loop, or `null` if there is
|
| + * no condition.
|
| + *
|
| + * @return the condition used to determine when to terminate the loop
|
| + */
|
| + Expression get condition => _condition;
|
| +
|
| + /**
|
| + * Set the condition used to determine when to terminate the loop to the given expression.
|
| + *
|
| + * @param expression the condition used to determine when to terminate the loop
|
| + */
|
| + void set condition(Expression expression) {
|
| + _condition = becomeParentOf(expression);
|
| + }
|
|
|
| @override
|
| - Token get endToken => rightParenthesis;
|
| + Token get endToken => _body.endToken;
|
|
|
| /**
|
| - * Return an array containing the elements representing the parameters in this list. The array
|
| - * will contain `null`s if the parameters in this list have not been resolved.
|
| + * Return the initialization expression, or `null` if there is no initialization expression.
|
| *
|
| - * @return the elements representing the parameters in this list
|
| + * @return the initialization expression
|
| */
|
| - List<ParameterElement> get parameterElements {
|
| - int count = _parameters.length;
|
| - List<ParameterElement> types = new List<ParameterElement>(count);
|
| - for (int i = 0; i < count; i++) {
|
| - types[i] = _parameters[i].element;
|
| - }
|
| - return types;
|
| + Expression get initialization => _initialization;
|
| +
|
| + /**
|
| + * Set the initialization expression to the given expression.
|
| + *
|
| + * @param initialization the initialization expression
|
| + */
|
| + void set initialization(Expression initialization) {
|
| + _initialization = becomeParentOf(initialization);
|
| }
|
|
|
| /**
|
| - * Return the parameters associated with the method.
|
| + * Return the list of expressions run after each execution of the loop body.
|
| *
|
| - * @return the parameters associated with the method
|
| + * @return the list of expressions run after each execution of the loop body
|
| */
|
| - NodeList<FormalParameter> get parameters => _parameters;
|
| + NodeList<Expression> get updaters => _updaters;
|
| +
|
| + /**
|
| + * Return the declaration of the loop variables, or `null` if there are no variables.
|
| + *
|
| + * @return the declaration of the loop variables, or `null` if there are no variables
|
| + */
|
| + VariableDeclarationList get variables => _variableList;
|
| +
|
| + /**
|
| + * Set the declaration of the loop variables to the given parameter.
|
| + *
|
| + * @param variableList the declaration of the loop variables
|
| + */
|
| + void set variables(VariableDeclarationList variableList) {
|
| + _variableList = becomeParentOf(variableList);
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitForStatement(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| - _parameters.accept(visitor);
|
| + safelyVisitChild(_variableList, visitor);
|
| + safelyVisitChild(_initialization, visitor);
|
| + safelyVisitChild(_condition, visitor);
|
| + _updaters.accept(visitor);
|
| + safelyVisitChild(_body, visitor);
|
| }
|
| }
|
|
|
| @@ -7759,21 +8184,6 @@ class FormalParameterList extends AstNode {
|
| */
|
| abstract class FunctionBody extends AstNode {
|
| /**
|
| - * Return the token representing the 'async' or 'sync' keyword, or `null` if there is no
|
| - * such keyword.
|
| - *
|
| - * @return the token representing the 'async' or 'sync' keyword
|
| - */
|
| - Token get keyword => null;
|
| -
|
| - /**
|
| - * Return the star following the 'async' or 'sync' keyword, or `null` if there is no star.
|
| - *
|
| - * @return the star following the 'async' or 'sync' keyword
|
| - */
|
| - Token get star => null;
|
| -
|
| - /**
|
| * Return `true` if this function body is asynchronous.
|
| *
|
| * @return `true` if this function body is asynchronous
|
| @@ -7793,6 +8203,21 @@ abstract class FunctionBody extends AstNode {
|
| * @return `true` if this function body is synchronous
|
| */
|
| bool get isSynchronous => true;
|
| +
|
| + /**
|
| + * Return the token representing the 'async' or 'sync' keyword, or `null` if there is no
|
| + * such keyword.
|
| + *
|
| + * @return the token representing the 'async' or 'sync' keyword
|
| + */
|
| + Token get keyword => null;
|
| +
|
| + /**
|
| + * Return the star following the 'async' or 'sync' keyword, or `null` if there is no star.
|
| + *
|
| + * @return the star following the 'async' or 'sync' keyword
|
| + */
|
| + Token get star => null;
|
| }
|
|
|
| /**
|
| @@ -7846,20 +8271,35 @@ class FunctionDeclaration extends CompilationUnitMember {
|
| * @param name the name of the function
|
| * @param functionExpression the function expression being wrapped
|
| */
|
| - FunctionDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, TypeName returnType, this.propertyKeyword, SimpleIdentifier name, FunctionExpression functionExpression) : super(comment, metadata) {
|
| + FunctionDeclaration(Comment comment, List<Annotation> metadata,
|
| + this.externalKeyword, TypeName returnType, this.propertyKeyword,
|
| + SimpleIdentifier name, FunctionExpression functionExpression)
|
| + : super(comment, metadata) {
|
| _returnType = becomeParentOf(returnType);
|
| _name = becomeParentOf(name);
|
| _functionExpression = becomeParentOf(functionExpression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this);
|
| + ExecutableElement get element =>
|
| + _name != null ? (_name.staticElement as ExecutableElement) : null;
|
|
|
| @override
|
| - ExecutableElement get element => _name != null ? (_name.staticElement as ExecutableElement) : null;
|
| + Token get endToken => _functionExpression.endToken;
|
|
|
| @override
|
| - Token get endToken => _functionExpression.endToken;
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + if (externalKeyword != null) {
|
| + return externalKeyword;
|
| + } else if (_returnType != null) {
|
| + return _returnType.beginToken;
|
| + } else if (propertyKeyword != null) {
|
| + return propertyKeyword;
|
| + } else if (_name != null) {
|
| + return _name.beginToken;
|
| + }
|
| + return _functionExpression.beginToken;
|
| + }
|
|
|
| /**
|
| * Return the function expression being wrapped.
|
| @@ -7869,41 +8309,38 @@ class FunctionDeclaration extends CompilationUnitMember {
|
| FunctionExpression get functionExpression => _functionExpression;
|
|
|
| /**
|
| - * Return the name of the function, or `null` if the function is not named.
|
| - *
|
| - * @return the name of the function
|
| - */
|
| - SimpleIdentifier get name => _name;
|
| -
|
| - /**
|
| - * Return the return type of the function, or `null` if no return type was declared.
|
| + * Set the function expression being wrapped to the given function expression.
|
| *
|
| - * @return the return type of the function
|
| + * @param functionExpression the function expression being wrapped
|
| */
|
| - TypeName get returnType => _returnType;
|
| + void set functionExpression(FunctionExpression functionExpression) {
|
| + _functionExpression = becomeParentOf(functionExpression);
|
| + }
|
|
|
| /**
|
| * Return `true` if this function declares a getter.
|
| *
|
| * @return `true` if this function declares a getter
|
| */
|
| - bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.GET;
|
| + bool get isGetter =>
|
| + propertyKeyword != null &&
|
| + (propertyKeyword as KeywordToken).keyword == Keyword.GET;
|
|
|
| /**
|
| * Return `true` if this function declares a setter.
|
| *
|
| * @return `true` if this function declares a setter
|
| */
|
| - bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.SET;
|
| + bool get isSetter =>
|
| + propertyKeyword != null &&
|
| + (propertyKeyword as KeywordToken).keyword == Keyword.SET;
|
|
|
| /**
|
| - * Set the function expression being wrapped to the given function expression.
|
| + * Return the name of the function, or `null` if the function is not named.
|
| *
|
| - * @param functionExpression the function expression being wrapped
|
| + * @return the name of the function
|
| */
|
| - void set functionExpression(FunctionExpression functionExpression) {
|
| - _functionExpression = becomeParentOf(functionExpression);
|
| - }
|
| + SimpleIdentifier get name => _name;
|
|
|
| /**
|
| * Set the name of the function to the given identifier.
|
| @@ -7915,6 +8352,13 @@ class FunctionDeclaration extends CompilationUnitMember {
|
| }
|
|
|
| /**
|
| + * Return the return type of the function, or `null` if no return type was declared.
|
| + *
|
| + * @return the return type of the function
|
| + */
|
| + TypeName get returnType => _returnType;
|
| +
|
| + /**
|
| * Set the return type of the function to the given name.
|
| *
|
| * @param returnType the return type of the function
|
| @@ -7924,26 +8368,15 @@ class FunctionDeclaration extends CompilationUnitMember {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionDeclaration(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_returnType, visitor);
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_functionExpression, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - if (externalKeyword != null) {
|
| - return externalKeyword;
|
| - } else if (_returnType != null) {
|
| - return _returnType.beginToken;
|
| - } else if (propertyKeyword != null) {
|
| - return propertyKeyword;
|
| - } else if (_name != null) {
|
| - return _name.beginToken;
|
| - }
|
| - return _functionExpression.beginToken;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -7966,9 +8399,6 @@ class FunctionDeclarationStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => _functionDeclaration.beginToken;
|
|
|
| @override
|
| @@ -7991,6 +8421,9 @@ class FunctionDeclarationStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionDeclarationStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_functionDeclaration, visitor);
|
| }
|
| @@ -8033,26 +8466,32 @@ class FunctionExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionExpression(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (_parameters != null) {
|
| return _parameters.beginToken;
|
| } else if (_body != null) {
|
| return _body.beginToken;
|
| }
|
| - // This should never be reached because external functions must be named, hence either the body
|
| - // or the name should be non-null.
|
| + // This should never be reached because external functions must be named,
|
| + // hence either the body or the name should be non-null.
|
| throw new IllegalStateException("Non-external functions must have a body");
|
| }
|
|
|
| /**
|
| * Return the body of the function, or `null` if this is an external function.
|
| *
|
| - * @return the body of the function
|
| + * @return the body of the function
|
| + */
|
| + FunctionBody get body => _body;
|
| +
|
| + /**
|
| + * Set the body of the function to the given function body.
|
| + *
|
| + * @param functionBody the body of the function
|
| */
|
| - FunctionBody get body => _body;
|
| + void set body(FunctionBody functionBody) {
|
| + _body = becomeParentOf(functionBody);
|
| + }
|
|
|
| @override
|
| Token get endToken {
|
| @@ -8061,8 +8500,8 @@ class FunctionExpression extends Expression {
|
| } else if (_parameters != null) {
|
| return _parameters.endToken;
|
| }
|
| - // This should never be reached because external functions must be named, hence either the body
|
| - // or the name should be non-null.
|
| + // This should never be reached because external functions must be named,
|
| + // hence either the body or the name should be non-null.
|
| throw new IllegalStateException("Non-external functions must have a body");
|
| }
|
|
|
| @@ -8073,18 +8512,6 @@ class FunctionExpression extends Expression {
|
| */
|
| FormalParameterList get parameters => _parameters;
|
|
|
| - @override
|
| - int get precedence => 16;
|
| -
|
| - /**
|
| - * Set the body of the function to the given function body.
|
| - *
|
| - * @param functionBody the body of the function
|
| - */
|
| - void set body(FunctionBody functionBody) {
|
| - _body = becomeParentOf(functionBody);
|
| - }
|
| -
|
| /**
|
| * Set the parameters associated with the function to the given list of parameters.
|
| *
|
| @@ -8095,6 +8522,12 @@ class FunctionExpression extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 16;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_parameters, visitor);
|
| safelyVisitChild(_body, visitor);
|
| @@ -8147,9 +8580,6 @@ class FunctionExpressionInvocation extends Expression {
|
| _argumentList = becomeParentOf(argumentList);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
|
| -
|
| /**
|
| * Return the list of arguments to the method.
|
| *
|
| @@ -8157,6 +8587,15 @@ class FunctionExpressionInvocation extends Expression {
|
| */
|
| ArgumentList get argumentList => _argumentList;
|
|
|
| + /**
|
| + * Set the list of arguments to the method to the given list.
|
| + *
|
| + * @param argumentList the list of arguments to the method
|
| + */
|
| + void set argumentList(ArgumentList argumentList) {
|
| + _argumentList = becomeParentOf(argumentList);
|
| + }
|
| +
|
| @override
|
| Token get beginToken => _function.beginToken;
|
|
|
| @@ -8186,18 +8625,6 @@ class FunctionExpressionInvocation extends Expression {
|
| */
|
| Expression get function => _function;
|
|
|
| - @override
|
| - int get precedence => 15;
|
| -
|
| - /**
|
| - * Set the list of arguments to the method to the given list.
|
| - *
|
| - * @param argumentList the list of arguments to the method
|
| - */
|
| - void set argumentList(ArgumentList argumentList) {
|
| - _argumentList = becomeParentOf(argumentList);
|
| - }
|
| -
|
| /**
|
| * Set the expression producing the function being invoked to the given expression.
|
| *
|
| @@ -8208,6 +8635,12 @@ class FunctionExpressionInvocation extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 15;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionExpressionInvocation(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_function, visitor);
|
| safelyVisitChild(_argumentList, visitor);
|
| @@ -8260,7 +8693,10 @@ class FunctionTypeAlias extends TypeAlias {
|
| * @param parameters the parameters associated with the function
|
| * @param semicolon the semicolon terminating the declaration
|
| */
|
| - FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters, FormalParameterList parameters, Token semicolon) : super(comment, metadata, keyword, semicolon) {
|
| + FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
|
| + TypeName returnType, SimpleIdentifier name, TypeParameterList typeParameters,
|
| + FormalParameterList parameters, Token semicolon)
|
| + : super(comment, metadata, keyword, semicolon) {
|
| _returnType = becomeParentOf(returnType);
|
| _name = becomeParentOf(name);
|
| _typeParameters = becomeParentOf(typeParameters);
|
| @@ -8268,10 +8704,8 @@ class FunctionTypeAlias extends TypeAlias {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this);
|
| -
|
| - @override
|
| - FunctionTypeAliasElement get element => _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null;
|
| + FunctionTypeAliasElement get element =>
|
| + _name != null ? (_name.staticElement as FunctionTypeAliasElement) : null;
|
|
|
| /**
|
| * Return the name of the function type being declared.
|
| @@ -8281,29 +8715,6 @@ class FunctionTypeAlias extends TypeAlias {
|
| SimpleIdentifier get name => _name;
|
|
|
| /**
|
| - * Return the parameters associated with the function type.
|
| - *
|
| - * @return the parameters associated with the function type
|
| - */
|
| - FormalParameterList get parameters => _parameters;
|
| -
|
| - /**
|
| - * Return the name of the return type of the function type being defined, or `null` if no
|
| - * return type was given.
|
| - *
|
| - * @return the name of the return type of the function type being defined
|
| - */
|
| - TypeName get returnType => _returnType;
|
| -
|
| - /**
|
| - * Return the type parameters for the function type, or `null` if the function type does not
|
| - * have any type parameters.
|
| - *
|
| - * @return the type parameters for the function type
|
| - */
|
| - TypeParameterList get typeParameters => _typeParameters;
|
| -
|
| - /**
|
| * Set the name of the function type being declared to the given identifier.
|
| *
|
| * @param name the name of the function type being declared
|
| @@ -8313,6 +8724,13 @@ class FunctionTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the parameters associated with the function type.
|
| + *
|
| + * @return the parameters associated with the function type
|
| + */
|
| + FormalParameterList get parameters => _parameters;
|
| +
|
| + /**
|
| * Set the parameters associated with the function type to the given list of parameters.
|
| *
|
| * @param parameters the parameters associated with the function type
|
| @@ -8322,6 +8740,14 @@ class FunctionTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the name of the return type of the function type being defined, or `null` if no
|
| + * return type was given.
|
| + *
|
| + * @return the name of the return type of the function type being defined
|
| + */
|
| + TypeName get returnType => _returnType;
|
| +
|
| + /**
|
| * Set the name of the return type of the function type being defined to the given type name.
|
| *
|
| * @param typeName the name of the return type of the function type being defined
|
| @@ -8331,6 +8757,14 @@ class FunctionTypeAlias extends TypeAlias {
|
| }
|
|
|
| /**
|
| + * Return the type parameters for the function type, or `null` if the function type does not
|
| + * have any type parameters.
|
| + *
|
| + * @return the type parameters for the function type
|
| + */
|
| + TypeParameterList get typeParameters => _typeParameters;
|
| +
|
| + /**
|
| * Set the type parameters for the function type to the given list of parameters.
|
| *
|
| * @param typeParameters the type parameters for the function type
|
| @@ -8340,6 +8774,9 @@ class FunctionTypeAlias extends TypeAlias {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionTypeAlias(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_returnType, visitor);
|
| @@ -8379,15 +8816,15 @@ class FunctionTypedFormalParameter extends NormalFormalParameter {
|
| * @param identifier the name of the function-typed parameter
|
| * @param parameters the parameters of the function-typed parameter
|
| */
|
| - FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, TypeName returnType, SimpleIdentifier identifier, FormalParameterList parameters) : super(comment, metadata, identifier) {
|
| + FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata,
|
| + TypeName returnType, SimpleIdentifier identifier,
|
| + FormalParameterList parameters)
|
| + : super(comment, metadata, identifier) {
|
| _returnType = becomeParentOf(returnType);
|
| _parameters = becomeParentOf(parameters);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (_returnType != null) {
|
| return _returnType.beginToken;
|
| @@ -8398,6 +8835,12 @@ class FunctionTypedFormalParameter extends NormalFormalParameter {
|
| @override
|
| Token get endToken => _parameters.endToken;
|
|
|
| + @override
|
| + bool get isConst => false;
|
| +
|
| + @override
|
| + bool get isFinal => false;
|
| +
|
| /**
|
| * Return the parameters of the function-typed parameter.
|
| *
|
| @@ -8406,20 +8849,6 @@ class FunctionTypedFormalParameter extends NormalFormalParameter {
|
| FormalParameterList get parameters => _parameters;
|
|
|
| /**
|
| - * Return the return type of the function, or `null` if the function does not have a return
|
| - * type.
|
| - *
|
| - * @return the return type of the function
|
| - */
|
| - TypeName get returnType => _returnType;
|
| -
|
| - @override
|
| - bool get isConst => false;
|
| -
|
| - @override
|
| - bool get isFinal => false;
|
| -
|
| - /**
|
| * Set the parameters of the function-typed parameter to the given parameters.
|
| *
|
| * @param parameters the parameters of the function-typed parameter
|
| @@ -8429,6 +8858,14 @@ class FunctionTypedFormalParameter extends NormalFormalParameter {
|
| }
|
|
|
| /**
|
| + * Return the return type of the function, or `null` if the function does not have a return
|
| + * type.
|
| + *
|
| + * @return the return type of the function
|
| + */
|
| + TypeName get returnType => _returnType;
|
| +
|
| + /**
|
| * Set the return type of the function to the given type.
|
| *
|
| * @param returnType the return type of the function
|
| @@ -8438,6 +8875,9 @@ class FunctionTypedFormalParameter extends NormalFormalParameter {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitFunctionTypedFormalParameter(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_returnType, visitor);
|
| @@ -8481,7 +8921,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitAssertStatement(AssertStatement node) => visitStatement(node);
|
|
|
| @override
|
| - R visitAssignmentExpression(AssignmentExpression node) => visitExpression(node);
|
| + R visitAssignmentExpression(AssignmentExpression node) =>
|
| + visitExpression(node);
|
|
|
| @override
|
| R visitAwaitExpression(AwaitExpression node) => visitExpression(node);
|
| @@ -8508,7 +8949,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitCatchClause(CatchClause node) => visitNode(node);
|
|
|
| @override
|
| - R visitClassDeclaration(ClassDeclaration node) => visitCompilationUnitMember(node);
|
| + R visitClassDeclaration(ClassDeclaration node) =>
|
| + visitCompilationUnitMember(node);
|
|
|
| R visitClassMember(ClassMember node) => visitDeclaration(node);
|
|
|
| @@ -8526,16 +8968,20 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| @override
|
| R visitCompilationUnit(CompilationUnit node) => visitNode(node);
|
|
|
| - R visitCompilationUnitMember(CompilationUnitMember node) => visitDeclaration(node);
|
| + R visitCompilationUnitMember(CompilationUnitMember node) =>
|
| + visitDeclaration(node);
|
|
|
| @override
|
| - R visitConditionalExpression(ConditionalExpression node) => visitExpression(node);
|
| + R visitConditionalExpression(ConditionalExpression node) =>
|
| + visitExpression(node);
|
|
|
| @override
|
| - R visitConstructorDeclaration(ConstructorDeclaration node) => visitClassMember(node);
|
| + R visitConstructorDeclaration(ConstructorDeclaration node) =>
|
| + visitClassMember(node);
|
|
|
| @override
|
| - R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitConstructorInitializer(node);
|
| + R visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
|
| + visitConstructorInitializer(node);
|
|
|
| R visitConstructorInitializer(ConstructorInitializer node) => visitNode(node);
|
|
|
| @@ -8551,7 +8997,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitDeclaredIdentifier(DeclaredIdentifier node) => visitDeclaration(node);
|
|
|
| @override
|
| - R visitDefaultFormalParameter(DefaultFormalParameter node) => visitFormalParameter(node);
|
| + R visitDefaultFormalParameter(DefaultFormalParameter node) =>
|
| + visitFormalParameter(node);
|
|
|
| R visitDirective(Directive node) => visitAnnotatedNode(node);
|
|
|
| @@ -8568,10 +9015,12 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitEmptyStatement(EmptyStatement node) => visitStatement(node);
|
|
|
| @override
|
| - R visitEnumConstantDeclaration(EnumConstantDeclaration node) => visitDeclaration(node);
|
| + R visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
|
| + visitDeclaration(node);
|
|
|
| @override
|
| - R visitEnumDeclaration(EnumDeclaration node) => visitCompilationUnitMember(node);
|
| + R visitEnumDeclaration(EnumDeclaration node) =>
|
| + visitCompilationUnitMember(node);
|
|
|
| @override
|
| R visitExportDirective(ExportDirective node) => visitNamespaceDirective(node);
|
| @@ -8579,7 +9028,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitExpression(Expression node) => visitNode(node);
|
|
|
| @override
|
| - R visitExpressionFunctionBody(ExpressionFunctionBody node) => visitFunctionBody(node);
|
| + R visitExpressionFunctionBody(ExpressionFunctionBody node) =>
|
| + visitFunctionBody(node);
|
|
|
| @override
|
| R visitExpressionStatement(ExpressionStatement node) => visitStatement(node);
|
| @@ -8591,7 +9041,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitFieldDeclaration(FieldDeclaration node) => visitClassMember(node);
|
|
|
| @override
|
| - R visitFieldFormalParameter(FieldFormalParameter node) => visitNormalFormalParameter(node);
|
| + R visitFieldFormalParameter(FieldFormalParameter node) =>
|
| + visitNormalFormalParameter(node);
|
|
|
| @override
|
| R visitForEachStatement(ForEachStatement node) => visitStatement(node);
|
| @@ -8607,22 +9058,26 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitFunctionBody(FunctionBody node) => visitNode(node);
|
|
|
| @override
|
| - R visitFunctionDeclaration(FunctionDeclaration node) => visitCompilationUnitMember(node);
|
| + R visitFunctionDeclaration(FunctionDeclaration node) =>
|
| + visitCompilationUnitMember(node);
|
|
|
| @override
|
| - R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visitStatement(node);
|
| + R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
|
| + visitStatement(node);
|
|
|
| @override
|
| R visitFunctionExpression(FunctionExpression node) => visitExpression(node);
|
|
|
| @override
|
| - R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visitExpression(node);
|
| + R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
|
| + visitExpression(node);
|
|
|
| @override
|
| R visitFunctionTypeAlias(FunctionTypeAlias node) => visitTypeAlias(node);
|
|
|
| @override
|
| - R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visitNormalFormalParameter(node);
|
| + R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
|
| + visitNormalFormalParameter(node);
|
|
|
| @override
|
| R visitHideCombinator(HideCombinator node) => visitCombinator(node);
|
| @@ -8642,7 +9097,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitIndexExpression(IndexExpression node) => visitExpression(node);
|
|
|
| @override
|
| - R visitInstanceCreationExpression(InstanceCreationExpression node) => visitExpression(node);
|
| + R visitInstanceCreationExpression(InstanceCreationExpression node) =>
|
| + visitExpression(node);
|
|
|
| @override
|
| R visitIntegerLiteral(IntegerLiteral node) => visitLiteral(node);
|
| @@ -8650,10 +9106,12 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitInterpolationElement(InterpolationElement node) => visitNode(node);
|
|
|
| @override
|
| - R visitInterpolationExpression(InterpolationExpression node) => visitInterpolationElement(node);
|
| + R visitInterpolationExpression(InterpolationExpression node) =>
|
| + visitInterpolationElement(node);
|
|
|
| @override
|
| - R visitInterpolationString(InterpolationString node) => visitInterpolationElement(node);
|
| + R visitInterpolationString(InterpolationString node) =>
|
| + visitInterpolationElement(node);
|
|
|
| @override
|
| R visitIsExpression(IsExpression node) => visitExpression(node);
|
| @@ -8690,7 +9148,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| @override
|
| R visitNamedExpression(NamedExpression node) => visitExpression(node);
|
|
|
| - R visitNamespaceDirective(NamespaceDirective node) => visitUriBasedDirective(node);
|
| + R visitNamespaceDirective(NamespaceDirective node) =>
|
| + visitUriBasedDirective(node);
|
|
|
| @override
|
| R visitNativeClause(NativeClause node) => visitNode(node);
|
| @@ -8703,13 +9162,15 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| return null;
|
| }
|
|
|
| - R visitNormalFormalParameter(NormalFormalParameter node) => visitFormalParameter(node);
|
| + R visitNormalFormalParameter(NormalFormalParameter node) =>
|
| + visitFormalParameter(node);
|
|
|
| @override
|
| R visitNullLiteral(NullLiteral node) => visitLiteral(node);
|
|
|
| @override
|
| - R visitParenthesizedExpression(ParenthesizedExpression node) => visitExpression(node);
|
| + R visitParenthesizedExpression(ParenthesizedExpression node) =>
|
| + visitExpression(node);
|
|
|
| @override
|
| R visitPartDirective(PartDirective node) => visitUriBasedDirective(node);
|
| @@ -8730,7 +9191,9 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitPropertyAccess(PropertyAccess node) => visitExpression(node);
|
|
|
| @override
|
| - R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitConstructorInitializer(node);
|
| + R
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
|
| + visitConstructorInitializer(node);
|
|
|
| @override
|
| R visitRethrowExpression(RethrowExpression node) => visitExpression(node);
|
| @@ -8745,25 +9208,30 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitShowCombinator(ShowCombinator node) => visitCombinator(node);
|
|
|
| @override
|
| - R visitSimpleFormalParameter(SimpleFormalParameter node) => visitNormalFormalParameter(node);
|
| + R visitSimpleFormalParameter(SimpleFormalParameter node) =>
|
| + visitNormalFormalParameter(node);
|
|
|
| @override
|
| R visitSimpleIdentifier(SimpleIdentifier node) => visitIdentifier(node);
|
|
|
| @override
|
| - R visitSimpleStringLiteral(SimpleStringLiteral node) => visitSingleStringLiteral(node);
|
| + R visitSimpleStringLiteral(SimpleStringLiteral node) =>
|
| + visitSingleStringLiteral(node);
|
|
|
| - R visitSingleStringLiteral(SingleStringLiteral node) => visitStringLiteral(node);
|
| + R visitSingleStringLiteral(SingleStringLiteral node) =>
|
| + visitStringLiteral(node);
|
|
|
| R visitStatement(Statement node) => visitNode(node);
|
|
|
| @override
|
| - R visitStringInterpolation(StringInterpolation node) => visitSingleStringLiteral(node);
|
| + R visitStringInterpolation(StringInterpolation node) =>
|
| + visitSingleStringLiteral(node);
|
|
|
| R visitStringLiteral(StringLiteral node) => visitLiteral(node);
|
|
|
| @override
|
| - R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitConstructorInitializer(node);
|
| + R visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
|
| + visitConstructorInitializer(node);
|
|
|
| @override
|
| R visitSuperExpression(SuperExpression node) => visitExpression(node);
|
| @@ -8789,7 +9257,8 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitThrowExpression(ThrowExpression node) => visitExpression(node);
|
|
|
| @override
|
| - R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitCompilationUnitMember(node);
|
| + R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
|
| + visitCompilationUnitMember(node);
|
|
|
| @override
|
| R visitTryStatement(TryStatement node) => visitStatement(node);
|
| @@ -8813,13 +9282,16 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitUriBasedDirective(UriBasedDirective node) => visitDirective(node);
|
|
|
| @override
|
| - R visitVariableDeclaration(VariableDeclaration node) => visitDeclaration(node);
|
| + R visitVariableDeclaration(VariableDeclaration node) =>
|
| + visitDeclaration(node);
|
|
|
| @override
|
| - R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node);
|
| + R visitVariableDeclarationList(VariableDeclarationList node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| - R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visitStatement(node);
|
| + R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
|
| + visitStatement(node);
|
|
|
| @override
|
| R visitWhileStatement(WhileStatement node) => visitStatement(node);
|
| @@ -8831,10 +9303,12 @@ class GeneralizingAstVisitor<R> implements AstVisitor<R> {
|
| R visitYieldStatement(YieldStatement node) => visitStatement(node);
|
| }
|
|
|
| -class GeneralizingAstVisitor_BreadthFirstVisitor extends GeneralizingAstVisitor<Object> {
|
| +class GeneralizingAstVisitor_BreadthFirstVisitor extends
|
| + GeneralizingAstVisitor<Object> {
|
| final BreadthFirstVisitor BreadthFirstVisitor_this;
|
|
|
| - GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this) : super();
|
| + GeneralizingAstVisitor_BreadthFirstVisitor(this.BreadthFirstVisitor_this)
|
| + : super();
|
|
|
| @override
|
| Object visitNode(AstNode node) {
|
| @@ -8864,14 +9338,12 @@ class HideCombinator extends Combinator {
|
| * @param keyword the comma introducing the combinator
|
| * @param hiddenNames the list of names from the library that are hidden by this combinator
|
| */
|
| - HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames) : super(keyword) {
|
| + HideCombinator(Token keyword, List<SimpleIdentifier> hiddenNames)
|
| + : super(keyword) {
|
| _hiddenNames = new NodeList<SimpleIdentifier>(this, hiddenNames);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitHideCombinator(this);
|
| -
|
| - @override
|
| Token get endToken => _hiddenNames.endToken;
|
|
|
| /**
|
| @@ -8882,6 +9354,9 @@ class HideCombinator extends Combinator {
|
| NodeList<SimpleIdentifier> get hiddenNames => _hiddenNames;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitHideCombinator(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _hiddenNames.accept(visitor);
|
| }
|
| @@ -8899,15 +9374,6 @@ class HideCombinator extends Combinator {
|
| */
|
| abstract class Identifier extends Expression {
|
| /**
|
| - * Return `true` if the given name is visible only within the library in which it is
|
| - * declared.
|
| - *
|
| - * @param name the name being tested
|
| - * @return `true` if the given name is private
|
| - */
|
| - static bool isPrivateName(String name) => StringUtilities.startsWithChar(name, 0x5F);
|
| -
|
| - /**
|
| * Return the best element available for this operator. If resolution was able to find a better
|
| * element based on type propagation, that element will be returned. Otherwise, the element found
|
| * using the result of static analysis will be returned. If resolution has not been performed,
|
| @@ -8917,6 +9383,9 @@ abstract class Identifier extends Expression {
|
| */
|
| Element get bestElement;
|
|
|
| + @override
|
| + bool get isAssignable => true;
|
| +
|
| /**
|
| * Return the lexical representation of the identifier.
|
| *
|
| @@ -8944,8 +9413,15 @@ abstract class Identifier extends Expression {
|
| */
|
| Element get staticElement;
|
|
|
| - @override
|
| - bool get isAssignable => true;
|
| + /**
|
| + * Return `true` if the given name is visible only within the library in which it is
|
| + * declared.
|
| + *
|
| + * @param name the name being tested
|
| + * @return `true` if the given name is private
|
| + */
|
| + static bool isPrivateName(String name) =>
|
| + StringUtilities.startsWithChar(name, 0x5F);
|
| }
|
|
|
| /**
|
| @@ -9004,16 +9480,15 @@ class IfStatement extends Statement {
|
| * @param elseKeyword the token representing the 'else' keyword
|
| * @param elseStatement the statement that is executed if the condition evaluates to `false`
|
| */
|
| - IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, this.rightParenthesis, Statement thenStatement, this.elseKeyword, Statement elseStatement) {
|
| + IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition,
|
| + this.rightParenthesis, Statement thenStatement, this.elseKeyword,
|
| + Statement elseStatement) {
|
| _condition = becomeParentOf(condition);
|
| _thenStatement = becomeParentOf(thenStatement);
|
| _elseStatement = becomeParentOf(elseStatement);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitIfStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => ifKeyword;
|
|
|
| /**
|
| @@ -9024,6 +9499,16 @@ class IfStatement extends Statement {
|
| Expression get condition => _condition;
|
|
|
| /**
|
| + * Set the condition used to determine which of the statements is executed next to the given
|
| + * expression.
|
| + *
|
| + * @param expression the condition used to determine which statement is executed next
|
| + */
|
| + void set condition(Expression expression) {
|
| + _condition = becomeParentOf(expression);
|
| + }
|
| +
|
| + /**
|
| * Return the statement that is executed if the condition evaluates to `false`, or
|
| * `null` if there is no else statement.
|
| *
|
| @@ -9031,6 +9516,16 @@ class IfStatement extends Statement {
|
| */
|
| Statement get elseStatement => _elseStatement;
|
|
|
| + /**
|
| + * Set the statement that is executed if the condition evaluates to `false` to the given
|
| + * statement.
|
| + *
|
| + * @param statement the statement that is executed if the condition evaluates to `false`
|
| + */
|
| + void set elseStatement(Statement statement) {
|
| + _elseStatement = becomeParentOf(statement);
|
| + }
|
| +
|
| @override
|
| Token get endToken {
|
| if (_elseStatement != null) {
|
| @@ -9047,26 +9542,6 @@ class IfStatement extends Statement {
|
| Statement get thenStatement => _thenStatement;
|
|
|
| /**
|
| - * Set the condition used to determine which of the statements is executed next to the given
|
| - * expression.
|
| - *
|
| - * @param expression the condition used to determine which statement is executed next
|
| - */
|
| - void set condition(Expression expression) {
|
| - _condition = becomeParentOf(expression);
|
| - }
|
| -
|
| - /**
|
| - * Set the statement that is executed if the condition evaluates to `false` to the given
|
| - * statement.
|
| - *
|
| - * @param statement the statement that is executed if the condition evaluates to `false`
|
| - */
|
| - void set elseStatement(Statement statement) {
|
| - _elseStatement = becomeParentOf(statement);
|
| - }
|
| -
|
| - /**
|
| * Set the statement that is executed if the condition evaluates to `true` to the given
|
| * statement.
|
| *
|
| @@ -9077,6 +9552,9 @@ class IfStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitIfStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_condition, visitor);
|
| safelyVisitChild(_thenStatement, visitor);
|
| @@ -9115,9 +9593,6 @@ class ImplementsClause extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitImplementsClause(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -9131,6 +9606,9 @@ class ImplementsClause extends AstNode {
|
| NodeList<TypeName> get interfaces => _interfaces;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitImplementsClause(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _interfaces.accept(visitor);
|
| }
|
| @@ -9146,7 +9624,8 @@ class ImplementsClause extends AstNode {
|
| * </pre>
|
| */
|
| class ImportDirective extends NamespaceDirective {
|
| - static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1, ImportDirective import2) {
|
| + static Comparator<ImportDirective> COMPARATOR =
|
| + (ImportDirective import1, ImportDirective import2) {
|
| //
|
| // uri
|
| //
|
| @@ -9198,7 +9677,8 @@ class ImportDirective extends NamespaceDirective {
|
| allHides1.add(simpleIdentifier.name);
|
| }
|
| } else {
|
| - NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownNames;
|
| + NodeList<SimpleIdentifier> shows =
|
| + (combinator as ShowCombinator).shownNames;
|
| for (SimpleIdentifier simpleIdentifier in shows) {
|
| allShows1.add(simpleIdentifier.name);
|
| }
|
| @@ -9214,7 +9694,8 @@ class ImportDirective extends NamespaceDirective {
|
| allHides2.add(simpleIdentifier.name);
|
| }
|
| } else {
|
| - NodeList<SimpleIdentifier> shows = (combinator as ShowCombinator).shownNames;
|
| + NodeList<SimpleIdentifier> shows =
|
| + (combinator as ShowCombinator).shownNames;
|
| for (SimpleIdentifier simpleIdentifier in shows) {
|
| allShows2.add(simpleIdentifier.name);
|
| }
|
| @@ -9266,14 +9747,14 @@ class ImportDirective extends NamespaceDirective {
|
| * @param combinators the combinators used to control how names are imported
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, StringLiteral libraryUri, this.deferredToken, this.asToken, SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
|
| + ImportDirective(Comment comment, List<Annotation> metadata, Token keyword,
|
| + StringLiteral libraryUri, this.deferredToken, this.asToken,
|
| + SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon)
|
| + : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
|
| _prefix = becomeParentOf(prefix);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitImportDirective(this);
|
| -
|
| - @override
|
| ImportElement get element => super.element as ImportElement;
|
|
|
| /**
|
| @@ -9284,6 +9765,15 @@ class ImportDirective extends NamespaceDirective {
|
| */
|
| SimpleIdentifier get prefix => _prefix;
|
|
|
| + /**
|
| + * Set the prefix to be used with the imported names to the given identifier.
|
| + *
|
| + * @param prefix the prefix to be used with the imported names
|
| + */
|
| + void set prefix(SimpleIdentifier prefix) {
|
| + _prefix = becomeParentOf(prefix);
|
| + }
|
| +
|
| @override
|
| LibraryElement get uriElement {
|
| ImportElement element = this.element;
|
| @@ -9293,14 +9783,8 @@ class ImportDirective extends NamespaceDirective {
|
| return element.importedLibrary;
|
| }
|
|
|
| - /**
|
| - * Set the prefix to be used with the imported names to the given identifier.
|
| - *
|
| - * @param prefix the prefix to be used with the imported names
|
| - */
|
| - void set prefix(SimpleIdentifier prefix) {
|
| - _prefix = becomeParentOf(prefix);
|
| - }
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitImportDirective(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| @@ -9343,32 +9827,54 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap);
|
|
|
| @override
|
| - AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStrings(_cloneNodeList(node.strings));
|
| + AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
|
| + new AdjacentStrings(_cloneNodeList(node.strings));
|
|
|
| @override
|
| Annotation visitAnnotation(Annotation node) {
|
| - Annotation copy = new Annotation(_mapToken(node.atSign), _cloneNode(node.name), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.arguments));
|
| + Annotation copy = new Annotation(
|
| + _mapToken(node.atSign),
|
| + _cloneNode(node.name),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.constructorName),
|
| + _cloneNode(node.arguments));
|
| copy.element = node.element;
|
| return copy;
|
| }
|
|
|
| @override
|
| - ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(_mapToken(node.leftParenthesis), _cloneNodeList(node.arguments), _mapToken(node.rightParenthesis));
|
| + ArgumentList visitArgumentList(ArgumentList node) =>
|
| + new ArgumentList(
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNodeList(node.arguments),
|
| + _mapToken(node.rightParenthesis));
|
|
|
| @override
|
| AsExpression visitAsExpression(AsExpression node) {
|
| - AsExpression copy = new AsExpression(_cloneNode(node.expression), _mapToken(node.asOperator), _cloneNode(node.type));
|
| + AsExpression copy = new AsExpression(
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.asOperator),
|
| + _cloneNode(node.type));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _mapToken(node.semicolon));
|
| + AstNode visitAssertStatement(AssertStatement node) =>
|
| + new AssertStatement(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.rightParenthesis),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
|
| - AssignmentExpression copy = new AssignmentExpression(_cloneNode(node.leftHandSide), _mapToken(node.operator), _cloneNode(node.rightHandSide));
|
| + AssignmentExpression copy = new AssignmentExpression(
|
| + _cloneNode(node.leftHandSide),
|
| + _mapToken(node.operator),
|
| + _cloneNode(node.rightHandSide));
|
| copy.propagatedElement = node.propagatedElement;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| @@ -9377,11 +9883,15 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - AwaitExpression visitAwaitExpression(AwaitExpression node) => new AwaitExpression(_mapToken(node.awaitKeyword), _cloneNode(node.expression));
|
| + AwaitExpression visitAwaitExpression(AwaitExpression node) =>
|
| + new AwaitExpression(_mapToken(node.awaitKeyword), _cloneNode(node.expression));
|
|
|
| @override
|
| BinaryExpression visitBinaryExpression(BinaryExpression node) {
|
| - BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), _mapToken(node.operator), _cloneNode(node.rightOperand));
|
| + BinaryExpression copy = new BinaryExpression(
|
| + _cloneNode(node.leftOperand),
|
| + _mapToken(node.operator),
|
| + _cloneNode(node.rightOperand));
|
| copy.propagatedElement = node.propagatedElement;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| @@ -9390,47 +9900,98 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), _cloneNodeList(node.statements), _mapToken(node.rightBracket));
|
| + Block visitBlock(Block node) =>
|
| + new Block(
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.statements),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| - BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block));
|
| + BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
|
| + new BlockFunctionBody(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.star),
|
| + _cloneNode(node.block));
|
|
|
| @override
|
| BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
|
| - BooleanLiteral copy = new BooleanLiteral(_mapToken(node.literal), node.value);
|
| + BooleanLiteral copy =
|
| + new BooleanLiteral(_mapToken(node.literal), node.value);
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(_mapToken(node.keyword), _cloneNode(node.label), _mapToken(node.semicolon));
|
| + BreakStatement visitBreakStatement(BreakStatement node) =>
|
| + new BreakStatement(
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.label),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| CascadeExpression visitCascadeExpression(CascadeExpression node) {
|
| - CascadeExpression copy = new CascadeExpression(_cloneNode(node.target), _cloneNodeList(node.cascadeSections));
|
| + CascadeExpression copy = new CascadeExpression(
|
| + _cloneNode(node.target),
|
| + _cloneNodeList(node.cascadeSections));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - CatchClause visitCatchClause(CatchClause node) => new CatchClause(_mapToken(node.onKeyword), _cloneNode(node.exceptionType), _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.exceptionParameter), _mapToken(node.comma), _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis), _cloneNode(node.body));
|
| + CatchClause visitCatchClause(CatchClause node) =>
|
| + new CatchClause(
|
| + _mapToken(node.onKeyword),
|
| + _cloneNode(node.exceptionType),
|
| + _mapToken(node.catchKeyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.exceptionParameter),
|
| + _mapToken(node.comma),
|
| + _cloneNode(node.stackTraceParameter),
|
| + _mapToken(node.rightParenthesis),
|
| + _cloneNode(node.body));
|
|
|
| @override
|
| ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
|
| - ClassDeclaration copy = new ClassDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.abstractKeyword), _mapToken(node.classKeyword), _cloneNode(node.name), _cloneNode(node.typeParameters), _cloneNode(node.extendsClause), _cloneNode(node.withClause), _cloneNode(node.implementsClause), _mapToken(node.leftBracket), _cloneNodeList(node.members), _mapToken(node.rightBracket));
|
| + ClassDeclaration copy = new ClassDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.abstractKeyword),
|
| + _mapToken(node.classKeyword),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.typeParameters),
|
| + _cloneNode(node.extendsClause),
|
| + _cloneNode(node.withClause),
|
| + _cloneNode(node.implementsClause),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.members),
|
| + _mapToken(node.rightBracket));
|
| copy.nativeClause = _cloneNode(node.nativeClause);
|
| return copy;
|
| }
|
|
|
| @override
|
| - ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.name), _cloneNode(node.typeParameters), _mapToken(node.equals), _mapToken(node.abstractKeyword), _cloneNode(node.superclass), _cloneNode(node.withClause), _cloneNode(node.implementsClause), _mapToken(node.semicolon));
|
| + ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) =>
|
| + new ClassTypeAlias(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.typeParameters),
|
| + _mapToken(node.equals),
|
| + _mapToken(node.abstractKeyword),
|
| + _cloneNode(node.superclass),
|
| + _cloneNode(node.withClause),
|
| + _cloneNode(node.implementsClause),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| Comment visitComment(Comment node) {
|
| if (node.isDocumentation) {
|
| - return Comment.createDocumentationCommentWithReferences(_mapTokens(node.tokens), _cloneNodeList(node.references));
|
| + return Comment.createDocumentationCommentWithReferences(
|
| + _mapTokens(node.tokens),
|
| + _cloneNodeList(node.references));
|
| } else if (node.isBlock) {
|
| return Comment.createBlockComment(_mapTokens(node.tokens));
|
| }
|
| @@ -9438,11 +9999,17 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - CommentReference visitCommentReference(CommentReference node) => new CommentReference(_mapToken(node.newKeyword), _cloneNode(node.identifier));
|
| + CommentReference visitCommentReference(CommentReference node) =>
|
| + new CommentReference(_mapToken(node.newKeyword), _cloneNode(node.identifier));
|
|
|
| @override
|
| CompilationUnit visitCompilationUnit(CompilationUnit node) {
|
| - CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken), _cloneNode(node.scriptTag), _cloneNodeList(node.directives), _cloneNodeList(node.declarations), _mapToken(node.endToken));
|
| + CompilationUnit copy = new CompilationUnit(
|
| + _mapToken(node.beginToken),
|
| + _cloneNode(node.scriptTag),
|
| + _cloneNodeList(node.directives),
|
| + _cloneNodeList(node.declarations),
|
| + _mapToken(node.endToken));
|
| copy.lineInfo = node.lineInfo;
|
| copy.element = node.element;
|
| return copy;
|
| @@ -9450,40 +10017,93 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
|
| - ConditionalExpression copy = new ConditionalExpression(_cloneNode(node.condition), _mapToken(node.question), _cloneNode(node.thenExpression), _mapToken(node.colon), _cloneNode(node.elseExpression));
|
| + ConditionalExpression copy = new ConditionalExpression(
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.question),
|
| + _cloneNode(node.thenExpression),
|
| + _mapToken(node.colon),
|
| + _cloneNode(node.elseExpression));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node) {
|
| - ConstructorDeclaration copy = new ConstructorDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _mapToken(node.constKeyword), _mapToken(node.factoryKeyword), _cloneNode(node.returnType), _mapToken(node.period), _cloneNode(node.name), _cloneNode(node.parameters), _mapToken(node.separator), _cloneNodeList(node.initializers), _cloneNode(node.redirectedConstructor), _cloneNode(node.body));
|
| + ConstructorDeclaration
|
| + visitConstructorDeclaration(ConstructorDeclaration node) {
|
| + ConstructorDeclaration copy = new ConstructorDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.externalKeyword),
|
| + _mapToken(node.constKeyword),
|
| + _mapToken(node.factoryKeyword),
|
| + _cloneNode(node.returnType),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.parameters),
|
| + _mapToken(node.separator),
|
| + _cloneNodeList(node.initializers),
|
| + _cloneNode(node.redirectedConstructor),
|
| + _cloneNode(node.body));
|
| copy.element = node.element;
|
| return copy;
|
| }
|
|
|
| @override
|
| - ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldInitializer node) => new ConstructorFieldInitializer(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.fieldName), _mapToken(node.equals), _cloneNode(node.expression));
|
| + ConstructorFieldInitializer
|
| + visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
|
| + new ConstructorFieldInitializer(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.fieldName),
|
| + _mapToken(node.equals),
|
| + _cloneNode(node.expression));
|
|
|
| @override
|
| ConstructorName visitConstructorName(ConstructorName node) {
|
| - ConstructorName copy = new ConstructorName(_cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name));
|
| + ConstructorName copy = new ConstructorName(
|
| + _cloneNode(node.type),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.name));
|
| copy.staticElement = node.staticElement;
|
| return copy;
|
| }
|
|
|
| @override
|
| - ContinueStatement visitContinueStatement(ContinueStatement node) => new ContinueStatement(_mapToken(node.keyword), _cloneNode(node.label), _mapToken(node.semicolon));
|
| + ContinueStatement visitContinueStatement(ContinueStatement node) =>
|
| + new ContinueStatement(
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.label),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new DeclaredIdentifier(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNode(node.identifier));
|
| + DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
|
| + new DeclaredIdentifier(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.type),
|
| + _cloneNode(node.identifier));
|
|
|
| @override
|
| - DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node) => new DefaultFormalParameter(_cloneNode(node.parameter), node.kind, _mapToken(node.separator), _cloneNode(node.defaultValue));
|
| + DefaultFormalParameter
|
| + visitDefaultFormalParameter(DefaultFormalParameter node) =>
|
| + new DefaultFormalParameter(
|
| + _cloneNode(node.parameter),
|
| + node.kind,
|
| + _mapToken(node.separator),
|
| + _cloneNode(node.defaultValue));
|
|
|
| @override
|
| - DoStatement visitDoStatement(DoStatement node) => new DoStatement(_mapToken(node.doKeyword), _cloneNode(node.body), _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _mapToken(node.semicolon));
|
| + DoStatement visitDoStatement(DoStatement node) =>
|
| + new DoStatement(
|
| + _mapToken(node.doKeyword),
|
| + _cloneNode(node.body),
|
| + _mapToken(node.whileKeyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.rightParenthesis),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
|
| @@ -9494,63 +10114,150 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyFunctionBody(_mapToken(node.semicolon));
|
| + EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
|
| + new EmptyFunctionBody(_mapToken(node.semicolon));
|
|
|
| @override
|
| - EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement(_mapToken(node.semicolon));
|
| + EmptyStatement visitEmptyStatement(EmptyStatement node) =>
|
| + new EmptyStatement(_mapToken(node.semicolon));
|
|
|
| @override
|
| - AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => new EnumConstantDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.name));
|
| + AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
|
| + new EnumConstantDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _cloneNode(node.name));
|
|
|
| @override
|
| - AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.name), _mapToken(node.leftBracket), _cloneNodeList(node.constants), _mapToken(node.rightBracket));
|
| + AstNode visitEnumDeclaration(EnumDeclaration node) =>
|
| + new EnumDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.name),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.constants),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| ExportDirective visitExportDirective(ExportDirective node) {
|
| - ExportDirective copy = new ExportDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.uri), _cloneNodeList(node.combinators), _mapToken(node.semicolon));
|
| + ExportDirective copy = new ExportDirective(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.uri),
|
| + _cloneNodeList(node.combinators),
|
| + _mapToken(node.semicolon));
|
| copy.element = node.element;
|
| return copy;
|
| }
|
|
|
| @override
|
| - ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node) => new ExpressionFunctionBody(_mapToken(node.keyword), _mapToken(node.functionDefinition), _cloneNode(node.expression), _mapToken(node.semicolon));
|
| -
|
| - @override
|
| - ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon));
|
| -
|
| - @override
|
| - ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(_mapToken(node.keyword), _cloneNode(node.superclass));
|
| -
|
| - @override
|
| - FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.staticKeyword), _cloneNode(node.fields), _mapToken(node.semicolon));
|
| -
|
| - @override
|
| - FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => new FieldFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _mapToken(node.thisToken), _mapToken(node.period), _cloneNode(node.identifier), _cloneNode(node.parameters));
|
| + ExpressionFunctionBody
|
| + visitExpressionFunctionBody(ExpressionFunctionBody node) =>
|
| + new ExpressionFunctionBody(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.functionDefinition),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - ForEachStatement visitForEachStatement(ForEachStatement node) {
|
| - DeclaredIdentifier loopVariable = node.loopVariable;
|
| - if (loopVariable == null) {
|
| - return new ForEachStatement.con2(_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), _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(loopVariable), _mapToken(node.inKeyword), _cloneNode(node.iterable), _mapToken(node.rightParenthesis), _cloneNode(node.body));
|
| - }
|
| + ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
|
| + new ExpressionStatement(_cloneNode(node.expression), _mapToken(node.semicolon));
|
|
|
| @override
|
| - FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(_mapToken(node.leftParenthesis), _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter), _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis));
|
| + ExtendsClause visitExtendsClause(ExtendsClause node) =>
|
| + new ExtendsClause(_mapToken(node.keyword), _cloneNode(node.superclass));
|
|
|
| @override
|
| - ForStatement visitForStatement(ForStatement node) => new ForStatement(_mapToken(node.forKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.variables), _cloneNode(node.initialization), _mapToken(node.leftSeparator), _cloneNode(node.condition), _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), _mapToken(node.rightParenthesis), _cloneNode(node.body));
|
| + FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
|
| + new FieldDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.staticKeyword),
|
| + _cloneNode(node.fields),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _cloneNode(node.returnType), _mapToken(node.propertyKeyword), _cloneNode(node.name), _cloneNode(node.functionExpression));
|
| + FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
|
| + new FieldFormalParameter(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.type),
|
| + _mapToken(node.thisToken),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.identifier),
|
| + _cloneNode(node.parameters));
|
|
|
| @override
|
| - FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
|
| + ForEachStatement visitForEachStatement(ForEachStatement node) {
|
| + DeclaredIdentifier loopVariable = node.loopVariable;
|
| + if (loopVariable == null) {
|
| + return new ForEachStatement.con2(
|
| + _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),
|
| + _mapToken(node.forKeyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(loopVariable),
|
| + _mapToken(node.inKeyword),
|
| + _cloneNode(node.iterable),
|
| + _mapToken(node.rightParenthesis),
|
| + _cloneNode(node.body));
|
| + }
|
| +
|
| + @override
|
| + FormalParameterList visitFormalParameterList(FormalParameterList node) =>
|
| + new FormalParameterList(
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNodeList(node.parameters),
|
| + _mapToken(node.leftDelimiter),
|
| + _mapToken(node.rightDelimiter),
|
| + _mapToken(node.rightParenthesis));
|
| +
|
| + @override
|
| + ForStatement visitForStatement(ForStatement node) =>
|
| + new ForStatement(
|
| + _mapToken(node.forKeyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.variables),
|
| + _cloneNode(node.initialization),
|
| + _mapToken(node.leftSeparator),
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.rightSeparator),
|
| + _cloneNodeList(node.updaters),
|
| + _mapToken(node.rightParenthesis),
|
| + _cloneNode(node.body));
|
| +
|
| + @override
|
| + FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
|
| + new FunctionDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.externalKeyword),
|
| + _cloneNode(node.returnType),
|
| + _mapToken(node.propertyKeyword),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.functionExpression));
|
| +
|
| + @override
|
| + FunctionDeclarationStatement
|
| + visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
|
| + new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
|
|
|
| @override
|
| FunctionExpression visitFunctionExpression(FunctionExpression node) {
|
| - FunctionExpression copy = new FunctionExpression(_cloneNode(node.parameters), _cloneNode(node.body));
|
| + FunctionExpression copy =
|
| + new FunctionExpression(_cloneNode(node.parameters), _cloneNode(node.body));
|
| copy.element = node.element;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| @@ -9558,8 +10265,11 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
|
| - FunctionExpressionInvocation copy = new FunctionExpressionInvocation(_cloneNode(node.function), _cloneNode(node.argumentList));
|
| + FunctionExpressionInvocation
|
| + visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
|
| + FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
|
| + _cloneNode(node.function),
|
| + _cloneNode(node.argumentList));
|
| copy.propagatedElement = node.propagatedElement;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| @@ -9568,31 +10278,75 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new FunctionTypeAlias(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.returnType), _cloneNode(node.name), _cloneNode(node.typeParameters), _cloneNode(node.parameters), _mapToken(node.semicolon));
|
| + FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
|
| + new FunctionTypeAlias(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.returnType),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.typeParameters),
|
| + _cloneNode(node.parameters),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.returnType), _cloneNode(node.identifier), _cloneNode(node.parameters));
|
| + FunctionTypedFormalParameter
|
| + visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
|
| + new FunctionTypedFormalParameter(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _cloneNode(node.returnType),
|
| + _cloneNode(node.identifier),
|
| + _cloneNode(node.parameters));
|
|
|
| @override
|
| - HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(_mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
|
| + HideCombinator visitHideCombinator(HideCombinator node) =>
|
| + new HideCombinator(_mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
|
|
|
| @override
|
| - IfStatement visitIfStatement(IfStatement node) => new IfStatement(_mapToken(node.ifKeyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _cloneNode(node.thenStatement), _mapToken(node.elseKeyword), _cloneNode(node.elseStatement));
|
| + IfStatement visitIfStatement(IfStatement node) =>
|
| + new IfStatement(
|
| + _mapToken(node.ifKeyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.rightParenthesis),
|
| + _cloneNode(node.thenStatement),
|
| + _mapToken(node.elseKeyword),
|
| + _cloneNode(node.elseStatement));
|
|
|
| @override
|
| - ImplementsClause visitImplementsClause(ImplementsClause node) => new ImplementsClause(_mapToken(node.keyword), _cloneNodeList(node.interfaces));
|
| + ImplementsClause visitImplementsClause(ImplementsClause node) =>
|
| + new ImplementsClause(_mapToken(node.keyword), _cloneNodeList(node.interfaces));
|
|
|
| @override
|
| - ImportDirective visitImportDirective(ImportDirective node) => new ImportDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.uri), _mapToken(node.deferredToken), _mapToken(node.asToken), _cloneNode(node.prefix), _cloneNodeList(node.combinators), _mapToken(node.semicolon));
|
| + ImportDirective visitImportDirective(ImportDirective node) =>
|
| + new ImportDirective(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.uri),
|
| + _mapToken(node.deferredToken),
|
| + _mapToken(node.asToken),
|
| + _cloneNode(node.prefix),
|
| + _cloneNodeList(node.combinators),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| IndexExpression visitIndexExpression(IndexExpression node) {
|
| Token period = _mapToken(node.period);
|
| IndexExpression copy;
|
| if (period == null) {
|
| - copy = new IndexExpression.forTarget(_cloneNode(node.target), _mapToken(node.leftBracket), _cloneNode(node.index), _mapToken(node.rightBracket));
|
| + copy = new IndexExpression.forTarget(
|
| + _cloneNode(node.target),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNode(node.index),
|
| + _mapToken(node.rightBracket));
|
| } else {
|
| - copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), _cloneNode(node.index), _mapToken(node.rightBracket));
|
| + copy = new IndexExpression.forCascade(
|
| + period,
|
| + _mapToken(node.leftBracket),
|
| + _cloneNode(node.index),
|
| + _mapToken(node.rightBracket));
|
| }
|
| copy.auxiliaryElements = node.auxiliaryElements;
|
| copy.propagatedElement = node.propagatedElement;
|
| @@ -9603,8 +10357,12 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExpression node) {
|
| - InstanceCreationExpression copy = new InstanceCreationExpression(_mapToken(node.keyword), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
|
| + InstanceCreationExpression
|
| + visitInstanceCreationExpression(InstanceCreationExpression node) {
|
| + InstanceCreationExpression copy = new InstanceCreationExpression(
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.constructorName),
|
| + _cloneNode(node.argumentList));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| copy.staticType = node.staticType;
|
| @@ -9613,38 +10371,58 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
|
| - IntegerLiteral copy = new IntegerLiteral(_mapToken(node.literal), node.value);
|
| + IntegerLiteral copy =
|
| + new IntegerLiteral(_mapToken(node.literal), node.value);
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - InterpolationExpression visitInterpolationExpression(InterpolationExpression node) => new InterpolationExpression(_mapToken(node.leftBracket), _cloneNode(node.expression), _mapToken(node.rightBracket));
|
| + InterpolationExpression
|
| + visitInterpolationExpression(InterpolationExpression node) =>
|
| + new InterpolationExpression(
|
| + _mapToken(node.leftBracket),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| - InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(_mapToken(node.contents), node.value);
|
| + InterpolationString visitInterpolationString(InterpolationString node) =>
|
| + new InterpolationString(_mapToken(node.contents), node.value);
|
|
|
| @override
|
| IsExpression visitIsExpression(IsExpression node) {
|
| - IsExpression copy = new IsExpression(_cloneNode(node.expression), _mapToken(node.isOperator), _mapToken(node.notOperator), _cloneNode(node.type));
|
| + IsExpression copy = new IsExpression(
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.isOperator),
|
| + _mapToken(node.notOperator),
|
| + _cloneNode(node.type));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - Label visitLabel(Label node) => new Label(_cloneNode(node.label), _mapToken(node.colon));
|
| + Label visitLabel(Label node) =>
|
| + new Label(_cloneNode(node.label), _mapToken(node.colon));
|
|
|
| @override
|
| - LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledStatement(_cloneNodeList(node.labels), _cloneNode(node.statement));
|
| + LabeledStatement visitLabeledStatement(LabeledStatement node) =>
|
| + new LabeledStatement(_cloneNodeList(node.labels), _cloneNode(node.statement));
|
|
|
| @override
|
| - LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.libraryToken), _cloneNode(node.name), _mapToken(node.semicolon));
|
| + LibraryDirective visitLibraryDirective(LibraryDirective node) =>
|
| + new LibraryDirective(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.libraryToken),
|
| + _cloneNode(node.name),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
|
| - LibraryIdentifier copy = new LibraryIdentifier(_cloneNodeList(node.components));
|
| + LibraryIdentifier copy =
|
| + new LibraryIdentifier(_cloneNodeList(node.components));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9652,7 +10430,12 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| ListLiteral visitListLiteral(ListLiteral node) {
|
| - ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword), _cloneNode(node.typeArguments), _mapToken(node.leftBracket), _cloneNodeList(node.elements), _mapToken(node.rightBracket));
|
| + ListLiteral copy = new ListLiteral(
|
| + _mapToken(node.constKeyword),
|
| + _cloneNode(node.typeArguments),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.elements),
|
| + _mapToken(node.rightBracket));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9660,21 +10443,45 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| MapLiteral visitMapLiteral(MapLiteral node) {
|
| - MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword), _cloneNode(node.typeArguments), _mapToken(node.leftBracket), _cloneNodeList(node.entries), _mapToken(node.rightBracket));
|
| + MapLiteral copy = new MapLiteral(
|
| + _mapToken(node.constKeyword),
|
| + _cloneNode(node.typeArguments),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.entries),
|
| + _mapToken(node.rightBracket));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value));
|
| + MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
|
| + new MapLiteralEntry(
|
| + _cloneNode(node.key),
|
| + _mapToken(node.separator),
|
| + _cloneNode(node.value));
|
|
|
| @override
|
| - MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new MethodDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), _mapToken(node.modifierKeyword), _cloneNode(node.returnType), _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword), _cloneNode(node.name), _cloneNode(node.parameters), _cloneNode(node.body));
|
| + MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
|
| + new MethodDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.externalKeyword),
|
| + _mapToken(node.modifierKeyword),
|
| + _cloneNode(node.returnType),
|
| + _mapToken(node.propertyKeyword),
|
| + _mapToken(node.operatorKeyword),
|
| + _cloneNode(node.name),
|
| + _cloneNode(node.parameters),
|
| + _cloneNode(node.body));
|
|
|
| @override
|
| MethodInvocation visitMethodInvocation(MethodInvocation node) {
|
| - MethodInvocation copy = new MethodInvocation(_cloneNode(node.target), _mapToken(node.period), _cloneNode(node.methodName), _cloneNode(node.argumentList));
|
| + MethodInvocation copy = new MethodInvocation(
|
| + _cloneNode(node.target),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.methodName),
|
| + _cloneNode(node.argumentList));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9682,17 +10489,23 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| NamedExpression visitNamedExpression(NamedExpression node) {
|
| - NamedExpression copy = new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
|
| + NamedExpression copy =
|
| + new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - AstNode visitNativeClause(NativeClause node) => new NativeClause(_mapToken(node.keyword), _cloneNode(node.name));
|
| + AstNode visitNativeClause(NativeClause node) =>
|
| + new NativeClause(_mapToken(node.keyword), _cloneNode(node.name));
|
|
|
| @override
|
| - NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new NativeFunctionBody(_mapToken(node.nativeToken), _cloneNode(node.stringLiteral), _mapToken(node.semicolon));
|
| + NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
|
| + new NativeFunctionBody(
|
| + _mapToken(node.nativeToken),
|
| + _cloneNode(node.stringLiteral),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| NullLiteral visitNullLiteral(NullLiteral node) {
|
| @@ -9703,8 +10516,12 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression node) {
|
| - ParenthesizedExpression copy = new ParenthesizedExpression(_mapToken(node.leftParenthesis), _cloneNode(node.expression), _mapToken(node.rightParenthesis));
|
| + ParenthesizedExpression
|
| + visitParenthesizedExpression(ParenthesizedExpression node) {
|
| + ParenthesizedExpression copy = new ParenthesizedExpression(
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.rightParenthesis));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9712,21 +10529,33 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| PartDirective visitPartDirective(PartDirective node) {
|
| - PartDirective copy = new PartDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.partToken), _cloneNode(node.uri), _mapToken(node.semicolon));
|
| + PartDirective copy = new PartDirective(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.partToken),
|
| + _cloneNode(node.uri),
|
| + _mapToken(node.semicolon));
|
| copy.element = node.element;
|
| return copy;
|
| }
|
|
|
| @override
|
| PartOfDirective visitPartOfDirective(PartOfDirective node) {
|
| - PartOfDirective copy = new PartOfDirective(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.partToken), _mapToken(node.ofToken), _cloneNode(node.libraryName), _mapToken(node.semicolon));
|
| + PartOfDirective copy = new PartOfDirective(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.partToken),
|
| + _mapToken(node.ofToken),
|
| + _cloneNode(node.libraryName),
|
| + _mapToken(node.semicolon));
|
| copy.element = node.element;
|
| return copy;
|
| }
|
|
|
| @override
|
| PostfixExpression visitPostfixExpression(PostfixExpression node) {
|
| - PostfixExpression copy = new PostfixExpression(_cloneNode(node.operand), _mapToken(node.operator));
|
| + PostfixExpression copy =
|
| + new PostfixExpression(_cloneNode(node.operand), _mapToken(node.operator));
|
| copy.propagatedElement = node.propagatedElement;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| @@ -9736,7 +10565,10 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| - PrefixedIdentifier copy = new PrefixedIdentifier(_cloneNode(node.prefix), _mapToken(node.period), _cloneNode(node.identifier));
|
| + PrefixedIdentifier copy = new PrefixedIdentifier(
|
| + _cloneNode(node.prefix),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.identifier));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9744,7 +10576,8 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| PrefixExpression visitPrefixExpression(PrefixExpression node) {
|
| - PrefixExpression copy = new PrefixExpression(_mapToken(node.operator), _cloneNode(node.operand));
|
| + PrefixExpression copy =
|
| + new PrefixExpression(_mapToken(node.operator), _cloneNode(node.operand));
|
| copy.propagatedElement = node.propagatedElement;
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticElement = node.staticElement;
|
| @@ -9754,15 +10587,24 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| PropertyAccess visitPropertyAccess(PropertyAccess node) {
|
| - PropertyAccess copy = new PropertyAccess(_cloneNode(node.target), _mapToken(node.operator), _cloneNode(node.propertyName));
|
| + PropertyAccess copy = new PropertyAccess(
|
| + _cloneNode(node.target),
|
| + _mapToken(node.operator),
|
| + _cloneNode(node.propertyName));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - RedirectingConstructorInvocation visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| - RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
|
| + RedirectingConstructorInvocation
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| + RedirectingConstructorInvocation copy =
|
| + new RedirectingConstructorInvocation(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.constructorName),
|
| + _cloneNode(node.argumentList));
|
| copy.staticElement = node.staticElement;
|
| return copy;
|
| }
|
| @@ -9776,25 +10618,39 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatement(_mapToken(node.keyword), _cloneNode(node.expression), _mapToken(node.semicolon));
|
| + ReturnStatement visitReturnStatement(ReturnStatement node) =>
|
| + new ReturnStatement(
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(_mapToken(node.scriptTag));
|
| + ScriptTag visitScriptTag(ScriptTag node) =>
|
| + new ScriptTag(_mapToken(node.scriptTag));
|
|
|
| @override
|
| - ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames));
|
| + ShowCombinator visitShowCombinator(ShowCombinator node) =>
|
| + new ShowCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames));
|
|
|
| @override
|
| - SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) => new SimpleFormalParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNode(node.identifier));
|
| + SimpleFormalParameter
|
| + visitSimpleFormalParameter(SimpleFormalParameter node) =>
|
| + new SimpleFormalParameter(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.type),
|
| + _cloneNode(node.identifier));
|
|
|
| @override
|
| SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
|
| Token mappedToken = _mapToken(node.token);
|
| if (mappedToken == null) {
|
| - // This only happens for SimpleIdentifiers created by the parser as part of scanning
|
| - // documentation comments (the tokens for those identifiers are not in the original token
|
| - // stream and hence do not get copied). This extra check can be removed if the scanner is
|
| - // changed to scan documentation comments for the parser.
|
| + // This only happens for SimpleIdentifiers created by the parser as part
|
| + // of scanning documentation comments (the tokens for those identifiers
|
| + // are not in the original token stream and hence do not get copied).
|
| + // This extra check can be removed if the scanner is changed to scan
|
| + // documentation comments for the parser.
|
| mappedToken = node.token;
|
| }
|
| SimpleIdentifier copy = new SimpleIdentifier(mappedToken);
|
| @@ -9808,7 +10664,8 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
|
| - SimpleStringLiteral copy = new SimpleStringLiteral(_mapToken(node.literal), node.value);
|
| + SimpleStringLiteral copy =
|
| + new SimpleStringLiteral(_mapToken(node.literal), node.value);
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9816,15 +10673,21 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| StringInterpolation visitStringInterpolation(StringInterpolation node) {
|
| - StringInterpolation copy = new StringInterpolation(_cloneNodeList(node.elements));
|
| + StringInterpolation copy =
|
| + new StringInterpolation(_cloneNodeList(node.elements));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInvocation node) {
|
| - SuperConstructorInvocation copy = new SuperConstructorInvocation(_mapToken(node.keyword), _mapToken(node.period), _cloneNode(node.constructorName), _cloneNode(node.argumentList));
|
| + SuperConstructorInvocation
|
| + visitSuperConstructorInvocation(SuperConstructorInvocation node) {
|
| + SuperConstructorInvocation copy = new SuperConstructorInvocation(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.period),
|
| + _cloneNode(node.constructorName),
|
| + _cloneNode(node.argumentList));
|
| copy.staticElement = node.staticElement;
|
| return copy;
|
| }
|
| @@ -9838,17 +10701,37 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(_cloneNodeList(node.labels), _mapToken(node.keyword), _cloneNode(node.expression), _mapToken(node.colon), _cloneNodeList(node.statements));
|
| + SwitchCase visitSwitchCase(SwitchCase node) =>
|
| + new SwitchCase(
|
| + _cloneNodeList(node.labels),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.colon),
|
| + _cloneNodeList(node.statements));
|
|
|
| @override
|
| - SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(_cloneNodeList(node.labels), _mapToken(node.keyword), _mapToken(node.colon), _cloneNodeList(node.statements));
|
| + SwitchDefault visitSwitchDefault(SwitchDefault node) =>
|
| + new SwitchDefault(
|
| + _cloneNodeList(node.labels),
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.colon),
|
| + _cloneNodeList(node.statements));
|
|
|
| @override
|
| - SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.expression), _mapToken(node.rightParenthesis), _mapToken(node.leftBracket), _cloneNodeList(node.members), _mapToken(node.rightBracket));
|
| + SwitchStatement visitSwitchStatement(SwitchStatement node) =>
|
| + new SwitchStatement(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.rightParenthesis),
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.members),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| AstNode visitSymbolLiteral(SymbolLiteral node) {
|
| - SymbolLiteral copy = new SymbolLiteral(_mapToken(node.poundSign), _mapTokens(node.components));
|
| + SymbolLiteral copy =
|
| + new SymbolLiteral(_mapToken(node.poundSign), _mapTokens(node.components));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| @@ -9864,51 +10747,108 @@ class IncrementalAstCloner implements AstVisitor<AstNode> {
|
|
|
| @override
|
| ThrowExpression visitThrowExpression(ThrowExpression node) {
|
| - ThrowExpression copy = new ThrowExpression(_mapToken(node.keyword), _cloneNode(node.expression));
|
| + ThrowExpression copy =
|
| + new ThrowExpression(_mapToken(node.keyword), _cloneNode(node.expression));
|
| copy.propagatedType = node.propagatedType;
|
| copy.staticType = node.staticType;
|
| return copy;
|
| }
|
|
|
| @override
|
| - TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.variables), _mapToken(node.semicolon));
|
| + TopLevelVariableDeclaration
|
| + visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
|
| + new TopLevelVariableDeclaration(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _cloneNode(node.variables),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - TryStatement visitTryStatement(TryStatement node) => new TryStatement(_mapToken(node.tryKeyword), _cloneNode(node.body), _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword), _cloneNode(node.finallyBlock));
|
| + TryStatement visitTryStatement(TryStatement node) =>
|
| + new TryStatement(
|
| + _mapToken(node.tryKeyword),
|
| + _cloneNode(node.body),
|
| + _cloneNodeList(node.catchClauses),
|
| + _mapToken(node.finallyKeyword),
|
| + _cloneNode(node.finallyBlock));
|
|
|
| @override
|
| - TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgumentList(_mapToken(node.leftBracket), _cloneNodeList(node.arguments), _mapToken(node.rightBracket));
|
| + TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
|
| + new TypeArgumentList(
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.arguments),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| TypeName visitTypeName(TypeName node) {
|
| - TypeName copy = new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
|
| + TypeName copy =
|
| + new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
|
| copy.type = node.type;
|
| return copy;
|
| }
|
|
|
| @override
|
| - TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(_cloneNode(node.documentationComment), _cloneNodeList(node.metadata), _cloneNode(node.name), _mapToken(node.keyword), _cloneNode(node.bound));
|
| + TypeParameter visitTypeParameter(TypeParameter node) =>
|
| + new TypeParameter(
|
| + _cloneNode(node.documentationComment),
|
| + _cloneNodeList(node.metadata),
|
| + _cloneNode(node.name),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.bound));
|
|
|
| @override
|
| - TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypeParameterList(_mapToken(node.leftBracket), _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket));
|
| + TypeParameterList visitTypeParameterList(TypeParameterList node) =>
|
| + new TypeParameterList(
|
| + _mapToken(node.leftBracket),
|
| + _cloneNodeList(node.typeParameters),
|
| + _mapToken(node.rightBracket));
|
|
|
| @override
|
| - VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, _cloneNodeList(node.metadata), _cloneNode(node.name), _mapToken(node.equals), _cloneNode(node.initializer));
|
| + VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
|
| + new VariableDeclaration(
|
| + null,
|
| + _cloneNodeList(node.metadata),
|
| + _cloneNode(node.name),
|
| + _mapToken(node.equals),
|
| + _cloneNode(node.initializer));
|
|
|
| @override
|
| - VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList node) => new VariableDeclarationList(null, _cloneNodeList(node.metadata), _mapToken(node.keyword), _cloneNode(node.type), _cloneNodeList(node.variables));
|
| + VariableDeclarationList
|
| + visitVariableDeclarationList(VariableDeclarationList node) =>
|
| + new VariableDeclarationList(
|
| + null,
|
| + _cloneNodeList(node.metadata),
|
| + _mapToken(node.keyword),
|
| + _cloneNode(node.type),
|
| + _cloneNodeList(node.variables));
|
|
|
| @override
|
| - VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclarationStatement node) => new VariableDeclarationStatement(_cloneNode(node.variables), _mapToken(node.semicolon));
|
| + VariableDeclarationStatement
|
| + visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
|
| + new VariableDeclarationStatement(
|
| + _cloneNode(node.variables),
|
| + _mapToken(node.semicolon));
|
|
|
| @override
|
| - WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(_mapToken(node.keyword), _mapToken(node.leftParenthesis), _cloneNode(node.condition), _mapToken(node.rightParenthesis), _cloneNode(node.body));
|
| + WhileStatement visitWhileStatement(WhileStatement node) =>
|
| + new WhileStatement(
|
| + _mapToken(node.keyword),
|
| + _mapToken(node.leftParenthesis),
|
| + _cloneNode(node.condition),
|
| + _mapToken(node.rightParenthesis),
|
| + _cloneNode(node.body));
|
|
|
| @override
|
| - WithClause visitWithClause(WithClause node) => new WithClause(_mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
|
| + WithClause visitWithClause(WithClause node) =>
|
| + new WithClause(_mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
|
|
|
| @override
|
| - YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(_mapToken(node.yieldKeyword), _mapToken(node.star), _cloneNode(node.expression), _mapToken(node.semicolon));
|
| + YieldStatement visitYieldStatement(YieldStatement node) =>
|
| + new YieldStatement(
|
| + _mapToken(node.yieldKeyword),
|
| + _mapToken(node.star),
|
| + _cloneNode(node.expression),
|
| + _mapToken(node.semicolon));
|
|
|
| AstNode _cloneNode(AstNode node) {
|
| if (node == null) {
|
| @@ -10004,32 +10944,31 @@ class IndexExpression extends Expression {
|
| /**
|
| * Initialize a newly created index expression.
|
| *
|
| - * @param target the expression used to compute the object being indexed
|
| + * @param period the period ("..") before a cascaded index expression
|
| * @param leftBracket the left square bracket
|
| * @param index the expression used to compute the index
|
| * @param rightBracket the right square bracket
|
| */
|
| - IndexExpression.forTarget(Expression target, this.leftBracket, Expression index, this.rightBracket) {
|
| - _target = becomeParentOf(target);
|
| + IndexExpression.forCascade(this.period, this.leftBracket, Expression index,
|
| + this.rightBracket) {
|
| _index = becomeParentOf(index);
|
| }
|
|
|
| /**
|
| * Initialize a newly created index expression.
|
| *
|
| - * @param period the period ("..") before a cascaded index expression
|
| + * @param target the expression used to compute the object being indexed
|
| * @param leftBracket the left square bracket
|
| * @param index the expression used to compute the index
|
| * @param rightBracket the right square bracket
|
| */
|
| - IndexExpression.forCascade(this.period, this.leftBracket, Expression index, this.rightBracket) {
|
| + IndexExpression.forTarget(Expression target, this.leftBracket,
|
| + Expression index, this.rightBracket) {
|
| + _target = becomeParentOf(target);
|
| _index = becomeParentOf(index);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitIndexExpression(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (_target != null) {
|
| return _target.beginToken;
|
| @@ -10063,10 +11002,52 @@ class IndexExpression extends Expression {
|
| */
|
| Expression get index => _index;
|
|
|
| + /**
|
| + * Set the expression used to compute the index to the given expression.
|
| + *
|
| + * @param expression the expression used to compute the index
|
| + */
|
| + void set index(Expression expression) {
|
| + _index = becomeParentOf(expression);
|
| + }
|
| +
|
| + @override
|
| + bool get isAssignable => true;
|
| +
|
| + /**
|
| + * Return `true` if this expression is cascaded. If it is, then the target of this
|
| + * expression is not stored locally but is stored in the nearest ancestor that is a
|
| + * [CascadeExpression].
|
| + *
|
| + * @return `true` if this expression is cascaded
|
| + */
|
| + bool get isCascaded => period != null;
|
| +
|
| @override
|
| int get precedence => 15;
|
|
|
| /**
|
| + * If the AST structure has been resolved, and the function being invoked is known based on
|
| + * propagated type information, then return the parameter element representing the parameter to
|
| + * which the value of the index expression will be bound. Otherwise, return `null`.
|
| + *
|
| + * This method is only intended to be used by [Expression.propagatedParameterElement].
|
| + *
|
| + * @return the parameter element representing the parameter to which the value of the index
|
| + * expression will be bound
|
| + */
|
| + ParameterElement get propagatedParameterElementForIndex {
|
| + if (propagatedElement == null) {
|
| + return null;
|
| + }
|
| + List<ParameterElement> parameters = propagatedElement.parameters;
|
| + if (parameters.length < 1) {
|
| + return null;
|
| + }
|
| + return parameters[0];
|
| + }
|
| +
|
| + /**
|
| * Return the expression used to compute the object being indexed. If this index expression is not
|
| * part of a cascade expression, then this is the same as [getTarget]. If this index
|
| * expression is part of a cascade expression, then the target expression stored with the cascade
|
| @@ -10090,6 +11071,27 @@ class IndexExpression extends Expression {
|
| }
|
|
|
| /**
|
| + * If the AST structure has been resolved, and the function being invoked is known based on static
|
| + * type information, then return the parameter element representing the parameter to which the
|
| + * value of the index expression will be bound. Otherwise, return `null`.
|
| + *
|
| + * This method is only intended to be used by [Expression.staticParameterElement].
|
| + *
|
| + * @return the parameter element representing the parameter to which the value of the index
|
| + * expression will be bound
|
| + */
|
| + ParameterElement get staticParameterElementForIndex {
|
| + if (staticElement == null) {
|
| + return null;
|
| + }
|
| + List<ParameterElement> parameters = staticElement.parameters;
|
| + if (parameters.length < 1) {
|
| + return null;
|
| + }
|
| + return parameters[0];
|
| + }
|
| +
|
| + /**
|
| * Return the expression used to compute the object being indexed, or `null` if this index
|
| * expression is part of a cascade expression.
|
| *
|
| @@ -10099,6 +11101,18 @@ class IndexExpression extends Expression {
|
| Expression get target => _target;
|
|
|
| /**
|
| + * Set the expression used to compute the object being indexed to the given expression.
|
| + *
|
| + * @param expression the expression used to compute the object being indexed
|
| + */
|
| + void set target(Expression expression) {
|
| + _target = becomeParentOf(expression);
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitIndexExpression(this);
|
| +
|
| + /**
|
| * Return `true` if this expression is computing a right-hand value.
|
| *
|
| * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
|
| @@ -10111,7 +11125,8 @@ class IndexExpression extends Expression {
|
| AstNode parent = this.parent;
|
| if (parent is AssignmentExpression) {
|
| AssignmentExpression assignment = parent;
|
| - if (identical(assignment.leftHandSide, this) && assignment.operator.type == TokenType.EQ) {
|
| + if (identical(assignment.leftHandSide, this) &&
|
| + assignment.operator.type == TokenType.EQ) {
|
| return false;
|
| }
|
| }
|
| @@ -10141,82 +11156,10 @@ class IndexExpression extends Expression {
|
| }
|
|
|
| @override
|
| - bool get isAssignable => true;
|
| -
|
| - /**
|
| - * Return `true` if this expression is cascaded. If it is, then the target of this
|
| - * expression is not stored locally but is stored in the nearest ancestor that is a
|
| - * [CascadeExpression].
|
| - *
|
| - * @return `true` if this expression is cascaded
|
| - */
|
| - bool get isCascaded => period != null;
|
| -
|
| - /**
|
| - * Set the expression used to compute the index to the given expression.
|
| - *
|
| - * @param expression the expression used to compute the index
|
| - */
|
| - void set index(Expression expression) {
|
| - _index = becomeParentOf(expression);
|
| - }
|
| -
|
| - /**
|
| - * Set the expression used to compute the object being indexed to the given expression.
|
| - *
|
| - * @param expression the expression used to compute the object being indexed
|
| - */
|
| - void set target(Expression expression) {
|
| - _target = becomeParentOf(expression);
|
| - }
|
| -
|
| - @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_target, visitor);
|
| safelyVisitChild(_index, visitor);
|
| }
|
| -
|
| - /**
|
| - * If the AST structure has been resolved, and the function being invoked is known based on
|
| - * propagated type information, then return the parameter element representing the parameter to
|
| - * which the value of the index expression will be bound. Otherwise, return `null`.
|
| - *
|
| - * This method is only intended to be used by [Expression.propagatedParameterElement].
|
| - *
|
| - * @return the parameter element representing the parameter to which the value of the index
|
| - * expression will be bound
|
| - */
|
| - ParameterElement get propagatedParameterElementForIndex {
|
| - if (propagatedElement == null) {
|
| - return null;
|
| - }
|
| - List<ParameterElement> parameters = propagatedElement.parameters;
|
| - if (parameters.length < 1) {
|
| - return null;
|
| - }
|
| - return parameters[0];
|
| - }
|
| -
|
| - /**
|
| - * If the AST structure has been resolved, and the function being invoked is known based on static
|
| - * type information, then return the parameter element representing the parameter to which the
|
| - * value of the index expression will be bound. Otherwise, return `null`.
|
| - *
|
| - * This method is only intended to be used by [Expression.staticParameterElement].
|
| - *
|
| - * @return the parameter element representing the parameter to which the value of the index
|
| - * expression will be bound
|
| - */
|
| - ParameterElement get staticParameterElementForIndex {
|
| - if (staticElement == null) {
|
| - return null;
|
| - }
|
| - List<ParameterElement> parameters = staticElement.parameters;
|
| - if (parameters.length < 1) {
|
| - return null;
|
| - }
|
| - return parameters[0];
|
| - }
|
| }
|
|
|
| /**
|
| @@ -10262,14 +11205,12 @@ class InstanceCreationExpression extends Expression {
|
| * @param constructorName the name of the constructor to be invoked
|
| * @param argumentList the list of arguments to the constructor
|
| */
|
| - InstanceCreationExpression(this.keyword, ConstructorName constructorName, ArgumentList argumentList) {
|
| + InstanceCreationExpression(this.keyword, ConstructorName constructorName,
|
| + ArgumentList argumentList) {
|
| _constructorName = becomeParentOf(constructorName);
|
| _argumentList = becomeParentOf(argumentList);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this);
|
| -
|
| /**
|
| * Return the list of arguments to the constructor.
|
| *
|
| @@ -10277,6 +11218,15 @@ class InstanceCreationExpression extends Expression {
|
| */
|
| ArgumentList get argumentList => _argumentList;
|
|
|
| + /**
|
| + * Set the list of arguments to the constructor to the given list.
|
| + *
|
| + * @param argumentList the list of arguments to the constructor
|
| + */
|
| + void set argumentList(ArgumentList argumentList) {
|
| + _argumentList = becomeParentOf(argumentList);
|
| + }
|
| +
|
| @override
|
| Token get beginToken => keyword;
|
|
|
| @@ -10287,36 +11237,31 @@ class InstanceCreationExpression extends Expression {
|
| */
|
| ConstructorName get constructorName => _constructorName;
|
|
|
| - @override
|
| - Token get endToken => _argumentList.endToken;
|
| + /**
|
| + * Set the name of the constructor to be invoked to the given name.
|
| + *
|
| + * @param constructorName the name of the constructor to be invoked
|
| + */
|
| + void set constructorName(ConstructorName constructorName) {
|
| + _constructorName = becomeParentOf(constructorName);
|
| + }
|
|
|
| @override
|
| - int get precedence => 16;
|
| + Token get endToken => _argumentList.endToken;
|
|
|
| /**
|
| * Return `true` if this creation expression is used to invoke a constant constructor.
|
| *
|
| * @return `true` if this creation expression is used to invoke a constant constructor
|
| */
|
| - bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| + bool get isConst =>
|
| + keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
|
|
|
| - /**
|
| - * Set the list of arguments to the constructor to the given list.
|
| - *
|
| - * @param argumentList the list of arguments to the constructor
|
| - */
|
| - void set argumentList(ArgumentList argumentList) {
|
| - _argumentList = becomeParentOf(argumentList);
|
| - }
|
| + @override
|
| + int get precedence => 16;
|
|
|
| - /**
|
| - * Set the name of the constructor to be invoked to the given name.
|
| - *
|
| - * @param constructorName the name of the constructor to be invoked
|
| - */
|
| - void set constructorName(ConstructorName constructorName) {
|
| - _constructorName = becomeParentOf(constructorName);
|
| - }
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitInstanceCreationExpression(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| @@ -10361,15 +11306,15 @@ class IntegerLiteral extends Literal {
|
| IntegerLiteral(this.literal, this.value);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken => literal;
|
|
|
| @override
|
| Token get endToken => literal;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitIntegerLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -10422,14 +11367,12 @@ class InterpolationExpression extends InterpolationElement {
|
| * @param expression the expression to be evaluated for the value to be converted into a string
|
| * @param rightBracket the right curly bracket
|
| */
|
| - InterpolationExpression(this.leftBracket, Expression expression, this.rightBracket) {
|
| + InterpolationExpression(this.leftBracket, Expression expression,
|
| + this.rightBracket) {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => leftBracket;
|
|
|
| @override
|
| @@ -10458,6 +11401,9 @@ class InterpolationExpression extends InterpolationElement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitInterpolationExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -10494,34 +11440,8 @@ class InterpolationString extends InterpolationElement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
|
| -
|
| - @override
|
| Token get beginToken => contents;
|
|
|
| - @override
|
| - Token get endToken => contents;
|
| -
|
| - /**
|
| - * Return the value of the literal.
|
| - *
|
| - * @return the value of the literal
|
| - */
|
| - String get value => _value;
|
| -
|
| - /**
|
| - * Set the value of the literal to the given string.
|
| - *
|
| - * @param string the value of the literal
|
| - */
|
| - void set value(String string) {
|
| - _value = string;
|
| - }
|
| -
|
| - @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - }
|
| -
|
| /**
|
| * Return the offset of the after-last contents character.
|
| */
|
| @@ -10554,6 +11474,32 @@ class InterpolationString extends InterpolationElement {
|
| }
|
| return offset;
|
| }
|
| +
|
| + @override
|
| + Token get endToken => contents;
|
| +
|
| + /**
|
| + * Return the value of the literal.
|
| + *
|
| + * @return the value of the literal
|
| + */
|
| + String get value => _value;
|
| +
|
| + /**
|
| + * Set the value of the literal to the given string.
|
| + *
|
| + * @param string the value of the literal
|
| + */
|
| + void set value(String string) {
|
| + _value = string;
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + }
|
| }
|
|
|
| /**
|
| @@ -10593,15 +11539,13 @@ class IsExpression extends Expression {
|
| * @param notOperator the not operator, or `null` if the sense of the test is not negated
|
| * @param type the name of the type being tested for
|
| */
|
| - IsExpression(Expression expression, this.isOperator, this.notOperator, TypeName type) {
|
| + IsExpression(Expression expression, this.isOperator, this.notOperator,
|
| + TypeName type) {
|
| _expression = becomeParentOf(expression);
|
| _type = becomeParentOf(type);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitIsExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _expression.beginToken;
|
|
|
| @override
|
| @@ -10614,16 +11558,6 @@ class IsExpression extends Expression {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - int get precedence => 7;
|
| -
|
| - /**
|
| - * Return the name of the type being tested for.
|
| - *
|
| - * @return the name of the type being tested for
|
| - */
|
| - TypeName get type => _type;
|
| -
|
| /**
|
| * Set the expression used to compute the value whose type is being tested to the given
|
| * expression.
|
| @@ -10634,6 +11568,16 @@ class IsExpression extends Expression {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| + @override
|
| + int get precedence => 7;
|
| +
|
| + /**
|
| + * Return the name of the type being tested for.
|
| + *
|
| + * @return the name of the type being tested for
|
| + */
|
| + TypeName get type => _type;
|
| +
|
| /**
|
| * Set the name of the type being tested for to the given name.
|
| *
|
| @@ -10644,6 +11588,9 @@ class IsExpression extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitIsExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| safelyVisitChild(_type, visitor);
|
| @@ -10680,9 +11627,6 @@ class Label extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitLabel(this);
|
| -
|
| - @override
|
| Token get beginToken => _label.beginToken;
|
|
|
| @override
|
| @@ -10705,6 +11649,9 @@ class Label extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitLabel(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_label, visitor);
|
| }
|
| @@ -10742,9 +11689,6 @@ class LabeledStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (!_labels.isEmpty) {
|
| return _labels.beginToken;
|
| @@ -10779,6 +11723,9 @@ class LabeledStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitLabeledStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _labels.accept(visitor);
|
| safelyVisitChild(_statement, visitor);
|
| @@ -10818,15 +11765,17 @@ class LibraryDirective extends Directive {
|
| * @param name the name of the library being defined
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - LibraryDirective(Comment comment, List<Annotation> metadata, this.libraryToken, LibraryIdentifier name, this.semicolon) : super(comment, metadata) {
|
| + LibraryDirective(Comment comment, List<Annotation> metadata,
|
| + this.libraryToken, LibraryIdentifier name, this.semicolon)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitLibraryDirective(this);
|
| + Token get endToken => semicolon;
|
|
|
| @override
|
| - Token get endToken => semicolon;
|
| + Token get firstTokenAfterCommentAndMetadata => libraryToken;
|
|
|
| @override
|
| Token get keyword => libraryToken;
|
| @@ -10848,13 +11797,13 @@ class LibraryDirective extends Directive {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitLibraryDirective(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_name, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata => libraryToken;
|
| }
|
|
|
| /**
|
| @@ -10881,9 +11830,6 @@ class LibraryIdentifier extends Identifier {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this);
|
| -
|
| - @override
|
| Token get beginToken => _components.beginToken;
|
|
|
| @override
|
| @@ -10924,6 +11870,9 @@ class LibraryIdentifier extends Identifier {
|
| Element get staticElement => null;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitLibraryIdentifier(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _components.accept(visitor);
|
| }
|
| @@ -10963,14 +11912,13 @@ class ListLiteral extends TypedLiteral {
|
| * @param elements the expressions used to compute the elements of the list
|
| * @param rightBracket the right square bracket
|
| */
|
| - ListLiteral(Token constKeyword, TypeArgumentList typeArguments, this.leftBracket, List<Expression> elements, this.rightBracket) : super(constKeyword, typeArguments) {
|
| + ListLiteral(Token constKeyword, TypeArgumentList typeArguments,
|
| + this.leftBracket, List<Expression> elements, this.rightBracket)
|
| + : super(constKeyword, typeArguments) {
|
| _elements = new NodeList<Expression>(this, elements);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitListLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (constKeyword != null) {
|
| return constKeyword;
|
| @@ -10993,6 +11941,9 @@ class ListLiteral extends TypedLiteral {
|
| Token get endToken => rightBracket;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitListLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| _elements.accept(visitor);
|
| @@ -11053,14 +12004,13 @@ class MapLiteral extends TypedLiteral {
|
| * @param entries the entries in the map
|
| * @param rightBracket the right curly bracket
|
| */
|
| - MapLiteral(Token constKeyword, TypeArgumentList typeArguments, this.leftBracket, List<MapLiteralEntry> entries, this.rightBracket) : super(constKeyword, typeArguments) {
|
| + MapLiteral(Token constKeyword, TypeArgumentList typeArguments,
|
| + this.leftBracket, List<MapLiteralEntry> entries, this.rightBracket)
|
| + : super(constKeyword, typeArguments) {
|
| _entries = new NodeList<MapLiteralEntry>(this, entries);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitMapLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (constKeyword != null) {
|
| return constKeyword;
|
| @@ -11083,6 +12033,9 @@ class MapLiteral extends TypedLiteral {
|
| NodeList<MapLiteralEntry> get entries => _entries;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitMapLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| _entries.accept(visitor);
|
| @@ -11127,9 +12080,6 @@ class MapLiteralEntry extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this);
|
| -
|
| - @override
|
| Token get beginToken => _key.beginToken;
|
|
|
| @override
|
| @@ -11143,13 +12093,6 @@ class MapLiteralEntry extends AstNode {
|
| Expression get key => _key;
|
|
|
| /**
|
| - * Return the expression computing the value that will be associated with the key.
|
| - *
|
| - * @return the expression computing the value that will be associated with the key
|
| - */
|
| - Expression get value => _value;
|
| -
|
| - /**
|
| * Set the expression computing the key with which the value will be associated to the given
|
| * string.
|
| *
|
| @@ -11160,6 +12103,13 @@ class MapLiteralEntry extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the expression computing the value that will be associated with the key.
|
| + *
|
| + * @return the expression computing the value that will be associated with the key
|
| + */
|
| + Expression get value => _value;
|
| +
|
| + /**
|
| * Set the expression computing the value that will be associated with the key to the given
|
| * expression.
|
| *
|
| @@ -11170,6 +12120,9 @@ class MapLiteralEntry extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitMapLiteralEntry(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_key, visitor);
|
| safelyVisitChild(_value, visitor);
|
| @@ -11251,16 +12204,17 @@ class MethodDeclaration extends ClassMember {
|
| * declares a getter
|
| * @param body the body of the method
|
| */
|
| - MethodDeclaration(Comment comment, List<Annotation> metadata, this.externalKeyword, this.modifierKeyword, TypeName returnType, this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name, FormalParameterList parameters, FunctionBody body) : super(comment, metadata) {
|
| + MethodDeclaration(Comment comment, List<Annotation> metadata,
|
| + this.externalKeyword, this.modifierKeyword, TypeName returnType,
|
| + this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name,
|
| + FormalParameterList parameters, FunctionBody body)
|
| + : super(comment, metadata) {
|
| _returnType = becomeParentOf(returnType);
|
| _name = becomeParentOf(name);
|
| _parameters = becomeParentOf(parameters);
|
| _body = becomeParentOf(body);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this);
|
| -
|
| /**
|
| * Return the body of the method.
|
| *
|
| @@ -11269,6 +12223,15 @@ class MethodDeclaration extends ClassMember {
|
| FunctionBody get body => _body;
|
|
|
| /**
|
| + * Set the body of the method to the given function body.
|
| + *
|
| + * @param functionBody the body of the method
|
| + */
|
| + void set body(FunctionBody functionBody) {
|
| + _body = becomeParentOf(functionBody);
|
| + }
|
| +
|
| + /**
|
| * Return the element associated with this method, or `null` if the AST structure has not
|
| * been resolved. The element can either be a [MethodElement], if this represents the
|
| * declaration of a normal method, or a [PropertyAccessorElement] if this represents the
|
| @@ -11277,46 +12240,42 @@ class MethodDeclaration extends ClassMember {
|
| * @return the element associated with this method
|
| */
|
| @override
|
| - ExecutableElement get element => _name != null ? (_name.staticElement as ExecutableElement) : null;
|
| + ExecutableElement get element =>
|
| + _name != null ? (_name.staticElement as ExecutableElement) : null;
|
|
|
| @override
|
| Token get endToken => _body.endToken;
|
|
|
| - /**
|
| - * Return the name of the method.
|
| - *
|
| - * @return the name of the method
|
| - */
|
| - SimpleIdentifier get name => _name;
|
| -
|
| - /**
|
| - * Return the parameters associated with the method, or `null` if this method declares a
|
| - * getter.
|
| - *
|
| - * @return the parameters associated with the method
|
| - */
|
| - FormalParameterList get parameters => _parameters;
|
| -
|
| - /**
|
| - * Return the return type of the method, or `null` if no return type was declared.
|
| - *
|
| - * @return the return type of the method
|
| - */
|
| - TypeName get returnType => _returnType;
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + if (modifierKeyword != null) {
|
| + return modifierKeyword;
|
| + } else if (_returnType != null) {
|
| + return _returnType.beginToken;
|
| + } else if (propertyKeyword != null) {
|
| + return propertyKeyword;
|
| + } else if (operatorKeyword != null) {
|
| + return operatorKeyword;
|
| + }
|
| + return _name.beginToken;
|
| + }
|
|
|
| /**
|
| * Return `true` if this method is declared to be an abstract method.
|
| *
|
| * @return `true` if this method is declared to be an abstract method
|
| */
|
| - bool get isAbstract => externalKeyword == null && (_body is EmptyFunctionBody);
|
| + bool get isAbstract =>
|
| + externalKeyword == null && (_body is EmptyFunctionBody);
|
|
|
| /**
|
| * Return `true` if this method declares a getter.
|
| *
|
| * @return `true` if this method declares a getter
|
| */
|
| - bool get isGetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.GET;
|
| + bool get isGetter =>
|
| + propertyKeyword != null &&
|
| + (propertyKeyword as KeywordToken).keyword == Keyword.GET;
|
|
|
| /**
|
| * Return `true` if this method declares an operator.
|
| @@ -11330,23 +12289,25 @@ class MethodDeclaration extends ClassMember {
|
| *
|
| * @return `true` if this method declares a setter
|
| */
|
| - bool get isSetter => propertyKeyword != null && (propertyKeyword as KeywordToken).keyword == Keyword.SET;
|
| + bool get isSetter =>
|
| + propertyKeyword != null &&
|
| + (propertyKeyword as KeywordToken).keyword == Keyword.SET;
|
|
|
| /**
|
| * Return `true` if this method is declared to be a static method.
|
| *
|
| * @return `true` if this method is declared to be a static method
|
| */
|
| - bool get isStatic => modifierKeyword != null && (modifierKeyword as KeywordToken).keyword == Keyword.STATIC;
|
| + bool get isStatic =>
|
| + modifierKeyword != null &&
|
| + (modifierKeyword as KeywordToken).keyword == Keyword.STATIC;
|
|
|
| /**
|
| - * Set the body of the method to the given function body.
|
| + * Return the name of the method.
|
| *
|
| - * @param functionBody the body of the method
|
| + * @return the name of the method
|
| */
|
| - void set body(FunctionBody functionBody) {
|
| - _body = becomeParentOf(functionBody);
|
| - }
|
| + SimpleIdentifier get name => _name;
|
|
|
| /**
|
| * Set the name of the method to the given identifier.
|
| @@ -11358,6 +12319,14 @@ class MethodDeclaration extends ClassMember {
|
| }
|
|
|
| /**
|
| + * Return the parameters associated with the method, or `null` if this method declares a
|
| + * getter.
|
| + *
|
| + * @return the parameters associated with the method
|
| + */
|
| + FormalParameterList get parameters => _parameters;
|
| +
|
| + /**
|
| * Set the parameters associated with the method to the given list of parameters.
|
| *
|
| * @param parameters the parameters associated with the method
|
| @@ -11367,6 +12336,13 @@ class MethodDeclaration extends ClassMember {
|
| }
|
|
|
| /**
|
| + * Return the return type of the method, or `null` if no return type was declared.
|
| + *
|
| + * @return the return type of the method
|
| + */
|
| + TypeName get returnType => _returnType;
|
| +
|
| + /**
|
| * Set the return type of the method to the given type name.
|
| *
|
| * @param typeName the return type of the method
|
| @@ -11376,6 +12352,9 @@ class MethodDeclaration extends ClassMember {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitMethodDeclaration(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_returnType, visitor);
|
| @@ -11383,20 +12362,6 @@ class MethodDeclaration extends ClassMember {
|
| safelyVisitChild(_parameters, visitor);
|
| safelyVisitChild(_body, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - if (modifierKeyword != null) {
|
| - return modifierKeyword;
|
| - } else if (_returnType != null) {
|
| - return _returnType.beginToken;
|
| - } else if (propertyKeyword != null) {
|
| - return propertyKeyword;
|
| - } else if (operatorKeyword != null) {
|
| - return operatorKeyword;
|
| - }
|
| - return _name.beginToken;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -11442,15 +12407,13 @@ class MethodInvocation extends Expression {
|
| * @param methodName the name of the method being invoked
|
| * @param argumentList the list of arguments to the method
|
| */
|
| - MethodInvocation(Expression target, this.period, SimpleIdentifier methodName, ArgumentList argumentList) {
|
| + MethodInvocation(Expression target, this.period, SimpleIdentifier methodName,
|
| + ArgumentList argumentList) {
|
| _target = becomeParentOf(target);
|
| _methodName = becomeParentOf(methodName);
|
| _argumentList = becomeParentOf(argumentList);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitMethodInvocation(this);
|
| -
|
| /**
|
| * Return the list of arguments to the method.
|
| *
|
| @@ -11458,6 +12421,15 @@ class MethodInvocation extends Expression {
|
| */
|
| ArgumentList get argumentList => _argumentList;
|
|
|
| + /**
|
| + * Set the list of arguments to the method to the given list.
|
| + *
|
| + * @param argumentList the list of arguments to the method
|
| + */
|
| + void set argumentList(ArgumentList argumentList) {
|
| + _argumentList = becomeParentOf(argumentList);
|
| + }
|
| +
|
| @override
|
| Token get beginToken {
|
| if (_target != null) {
|
| @@ -11472,12 +12444,31 @@ class MethodInvocation extends Expression {
|
| Token get endToken => _argumentList.endToken;
|
|
|
| /**
|
| + * Return `true` if this expression is cascaded. If it is, then the target of this
|
| + * expression is not stored locally but is stored in the nearest ancestor that is a
|
| + * [CascadeExpression].
|
| + *
|
| + * @return `true` if this expression is cascaded
|
| + */
|
| + bool get isCascaded =>
|
| + period != null && period.type == TokenType.PERIOD_PERIOD;
|
| +
|
| + /**
|
| * Return the name of the method being invoked.
|
| *
|
| * @return the name of the method being invoked
|
| */
|
| SimpleIdentifier get methodName => _methodName;
|
|
|
| + /**
|
| + * Set the name of the method being invoked to the given identifier.
|
| + *
|
| + * @param identifier the name of the method being invoked
|
| + */
|
| + void set methodName(SimpleIdentifier identifier) {
|
| + _methodName = becomeParentOf(identifier);
|
| + }
|
| +
|
| @override
|
| int get precedence => 15;
|
|
|
| @@ -11515,33 +12506,6 @@ class MethodInvocation extends Expression {
|
| Expression get target => _target;
|
|
|
| /**
|
| - * Return `true` if this expression is cascaded. If it is, then the target of this
|
| - * expression is not stored locally but is stored in the nearest ancestor that is a
|
| - * [CascadeExpression].
|
| - *
|
| - * @return `true` if this expression is cascaded
|
| - */
|
| - bool get isCascaded => period != null && period.type == TokenType.PERIOD_PERIOD;
|
| -
|
| - /**
|
| - * Set the list of arguments to the method to the given list.
|
| - *
|
| - * @param argumentList the list of arguments to the method
|
| - */
|
| - void set argumentList(ArgumentList argumentList) {
|
| - _argumentList = becomeParentOf(argumentList);
|
| - }
|
| -
|
| - /**
|
| - * Set the name of the method being invoked to the given identifier.
|
| - *
|
| - * @param identifier the name of the method being invoked
|
| - */
|
| - void set methodName(SimpleIdentifier identifier) {
|
| - _methodName = becomeParentOf(identifier);
|
| - }
|
| -
|
| - /**
|
| * Set the expression producing the object on which the method is defined to the given expression.
|
| *
|
| * @param expression the expression producing the object on which the method is defined
|
| @@ -11551,6 +12515,9 @@ class MethodInvocation extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitMethodInvocation(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_target, visitor);
|
| safelyVisitChild(_methodName, visitor);
|
| @@ -11590,9 +12557,6 @@ class NamedExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitNamedExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _name.beginToken;
|
|
|
| /**
|
| @@ -11616,19 +12580,9 @@ class NamedExpression extends Expression {
|
| /**
|
| * Return the expression with which the name is associated.
|
| *
|
| - * @return the expression with which the name is associated
|
| - */
|
| - Expression get expression => _expression;
|
| -
|
| - /**
|
| - * Return the name associated with the expression.
|
| - *
|
| - * @return the name associated with the expression
|
| + * @return the expression with which the name is associated
|
| */
|
| - Label get name => _name;
|
| -
|
| - @override
|
| - int get precedence => 0;
|
| + Expression get expression => _expression;
|
|
|
| /**
|
| * Set the expression with which the name is associated to the given expression.
|
| @@ -11640,6 +12594,13 @@ class NamedExpression extends Expression {
|
| }
|
|
|
| /**
|
| + * Return the name associated with the expression.
|
| + *
|
| + * @return the name associated with the expression
|
| + */
|
| + Label get name => _name;
|
| +
|
| + /**
|
| * Set the name associated with the expression to the given identifier.
|
| *
|
| * @param identifier the name associated with the expression
|
| @@ -11649,6 +12610,12 @@ class NamedExpression extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 0;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitNamedExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_expression, visitor);
|
| @@ -11691,7 +12658,9 @@ abstract class NamespaceDirective extends UriBasedDirective {
|
| * @param combinators the combinators used to control which names are imported or exported
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword, StringLiteral libraryUri, List<Combinator> combinators, this.semicolon) : super(comment, metadata, libraryUri) {
|
| + NamespaceDirective(Comment comment, List<Annotation> metadata, this.keyword,
|
| + StringLiteral libraryUri, List<Combinator> combinators, this.semicolon)
|
| + : super(comment, metadata, libraryUri) {
|
| _combinators = new NodeList<Combinator>(this, combinators);
|
| }
|
|
|
| @@ -11706,10 +12675,10 @@ abstract class NamespaceDirective extends UriBasedDirective {
|
| Token get endToken => semicolon;
|
|
|
| @override
|
| - LibraryElement get uriElement;
|
| + Token get firstTokenAfterCommentAndMetadata => keyword;
|
|
|
| @override
|
| - Token get firstTokenAfterCommentAndMetadata => keyword;
|
| + LibraryElement get uriElement;
|
| }
|
|
|
| /**
|
| @@ -11743,9 +12712,6 @@ class NativeClause extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitNativeClause(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -11768,6 +12734,9 @@ class NativeClause extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitNativeClause(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_name, visitor);
|
| }
|
| @@ -11806,14 +12775,12 @@ class NativeFunctionBody extends FunctionBody {
|
| * @param stringLiteral the string literal
|
| * @param semicolon the token representing the semicolon that marks the end of the function body
|
| */
|
| - NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral, this.semicolon) {
|
| + NativeFunctionBody(this.nativeToken, StringLiteral stringLiteral,
|
| + this.semicolon) {
|
| _stringLiteral = becomeParentOf(stringLiteral);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this);
|
| -
|
| - @override
|
| Token get beginToken => nativeToken;
|
|
|
| @override
|
| @@ -11836,12 +12803,149 @@ class NativeFunctionBody extends FunctionBody {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitNativeFunctionBody(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_stringLiteral, visitor);
|
| }
|
| }
|
|
|
| /**
|
| + * Instances of the class `NodeList` represent a list of AST nodes that have a
|
| + * common parent.
|
| + */
|
| +class NodeList<E extends AstNode> extends Object with ListMixin<E> {
|
| + /**
|
| + * The node that is the parent of each of the elements in the list.
|
| + */
|
| + AstNode owner;
|
| +
|
| + /**
|
| + * The elements contained in the list.
|
| + */
|
| + List<E> _elements = <E>[];
|
| +
|
| + /**
|
| + * Initialize a newly created list of nodes such that all of the nodes that
|
| + * are added to the list will have their parent set to the given [owner]. The
|
| + * list will initially be populated with the given [elements].
|
| + */
|
| + NodeList(this.owner, [List<E> elements]) {
|
| + addAll(elements);
|
| + }
|
| +
|
| + /**
|
| + * Return the first token included in this node list's source range, or `null`
|
| + * if the list is empty.
|
| + */
|
| + Token get beginToken {
|
| + if (_elements.length == 0) {
|
| + return null;
|
| + }
|
| + return _elements[0].beginToken;
|
| + }
|
| +
|
| + /**
|
| + * Return the last token included in this node list's source range, or `null`
|
| + * if the list is empty.
|
| + */
|
| + Token get endToken {
|
| + int length = _elements.length;
|
| + if (length == 0) {
|
| + return null;
|
| + }
|
| + return _elements[length - 1].endToken;
|
| + }
|
| +
|
| + int get length => _elements.length;
|
| +
|
| + @deprecated
|
| + void set length(int value) {
|
| + throw new UnsupportedError("Cannot resize NodeList.");
|
| + }
|
| +
|
| + E operator [](int index) {
|
| + if (index < 0 || index >= _elements.length) {
|
| + throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| + }
|
| + return _elements[index];
|
| + }
|
| +
|
| + void operator []=(int index, E node) {
|
| + if (index < 0 || index >= _elements.length) {
|
| + throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| + }
|
| + owner.becomeParentOf(node);
|
| + _elements[index] = node;
|
| + }
|
| +
|
| + /**
|
| + * Use the given [visitor] to visit each of the nodes in this list.
|
| + */
|
| + accept(AstVisitor visitor) {
|
| + int length = _elements.length;
|
| + for (var i = 0; i < length; i++) {
|
| + _elements[i].accept(visitor);
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void add(E node) {
|
| + insert(length, node);
|
| + }
|
| +
|
| + @override
|
| + bool addAll(Iterable<E> nodes) {
|
| + if (nodes != null && !nodes.isEmpty) {
|
| + _elements.addAll(nodes);
|
| + for (E node in nodes) {
|
| + owner.becomeParentOf(node);
|
| + }
|
| + return true;
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + @override
|
| + void clear() {
|
| + _elements = <E>[];
|
| + }
|
| +
|
| + @override
|
| + void insert(int index, E node) {
|
| + int length = _elements.length;
|
| + if (index < 0 || index > length) {
|
| + throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| + }
|
| + owner.becomeParentOf(node);
|
| + if (length == 0) {
|
| + _elements.add(node);
|
| + } else {
|
| + _elements.insert(index, node);
|
| + }
|
| + }
|
| +
|
| + @override
|
| + E removeAt(int index) {
|
| + if (index < 0 || index >= _elements.length) {
|
| + throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| + }
|
| + E removedNode = _elements[index];
|
| + _elements.removeAt(index);
|
| + return removedNode;
|
| + }
|
| +
|
| + /**
|
| + * Create an empty list with the given [owner].
|
| + *
|
| + * Use "new NodeList<E>(owner)"
|
| + */
|
| + @deprecated
|
| + static NodeList create(AstNode owner) => new NodeList(owner);
|
| +}
|
| +
|
| +/**
|
| * Instances of the class `NodeLocator` locate the [AstNode] associated with a
|
| * source range, given the AST structure built from the source. More specifically, they will return
|
| * the [AstNode] with the shortest length whose source range completely encompasses
|
| @@ -11929,7 +13033,8 @@ class NodeLocator extends UnifyingAstVisitor<Object> {
|
| } on NodeLocator_NodeFoundException catch (exception) {
|
| rethrow;
|
| } catch (exception, stackTrace) {
|
| - // Ignore the exception and proceed in order to visit the rest of the structure.
|
| + // Ignore the exception and proceed in order to visit the rest of the
|
| + // structure.
|
| AnalysisEngine.instance.logger.logInformation(
|
| "Exception caught while traversing an AST structure.",
|
| new CaughtException(exception, stackTrace));
|
| @@ -11954,29 +13059,6 @@ class NodeLocator_NodeFoundException extends RuntimeException {
|
| * in an AST node with another node.
|
| */
|
| class NodeReplacer implements AstVisitor<bool> {
|
| - /**
|
| - * Replace the old node with the new node in the AST structure containing the old node.
|
| - *
|
| - * @param oldNode
|
| - * @param newNode
|
| - * @return `true` if the replacement was successful
|
| - * @throws IllegalArgumentException if either node is `null`, if the old node does not have
|
| - * a parent node, or if the AST structure has been corrupted
|
| - */
|
| - static bool replace(AstNode oldNode, AstNode newNode) {
|
| - if (oldNode == null || newNode == null) {
|
| - throw new IllegalArgumentException("The old and new nodes must be non-null");
|
| - } else if (identical(oldNode, newNode)) {
|
| - return true;
|
| - }
|
| - AstNode parent = oldNode.parent;
|
| - if (parent == null) {
|
| - throw new IllegalArgumentException("The old node is not a child of another node");
|
| - }
|
| - NodeReplacer replacer = new NodeReplacer(oldNode, newNode);
|
| - return parent.accept(replacer);
|
| - }
|
| -
|
| final AstNode _oldNode;
|
|
|
| final AstNode _newNode;
|
| @@ -12346,7 +13428,8 @@ class NodeReplacer implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitExportDirective(ExportDirective node) => visitNamespaceDirective(node);
|
| + bool visitExportDirective(ExportDirective node) =>
|
| + visitNamespaceDirective(node);
|
|
|
| @override
|
| bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
|
| @@ -12747,7 +13830,8 @@ class NodeReplacer implements AstVisitor<bool> {
|
| }
|
|
|
| bool visitNode(AstNode node) {
|
| - throw new IllegalArgumentException("The old node is not a child of it's parent");
|
| + throw new IllegalArgumentException(
|
| + "The old node is not a child of it's parent");
|
| }
|
|
|
| bool visitNormalFormalParameter(NormalFormalParameter node) {
|
| @@ -12830,7 +13914,8 @@ class NodeReplacer implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| + bool
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| if (identical(node.constructorName, _oldNode)) {
|
| node.constructorName = _newNode as SimpleIdentifier;
|
| return true;
|
| @@ -13098,6 +14183,31 @@ class NodeReplacer implements AstVisitor<bool> {
|
| }
|
| return false;
|
| }
|
| +
|
| + /**
|
| + * Replace the old node with the new node in the AST structure containing the old node.
|
| + *
|
| + * @param oldNode
|
| + * @param newNode
|
| + * @return `true` if the replacement was successful
|
| + * @throws IllegalArgumentException if either node is `null`, if the old node does not have
|
| + * a parent node, or if the AST structure has been corrupted
|
| + */
|
| + static bool replace(AstNode oldNode, AstNode newNode) {
|
| + if (oldNode == null || newNode == null) {
|
| + throw new IllegalArgumentException(
|
| + "The old and new nodes must be non-null");
|
| + } else if (identical(oldNode, newNode)) {
|
| + return true;
|
| + }
|
| + AstNode parent = oldNode.parent;
|
| + if (parent == null) {
|
| + throw new IllegalArgumentException(
|
| + "The old node is not a child of another node");
|
| + }
|
| + NodeReplacer replacer = new NodeReplacer(oldNode, newNode);
|
| + return parent.accept(replacer);
|
| + }
|
| }
|
|
|
| /**
|
| @@ -13135,7 +14245,8 @@ abstract class NormalFormalParameter extends FormalParameter {
|
| * @param metadata the annotations associated with this parameter
|
| * @param identifier the name of the parameter being declared
|
| */
|
| - NormalFormalParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier identifier) {
|
| + NormalFormalParameter(Comment comment, List<Annotation> metadata,
|
| + SimpleIdentifier identifier) {
|
| _comment = becomeParentOf(comment);
|
| _metadata = new NodeList<Annotation>(this, metadata);
|
| _identifier = becomeParentOf(identifier);
|
| @@ -13149,9 +14260,27 @@ abstract class NormalFormalParameter extends FormalParameter {
|
| */
|
| Comment get documentationComment => _comment;
|
|
|
| + /**
|
| + * Set the documentation comment associated with this parameter to the given comment
|
| + *
|
| + * @param comment the documentation comment to be associated with this parameter
|
| + */
|
| + void set documentationComment(Comment comment) {
|
| + _comment = becomeParentOf(comment);
|
| + }
|
| +
|
| @override
|
| SimpleIdentifier get identifier => _identifier;
|
|
|
| + /**
|
| + * Set the name of the parameter being declared to the given identifier.
|
| + *
|
| + * @param identifier the name of the parameter being declared
|
| + */
|
| + void set identifier(SimpleIdentifier identifier) {
|
| + _identifier = becomeParentOf(identifier);
|
| + }
|
| +
|
| @override
|
| ParameterKind get kind {
|
| AstNode parent = this.parent;
|
| @@ -13169,24 +14298,6 @@ abstract class NormalFormalParameter extends FormalParameter {
|
| NodeList<Annotation> get metadata => _metadata;
|
|
|
| /**
|
| - * Set the documentation comment associated with this parameter to the given comment
|
| - *
|
| - * @param comment the documentation comment to be associated with this parameter
|
| - */
|
| - void set documentationComment(Comment comment) {
|
| - _comment = becomeParentOf(comment);
|
| - }
|
| -
|
| - /**
|
| - * Set the name of the parameter being declared to the given identifier.
|
| - *
|
| - * @param identifier the name of the parameter being declared
|
| - */
|
| - void set identifier(SimpleIdentifier identifier) {
|
| - _identifier = becomeParentOf(identifier);
|
| - }
|
| -
|
| - /**
|
| * Set the metadata associated with this node to the given metadata.
|
| *
|
| * @param metadata the metadata to be associated with this node
|
| @@ -13196,11 +14307,25 @@ abstract class NormalFormalParameter extends FormalParameter {
|
| _metadata.addAll(metadata);
|
| }
|
|
|
| + /**
|
| + * Return an array containing the comment and annotations associated with this parameter, sorted
|
| + * in lexical order.
|
| + *
|
| + * @return the comment and annotations associated with this parameter in the order in which they
|
| + * appeared in the original source
|
| + */
|
| + List<AstNode> get sortedCommentAndAnnotations {
|
| + return <AstNode>[]
|
| + ..add(_comment)
|
| + ..addAll(_metadata)
|
| + ..sort(AstNode.LEXICAL_ORDER);
|
| + }
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| //
|
| - // Note that subclasses are responsible for visiting the identifier because they often need to
|
| - // visit other nodes before visiting the identifier.
|
| + // Note that subclasses are responsible for visiting the identifier because
|
| + // they often need to visit other nodes before visiting the identifier.
|
| //
|
| if (_commentIsBeforeAnnotations()) {
|
| safelyVisitChild(_comment, visitor);
|
| @@ -13224,20 +14349,6 @@ abstract class NormalFormalParameter extends FormalParameter {
|
| Annotation firstAnnotation = _metadata[0];
|
| return _comment.offset < firstAnnotation.offset;
|
| }
|
| -
|
| - /**
|
| - * Return an array containing the comment and annotations associated with this parameter, sorted
|
| - * in lexical order.
|
| - *
|
| - * @return the comment and annotations associated with this parameter in the order in which they
|
| - * appeared in the original source
|
| - */
|
| - List<AstNode> get sortedCommentAndAnnotations {
|
| - return <AstNode>[]
|
| - ..add(_comment)
|
| - ..addAll(_metadata)
|
| - ..sort(AstNode.LEXICAL_ORDER);
|
| - }
|
| }
|
|
|
| /**
|
| @@ -13262,15 +14373,15 @@ class NullLiteral extends Literal {
|
| NullLiteral(this.literal);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitNullLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken => literal;
|
|
|
| @override
|
| Token get endToken => literal;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitNullLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -13307,14 +14418,12 @@ class ParenthesizedExpression extends Expression {
|
| * @param expression the expression within the parentheses
|
| * @param rightParenthesis the right parenthesis
|
| */
|
| - ParenthesizedExpression(this.leftParenthesis, Expression expression, this.rightParenthesis) {
|
| + ParenthesizedExpression(this.leftParenthesis, Expression expression,
|
| + this.rightParenthesis) {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => leftParenthesis;
|
|
|
| @override
|
| @@ -13327,9 +14436,6 @@ class ParenthesizedExpression extends Expression {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - int get precedence => 15;
|
| -
|
| /**
|
| * Set the expression within the parentheses to the given expression.
|
| *
|
| @@ -13340,6 +14446,12 @@ class ParenthesizedExpression extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 15;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitParenthesizedExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -13373,13 +14485,15 @@ class PartDirective extends UriBasedDirective {
|
| * @param partUri the URI of the part being included
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - PartDirective(Comment comment, List<Annotation> metadata, this.partToken, StringLiteral partUri, this.semicolon) : super(comment, metadata, partUri);
|
| + PartDirective(Comment comment, List<Annotation> metadata, this.partToken,
|
| + StringLiteral partUri, this.semicolon)
|
| + : super(comment, metadata, partUri);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPartDirective(this);
|
| + Token get endToken => semicolon;
|
|
|
| @override
|
| - Token get endToken => semicolon;
|
| + Token get firstTokenAfterCommentAndMetadata => partToken;
|
|
|
| @override
|
| Token get keyword => partToken;
|
| @@ -13388,7 +14502,7 @@ class PartDirective extends UriBasedDirective {
|
| CompilationUnitElement get uriElement => element as CompilationUnitElement;
|
|
|
| @override
|
| - Token get firstTokenAfterCommentAndMetadata => partToken;
|
| + accept(AstVisitor visitor) => visitor.visitPartDirective(this);
|
| }
|
|
|
| /**
|
| @@ -13430,15 +14544,17 @@ class PartOfDirective extends Directive {
|
| * @param libraryName the name of the library that the containing compilation unit is part of
|
| * @param semicolon the semicolon terminating the directive
|
| */
|
| - PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken, this.ofToken, LibraryIdentifier libraryName, this.semicolon) : super(comment, metadata) {
|
| + PartOfDirective(Comment comment, List<Annotation> metadata, this.partToken,
|
| + this.ofToken, LibraryIdentifier libraryName, this.semicolon)
|
| + : super(comment, metadata) {
|
| _libraryName = becomeParentOf(libraryName);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPartOfDirective(this);
|
| + Token get endToken => semicolon;
|
|
|
| @override
|
| - Token get endToken => semicolon;
|
| + Token get firstTokenAfterCommentAndMetadata => partToken;
|
|
|
| @override
|
| Token get keyword => partToken;
|
| @@ -13460,13 +14576,13 @@ class PartOfDirective extends Directive {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitPartOfDirective(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_libraryName, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata => partToken;
|
| }
|
|
|
| /**
|
| @@ -13513,9 +14629,6 @@ class PostfixExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPostfixExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => _operand.beginToken;
|
|
|
| /**
|
| @@ -13544,9 +14657,6 @@ class PostfixExpression extends Expression {
|
| */
|
| Expression get operand => _operand;
|
|
|
| - @override
|
| - int get precedence => 15;
|
| -
|
| /**
|
| * Set the expression computing the operand for the operator to the given expression.
|
| *
|
| @@ -13557,9 +14667,7 @@ class PostfixExpression extends Expression {
|
| }
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_operand, visitor);
|
| - }
|
| + int get precedence => 15;
|
|
|
| /**
|
| * If the AST structure has been resolved, and the function being invoked is known based on
|
| @@ -13602,278 +14710,288 @@ class PostfixExpression extends Expression {
|
| }
|
| return parameters[0];
|
| }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitPostfixExpression(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_operand, visitor);
|
| + }
|
| }
|
|
|
| /**
|
| - * Instances of the class `PrefixExpression` represent a prefix unary expression.
|
| + * Instances of the class `PrefixedIdentifier` represent either an identifier that is prefixed
|
| + * or an access to an object property where the target of the property access is a simple
|
| + * identifier.
|
| *
|
| * <pre>
|
| - * prefixExpression ::=
|
| - * [Token] [Expression]
|
| + * prefixedIdentifier ::=
|
| + * [SimpleIdentifier] '.' [SimpleIdentifier]
|
| * </pre>
|
| */
|
| -class PrefixExpression extends Expression {
|
| - /**
|
| - * The prefix operator being applied to the operand.
|
| - */
|
| - Token operator;
|
| -
|
| +class PrefixedIdentifier extends Identifier {
|
| /**
|
| - * The expression computing the operand for the operator.
|
| + * The prefix associated with the library in which the identifier is defined.
|
| */
|
| - Expression _operand;
|
| + SimpleIdentifier _prefix;
|
|
|
| /**
|
| - * The element associated with the operator based on the static type of the operand, or
|
| - * `null` if the AST structure has not been resolved, if the operator is not user definable,
|
| - * or if the operator could not be resolved.
|
| + * The period used to separate the prefix from the identifier.
|
| */
|
| - MethodElement staticElement;
|
| + Token period;
|
|
|
| /**
|
| - * The element associated with the operator based on the propagated type of the operand, or
|
| - * `null` if the AST structure has not been resolved, if the operator is not user definable,
|
| - * or if the operator could not be resolved.
|
| + * The identifier being prefixed.
|
| */
|
| - MethodElement propagatedElement;
|
| + SimpleIdentifier _identifier;
|
|
|
| /**
|
| - * Initialize a newly created prefix expression.
|
| + * Initialize a newly created prefixed identifier.
|
| *
|
| - * @param operator the prefix operator being applied to the operand
|
| - * @param operand the expression computing the operand for the operator
|
| + * @param prefix the identifier being prefixed
|
| + * @param period the period used to separate the prefix from the identifier
|
| + * @param identifier the prefix associated with the library in which the identifier is defined
|
| */
|
| - PrefixExpression(this.operator, Expression operand) {
|
| - _operand = becomeParentOf(operand);
|
| + PrefixedIdentifier(SimpleIdentifier prefix, this.period,
|
| + SimpleIdentifier identifier) {
|
| + _prefix = becomeParentOf(prefix);
|
| + _identifier = becomeParentOf(identifier);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPrefixExpression(this);
|
| + Token get beginToken => _prefix.beginToken;
|
|
|
| @override
|
| - Token get beginToken => operator;
|
| -
|
| - /**
|
| - * Return the best element available for this operator. If resolution was able to find a better
|
| - * element based on type propagation, that element will be returned. Otherwise, the element found
|
| - * using the result of static analysis will be returned. If resolution has not been performed,
|
| - * then `null` will be returned.
|
| - *
|
| - * @return the best element available for this operator
|
| - */
|
| - MethodElement get bestElement {
|
| - MethodElement element = propagatedElement;
|
| - if (element == null) {
|
| - element = staticElement;
|
| + Element get bestElement {
|
| + if (_identifier == null) {
|
| + return null;
|
| }
|
| - return element;
|
| + return _identifier.bestElement;
|
| }
|
|
|
| @override
|
| - Token get endToken => _operand.endToken;
|
| + Token get endToken => _identifier.endToken;
|
|
|
| /**
|
| - * Return the expression computing the operand for the operator.
|
| + * Return the identifier being prefixed.
|
| *
|
| - * @return the expression computing the operand for the operator
|
| + * @return the identifier being prefixed
|
| */
|
| - Expression get operand => _operand;
|
| -
|
| - @override
|
| - int get precedence => 14;
|
| + SimpleIdentifier get identifier => _identifier;
|
|
|
| /**
|
| - * Set the expression computing the operand for the operator to the given expression.
|
| + * Set the identifier being prefixed to the given identifier.
|
| *
|
| - * @param expression the expression computing the operand for the operator
|
| + * @param identifier the identifier being prefixed
|
| */
|
| - void set operand(Expression expression) {
|
| - _operand = becomeParentOf(expression);
|
| - }
|
| -
|
| - @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_operand, visitor);
|
| + void set identifier(SimpleIdentifier identifier) {
|
| + _identifier = becomeParentOf(identifier);
|
| }
|
|
|
| /**
|
| - * If the AST structure has been resolved, and the function being invoked is known based on
|
| - * propagated type information, then return the parameter element representing the parameter to
|
| - * which the value of the operand will be bound. Otherwise, return `null`.
|
| + * Return `true` if this type is a deferred type.
|
| *
|
| - * This method is only intended to be used by [Expression.propagatedParameterElement].
|
| + * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
|
| + * is a deferred prefix.
|
| *
|
| - * @return the parameter element representing the parameter to which the value of the right
|
| - * operand will be bound
|
| + * @return `true` if this type is a deferred type
|
| */
|
| - ParameterElement get propagatedParameterElementForOperand {
|
| - if (propagatedElement == null) {
|
| - return null;
|
| + bool get isDeferred {
|
| + Element element = _prefix.staticElement;
|
| + if (element is! PrefixElement) {
|
| + return false;
|
| }
|
| - List<ParameterElement> parameters = propagatedElement.parameters;
|
| - if (parameters.length < 1) {
|
| - return null;
|
| + PrefixElement prefixElement = element as PrefixElement;
|
| + List<ImportElement> imports =
|
| + prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
|
| + if (imports.length != 1) {
|
| + return false;
|
| }
|
| - return parameters[0];
|
| + return imports[0].isDeferred;
|
| }
|
|
|
| + @override
|
| + String get name => "${_prefix.name}.${_identifier.name}";
|
| +
|
| + @override
|
| + int get precedence => 15;
|
| +
|
| /**
|
| - * If the AST structure has been resolved, and the function being invoked is known based on static
|
| - * type information, then return the parameter element representing the parameter to which the
|
| - * value of the operand will be bound. Otherwise, return `null`.
|
| + * Return the prefix associated with the library in which the identifier is defined.
|
| *
|
| - * This method is only intended to be used by [Expression.staticParameterElement].
|
| + * @return the prefix associated with the library in which the identifier is defined
|
| + */
|
| + SimpleIdentifier get prefix => _prefix;
|
| +
|
| + /**
|
| + * Set the prefix associated with the library in which the identifier is defined to the given
|
| + * identifier.
|
| *
|
| - * @return the parameter element representing the parameter to which the value of the right
|
| - * operand will be bound
|
| + * @param identifier the prefix associated with the library in which the identifier is defined
|
| */
|
| - ParameterElement get staticParameterElementForOperand {
|
| - if (staticElement == null) {
|
| + void set prefix(SimpleIdentifier identifier) {
|
| + _prefix = becomeParentOf(identifier);
|
| + }
|
| +
|
| + @override
|
| + Element get propagatedElement {
|
| + if (_identifier == null) {
|
| return null;
|
| }
|
| - List<ParameterElement> parameters = staticElement.parameters;
|
| - if (parameters.length < 1) {
|
| + return _identifier.propagatedElement;
|
| + }
|
| +
|
| + @override
|
| + Element get staticElement {
|
| + if (_identifier == null) {
|
| return null;
|
| }
|
| - return parameters[0];
|
| + return _identifier.staticElement;
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_prefix, visitor);
|
| + safelyVisitChild(_identifier, visitor);
|
| }
|
| }
|
|
|
| /**
|
| - * Instances of the class `PrefixedIdentifier` represent either an identifier that is prefixed
|
| - * or an access to an object property where the target of the property access is a simple
|
| - * identifier.
|
| + * Instances of the class `PrefixExpression` represent a prefix unary expression.
|
| *
|
| * <pre>
|
| - * prefixedIdentifier ::=
|
| - * [SimpleIdentifier] '.' [SimpleIdentifier]
|
| + * prefixExpression ::=
|
| + * [Token] [Expression]
|
| * </pre>
|
| */
|
| -class PrefixedIdentifier extends Identifier {
|
| +class PrefixExpression extends Expression {
|
| /**
|
| - * The prefix associated with the library in which the identifier is defined.
|
| + * The prefix operator being applied to the operand.
|
| */
|
| - SimpleIdentifier _prefix;
|
| + Token operator;
|
|
|
| /**
|
| - * The period used to separate the prefix from the identifier.
|
| + * The expression computing the operand for the operator.
|
| */
|
| - Token period;
|
| + Expression _operand;
|
|
|
| /**
|
| - * The identifier being prefixed.
|
| + * The element associated with the operator based on the static type of the operand, or
|
| + * `null` if the AST structure has not been resolved, if the operator is not user definable,
|
| + * or if the operator could not be resolved.
|
| */
|
| - SimpleIdentifier _identifier;
|
| + MethodElement staticElement;
|
| +
|
| + /**
|
| + * The element associated with the operator based on the propagated type of the operand, or
|
| + * `null` if the AST structure has not been resolved, if the operator is not user definable,
|
| + * or if the operator could not be resolved.
|
| + */
|
| + MethodElement propagatedElement;
|
|
|
| /**
|
| - * Initialize a newly created prefixed identifier.
|
| + * Initialize a newly created prefix expression.
|
| *
|
| - * @param prefix the identifier being prefixed
|
| - * @param period the period used to separate the prefix from the identifier
|
| - * @param identifier the prefix associated with the library in which the identifier is defined
|
| + * @param operator the prefix operator being applied to the operand
|
| + * @param operand the expression computing the operand for the operator
|
| */
|
| - PrefixedIdentifier(SimpleIdentifier prefix, this.period, SimpleIdentifier identifier) {
|
| - _prefix = becomeParentOf(prefix);
|
| - _identifier = becomeParentOf(identifier);
|
| + PrefixExpression(this.operator, Expression operand) {
|
| + _operand = becomeParentOf(operand);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPrefixedIdentifier(this);
|
| -
|
| - @override
|
| - Token get beginToken => _prefix.beginToken;
|
| + Token get beginToken => operator;
|
|
|
| - @override
|
| - Element get bestElement {
|
| - if (_identifier == null) {
|
| - return null;
|
| + /**
|
| + * Return the best element available for this operator. If resolution was able to find a better
|
| + * element based on type propagation, that element will be returned. Otherwise, the element found
|
| + * using the result of static analysis will be returned. If resolution has not been performed,
|
| + * then `null` will be returned.
|
| + *
|
| + * @return the best element available for this operator
|
| + */
|
| + MethodElement get bestElement {
|
| + MethodElement element = propagatedElement;
|
| + if (element == null) {
|
| + element = staticElement;
|
| }
|
| - return _identifier.bestElement;
|
| + return element;
|
| }
|
|
|
| @override
|
| - Token get endToken => _identifier.endToken;
|
| + Token get endToken => _operand.endToken;
|
|
|
| /**
|
| - * Return the identifier being prefixed.
|
| + * Return the expression computing the operand for the operator.
|
| *
|
| - * @return the identifier being prefixed
|
| + * @return the expression computing the operand for the operator
|
| */
|
| - SimpleIdentifier get identifier => _identifier;
|
| -
|
| - @override
|
| - String get name => "${_prefix.name}.${_identifier.name}";
|
| -
|
| - @override
|
| - int get precedence => 15;
|
| + Expression get operand => _operand;
|
|
|
| /**
|
| - * Return the prefix associated with the library in which the identifier is defined.
|
| + * Set the expression computing the operand for the operator to the given expression.
|
| *
|
| - * @return the prefix associated with the library in which the identifier is defined
|
| + * @param expression the expression computing the operand for the operator
|
| */
|
| - SimpleIdentifier get prefix => _prefix;
|
| -
|
| - @override
|
| - Element get propagatedElement {
|
| - if (_identifier == null) {
|
| - return null;
|
| - }
|
| - return _identifier.propagatedElement;
|
| + void set operand(Expression expression) {
|
| + _operand = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - Element get staticElement {
|
| - if (_identifier == null) {
|
| - return null;
|
| - }
|
| - return _identifier.staticElement;
|
| - }
|
| + int get precedence => 14;
|
|
|
| /**
|
| - * Return `true` if this type is a deferred type.
|
| + * If the AST structure has been resolved, and the function being invoked is known based on
|
| + * propagated type information, then return the parameter element representing the parameter to
|
| + * which the value of the operand will be bound. Otherwise, return `null`.
|
| *
|
| - * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
|
| - * is a deferred prefix.
|
| + * This method is only intended to be used by [Expression.propagatedParameterElement].
|
| *
|
| - * @return `true` if this type is a deferred type
|
| + * @return the parameter element representing the parameter to which the value of the right
|
| + * operand will be bound
|
| */
|
| - bool get isDeferred {
|
| - Element element = _prefix.staticElement;
|
| - if (element is! PrefixElement) {
|
| - return false;
|
| + ParameterElement get propagatedParameterElementForOperand {
|
| + if (propagatedElement == null) {
|
| + return null;
|
| }
|
| - PrefixElement prefixElement = element as PrefixElement;
|
| - List<ImportElement> imports = prefixElement.enclosingElement.getImportsWithPrefix(prefixElement);
|
| - if (imports.length != 1) {
|
| - return false;
|
| + List<ParameterElement> parameters = propagatedElement.parameters;
|
| + if (parameters.length < 1) {
|
| + return null;
|
| }
|
| - return imports[0].isDeferred;
|
| + return parameters[0];
|
| }
|
|
|
| /**
|
| - * Set the identifier being prefixed to the given identifier.
|
| + * If the AST structure has been resolved, and the function being invoked is known based on static
|
| + * type information, then return the parameter element representing the parameter to which the
|
| + * value of the operand will be bound. Otherwise, return `null`.
|
| *
|
| - * @param identifier the identifier being prefixed
|
| - */
|
| - void set identifier(SimpleIdentifier identifier) {
|
| - _identifier = becomeParentOf(identifier);
|
| - }
|
| -
|
| - /**
|
| - * Set the prefix associated with the library in which the identifier is defined to the given
|
| - * identifier.
|
| + * This method is only intended to be used by [Expression.staticParameterElement].
|
| *
|
| - * @param identifier the prefix associated with the library in which the identifier is defined
|
| + * @return the parameter element representing the parameter to which the value of the right
|
| + * operand will be bound
|
| */
|
| - void set prefix(SimpleIdentifier identifier) {
|
| - _prefix = becomeParentOf(identifier);
|
| + ParameterElement get staticParameterElementForOperand {
|
| + if (staticElement == null) {
|
| + return null;
|
| + }
|
| + List<ParameterElement> parameters = staticElement.parameters;
|
| + if (parameters.length < 1) {
|
| + return null;
|
| + }
|
| + return parameters[0];
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitPrefixExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_prefix, visitor);
|
| - safelyVisitChild(_identifier, visitor);
|
| + safelyVisitChild(_operand, visitor);
|
| }
|
| }
|
|
|
| @@ -13912,15 +15030,13 @@ class PropertyAccess extends Expression {
|
| * @param operator the property access operator
|
| * @param propertyName the name of the property being accessed
|
| */
|
| - PropertyAccess(Expression target, this.operator, SimpleIdentifier propertyName) {
|
| + PropertyAccess(Expression target, this.operator,
|
| + SimpleIdentifier propertyName) {
|
| _target = becomeParentOf(target);
|
| _propertyName = becomeParentOf(propertyName);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitPropertyAccess(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (_target != null) {
|
| return _target.beginToken;
|
| @@ -13932,6 +15048,19 @@ class PropertyAccess extends Expression {
|
| Token get endToken => _propertyName.endToken;
|
|
|
| @override
|
| + bool get isAssignable => true;
|
| +
|
| + /**
|
| + * Return `true` if this expression is cascaded. If it is, then the target of this
|
| + * expression is not stored locally but is stored in the nearest ancestor that is a
|
| + * [CascadeExpression].
|
| + *
|
| + * @return `true` if this expression is cascaded
|
| + */
|
| + bool get isCascaded =>
|
| + operator != null && operator.type == TokenType.PERIOD_PERIOD;
|
| +
|
| + @override
|
| int get precedence => 15;
|
|
|
| /**
|
| @@ -13942,6 +15071,15 @@ class PropertyAccess extends Expression {
|
| SimpleIdentifier get propertyName => _propertyName;
|
|
|
| /**
|
| + * Set the name of the property being accessed to the given identifier.
|
| + *
|
| + * @param identifier the name of the property being accessed
|
| + */
|
| + void set propertyName(SimpleIdentifier identifier) {
|
| + _propertyName = becomeParentOf(identifier);
|
| + }
|
| +
|
| + /**
|
| * Return the expression used to compute the receiver of the invocation. If this invocation is not
|
| * part of a cascade expression, then this is the same as [getTarget]. If this invocation
|
| * is part of a cascade expression, then the target stored with the cascade expression is
|
| @@ -13973,27 +15111,6 @@ class PropertyAccess extends Expression {
|
| */
|
| Expression get target => _target;
|
|
|
| - @override
|
| - bool get isAssignable => true;
|
| -
|
| - /**
|
| - * Return `true` if this expression is cascaded. If it is, then the target of this
|
| - * expression is not stored locally but is stored in the nearest ancestor that is a
|
| - * [CascadeExpression].
|
| - *
|
| - * @return `true` if this expression is cascaded
|
| - */
|
| - bool get isCascaded => operator != null && operator.type == TokenType.PERIOD_PERIOD;
|
| -
|
| - /**
|
| - * Set the name of the property being accessed to the given identifier.
|
| - *
|
| - * @param identifier the name of the property being accessed
|
| - */
|
| - void set propertyName(SimpleIdentifier identifier) {
|
| - _propertyName = becomeParentOf(identifier);
|
| - }
|
| -
|
| /**
|
| * Set the expression computing the object defining the property being accessed to the given
|
| * expression.
|
| @@ -14005,6 +15122,9 @@ class PropertyAccess extends Expression {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitPropertyAccess(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_target, visitor);
|
| safelyVisitChild(_propertyName, visitor);
|
| @@ -14484,7 +15604,8 @@ class RecursiveAstVisitor<R> implements AstVisitor<R> {
|
| }
|
|
|
| @override
|
| - R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| + R
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| node.visitChildren(this);
|
| return null;
|
| }
|
| @@ -14705,14 +15826,12 @@ class RedirectingConstructorInvocation extends ConstructorInitializer {
|
| * @param constructorName the name of the constructor that is being invoked
|
| * @param argumentList the list of arguments to the constructor
|
| */
|
| - RedirectingConstructorInvocation(this.keyword, this.period, SimpleIdentifier constructorName, ArgumentList argumentList) {
|
| + RedirectingConstructorInvocation(this.keyword, this.period,
|
| + SimpleIdentifier constructorName, ArgumentList argumentList) {
|
| _constructorName = becomeParentOf(constructorName);
|
| _argumentList = becomeParentOf(argumentList);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitRedirectingConstructorInvocation(this);
|
| -
|
| /**
|
| * Return the list of arguments to the constructor.
|
| *
|
| @@ -14720,6 +15839,15 @@ class RedirectingConstructorInvocation extends ConstructorInitializer {
|
| */
|
| ArgumentList get argumentList => _argumentList;
|
|
|
| + /**
|
| + * Set the list of arguments to the constructor to the given list.
|
| + *
|
| + * @param argumentList the list of arguments to the constructor
|
| + */
|
| + void set argumentList(ArgumentList argumentList) {
|
| + _argumentList = becomeParentOf(argumentList);
|
| + }
|
| +
|
| @override
|
| Token get beginToken => keyword;
|
|
|
| @@ -14731,18 +15859,6 @@ class RedirectingConstructorInvocation extends ConstructorInitializer {
|
| */
|
| SimpleIdentifier get constructorName => _constructorName;
|
|
|
| - @override
|
| - Token get endToken => _argumentList.endToken;
|
| -
|
| - /**
|
| - * Set the list of arguments to the constructor to the given list.
|
| - *
|
| - * @param argumentList the list of arguments to the constructor
|
| - */
|
| - void set argumentList(ArgumentList argumentList) {
|
| - _argumentList = becomeParentOf(argumentList);
|
| - }
|
| -
|
| /**
|
| * Set the name of the constructor that is being invoked to the given identifier.
|
| *
|
| @@ -14753,6 +15869,13 @@ class RedirectingConstructorInvocation extends ConstructorInitializer {
|
| }
|
|
|
| @override
|
| + Token get endToken => _argumentList.endToken;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) =>
|
| + visitor.visitRedirectingConstructorInvocation(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_constructorName, visitor);
|
| safelyVisitChild(_argumentList, visitor);
|
| @@ -14781,9 +15904,6 @@ class RethrowExpression extends Expression {
|
| RethrowExpression(this.keyword);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitRethrowExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -14793,6 +15913,9 @@ class RethrowExpression extends Expression {
|
| int get precedence => 0;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitRethrowExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -14835,9 +15958,6 @@ class ReturnStatement extends Statement {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitReturnStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -14861,6 +15981,9 @@ class ReturnStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitReturnStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| @@ -14879,7 +16002,8 @@ class ScopedNameFinder extends GeneralizingAstVisitor<Object> {
|
|
|
| AstNode _immediateChild;
|
|
|
| - Map<String, SimpleIdentifier> _locals = new HashMap<String, SimpleIdentifier>();
|
| + Map<String, SimpleIdentifier> _locals =
|
| + new HashMap<String, SimpleIdentifier>();
|
|
|
| final int _position;
|
|
|
| @@ -14953,7 +16077,8 @@ class ScopedNameFinder extends GeneralizingAstVisitor<Object> {
|
|
|
| @override
|
| Object visitFunctionExpression(FunctionExpression node) {
|
| - if (node.parameters != null && !identical(_immediateChild, node.parameters)) {
|
| + if (node.parameters != null &&
|
| + !identical(_immediateChild, node.parameters)) {
|
| _addParameters(node.parameters.parameters);
|
| }
|
| return super.visitFunctionExpression(node);
|
| @@ -15032,7 +16157,8 @@ class ScopedNameFinder extends GeneralizingAstVisitor<Object> {
|
| }
|
| if (stmt is VariableDeclarationStatement) {
|
| _addVariables(stmt.variables.variables);
|
| - } else if (stmt is FunctionDeclarationStatement && !_referenceIsWithinLocalFunction) {
|
| + } else if (stmt is FunctionDeclarationStatement &&
|
| + !_referenceIsWithinLocalFunction) {
|
| _addToScope(stmt.functionDeclaration.name);
|
| }
|
| }
|
| @@ -15071,15 +16197,15 @@ class ScriptTag extends AstNode {
|
| ScriptTag(this.scriptTag);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitScriptTag(this);
|
| -
|
| - @override
|
| Token get beginToken => scriptTag;
|
|
|
| @override
|
| Token get endToken => scriptTag;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitScriptTag(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -15106,14 +16232,12 @@ class ShowCombinator extends Combinator {
|
| * @param keyword the comma introducing the combinator
|
| * @param shownNames the list of names from the library that are made visible by this combinator
|
| */
|
| - ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames) : super(keyword) {
|
| + ShowCombinator(Token keyword, List<SimpleIdentifier> shownNames)
|
| + : super(keyword) {
|
| _shownNames = new NodeList<SimpleIdentifier>(this, shownNames);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitShowCombinator(this);
|
| -
|
| - @override
|
| Token get endToken => _shownNames.endToken;
|
|
|
| /**
|
| @@ -15124,6 +16248,9 @@ class ShowCombinator extends Combinator {
|
| NodeList<SimpleIdentifier> get shownNames => _shownNames;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitShowCombinator(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _shownNames.accept(visitor);
|
| }
|
| @@ -15263,19 +16390,22 @@ class SimpleAstVisitor<R> implements AstVisitor<R> {
|
| R visitFunctionDeclaration(FunctionDeclaration node) => null;
|
|
|
| @override
|
| - R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => null;
|
| + R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
|
| + null;
|
|
|
| @override
|
| R visitFunctionExpression(FunctionExpression node) => null;
|
|
|
| @override
|
| - R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => null;
|
| + R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
|
| + null;
|
|
|
| @override
|
| R visitFunctionTypeAlias(FunctionTypeAlias node) => null;
|
|
|
| @override
|
| - R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => null;
|
| + R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
|
| + null;
|
|
|
| @override
|
| R visitHideCombinator(HideCombinator node) => null;
|
| @@ -15368,7 +16498,9 @@ class SimpleAstVisitor<R> implements AstVisitor<R> {
|
| R visitPropertyAccess(PropertyAccess node) => null;
|
|
|
| @override
|
| - R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => null;
|
| + R
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
|
| + null;
|
|
|
| @override
|
| R visitRethrowExpression(RethrowExpression node) => null;
|
| @@ -15443,7 +16575,8 @@ class SimpleAstVisitor<R> implements AstVisitor<R> {
|
| R visitVariableDeclarationList(VariableDeclarationList node) => null;
|
|
|
| @override
|
| - R visitVariableDeclarationStatement(VariableDeclarationStatement node) => null;
|
| + R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
|
| + null;
|
|
|
| @override
|
| R visitWhileStatement(WhileStatement node) => null;
|
| @@ -15485,14 +16618,13 @@ class SimpleFormalParameter extends NormalFormalParameter {
|
| * @param type the name of the declared type of the parameter
|
| * @param identifier the name of the parameter being declared
|
| */
|
| - SimpleFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, SimpleIdentifier identifier) : super(comment, metadata, identifier) {
|
| + SimpleFormalParameter(Comment comment, List<Annotation> metadata,
|
| + this.keyword, TypeName type, SimpleIdentifier identifier)
|
| + : super(comment, metadata, identifier) {
|
| _type = becomeParentOf(type);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| NodeList<Annotation> metadata = this.metadata;
|
| if (!metadata.isEmpty) {
|
| @@ -15508,6 +16640,14 @@ class SimpleFormalParameter extends NormalFormalParameter {
|
| @override
|
| Token get endToken => identifier.endToken;
|
|
|
| + @override
|
| + bool get isConst =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| +
|
| + @override
|
| + bool get isFinal =>
|
| + (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| +
|
| /**
|
| * Return the name of the declared type of the parameter, or `null` if the parameter does
|
| * not have a declared type.
|
| @@ -15516,12 +16656,6 @@ class SimpleFormalParameter extends NormalFormalParameter {
|
| */
|
| TypeName get type => _type;
|
|
|
| - @override
|
| - bool get isConst => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| -
|
| - @override
|
| - bool get isFinal => (keyword is KeywordToken) && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| -
|
| /**
|
| * Set the name of the declared type of the parameter to the given type name.
|
| *
|
| @@ -15532,6 +16666,9 @@ class SimpleFormalParameter extends NormalFormalParameter {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitSimpleFormalParameter(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_type, visitor);
|
| @@ -15585,9 +16722,6 @@ class SimpleIdentifier extends Identifier {
|
| SimpleIdentifier(this.token);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this);
|
| -
|
| - @override
|
| Token get beginToken => token;
|
|
|
| @override
|
| @@ -15595,11 +16729,37 @@ class SimpleIdentifier extends Identifier {
|
| if (_propagatedElement == null) {
|
| return _staticElement;
|
| }
|
| - return _propagatedElement;
|
| + return _propagatedElement;
|
| + }
|
| +
|
| + @override
|
| + Token get endToken => token;
|
| +
|
| + /**
|
| + * Returns `true` if this identifier is the "name" part of a prefixed identifier or a method
|
| + * invocation.
|
| + *
|
| + * @return `true` if this identifier is the "name" part of a prefixed identifier or a method
|
| + * invocation
|
| + */
|
| + bool get isQualified {
|
| + AstNode parent = this.parent;
|
| + if (parent is PrefixedIdentifier) {
|
| + return identical(parent.identifier, this);
|
| + }
|
| + if (parent is PropertyAccess) {
|
| + return identical(parent.propertyName, this);
|
| + }
|
| + if (parent is MethodInvocation) {
|
| + MethodInvocation invocation = parent;
|
| + return identical(invocation.methodName, this) &&
|
| + invocation.realTarget != null;
|
| + }
|
| + return false;
|
| }
|
|
|
| @override
|
| - Token get endToken => token;
|
| + bool get isSynthetic => token.isSynthetic;
|
|
|
| @override
|
| String get name => token.lexeme;
|
| @@ -15610,10 +16770,33 @@ class SimpleIdentifier extends Identifier {
|
| @override
|
| Element get propagatedElement => _propagatedElement;
|
|
|
| + /**
|
| + * Set the element associated with this identifier based on propagated type information to the
|
| + * given element.
|
| + *
|
| + * @param element the element to be associated with this identifier
|
| + */
|
| + void set propagatedElement(Element element) {
|
| + _propagatedElement = _validateElement(element);
|
| + }
|
| +
|
| @override
|
| Element get staticElement => _staticElement;
|
|
|
| /**
|
| + * Set the element associated with this identifier based on static type information to the given
|
| + * element.
|
| + *
|
| + * @param element the element to be associated with this identifier
|
| + */
|
| + void set staticElement(Element element) {
|
| + _staticElement = _validateElement(element);
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitSimpleIdentifier(this);
|
| +
|
| + /**
|
| * Return `true` if this identifier is the name being declared in a declaration.
|
| *
|
| * @return `true` if this identifier is the name being declared in a declaration
|
| @@ -15643,10 +16826,12 @@ class SimpleIdentifier extends Identifier {
|
| } else if (parent is ImportDirective) {
|
| return identical(this, parent.prefix);
|
| } else if (parent is Label) {
|
| - return identical(this, parent.label) && (parent.parent is LabeledStatement);
|
| + return identical(this, parent.label) &&
|
| + (parent.parent is LabeledStatement);
|
| } else if (parent is MethodDeclaration) {
|
| return identical(this, parent.name);
|
| - } else if (parent is FunctionTypedFormalParameter || parent is SimpleFormalParameter) {
|
| + } else if (parent is FunctionTypedFormalParameter ||
|
| + parent is SimpleFormalParameter) {
|
| return identical(this, (parent as NormalFormalParameter).identifier);
|
| } else if (parent is TypeParameter) {
|
| return identical(this, parent.name);
|
| @@ -15691,7 +16876,8 @@ class SimpleIdentifier extends Identifier {
|
| // analyze usage
|
| if (parent is AssignmentExpression) {
|
| AssignmentExpression expr = parent as AssignmentExpression;
|
| - if (identical(expr.leftHandSide, target) && expr.operator.type == TokenType.EQ) {
|
| + if (identical(expr.leftHandSide, target) &&
|
| + expr.operator.type == TokenType.EQ) {
|
| return false;
|
| }
|
| }
|
| @@ -15746,51 +16932,6 @@ class SimpleIdentifier extends Identifier {
|
| return false;
|
| }
|
|
|
| - /**
|
| - * Returns `true` if this identifier is the "name" part of a prefixed identifier or a method
|
| - * invocation.
|
| - *
|
| - * @return `true` if this identifier is the "name" part of a prefixed identifier or a method
|
| - * invocation
|
| - */
|
| - bool get isQualified {
|
| - AstNode parent = this.parent;
|
| - if (parent is PrefixedIdentifier) {
|
| - return identical(parent.identifier, this);
|
| - }
|
| - if (parent is PropertyAccess) {
|
| - return identical(parent.propertyName, this);
|
| - }
|
| - if (parent is MethodInvocation) {
|
| - MethodInvocation invocation = parent;
|
| - return identical(invocation.methodName, this) && invocation.realTarget != null;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - @override
|
| - bool get isSynthetic => token.isSynthetic;
|
| -
|
| - /**
|
| - * Set the element associated with this identifier based on propagated type information to the
|
| - * given element.
|
| - *
|
| - * @param element the element to be associated with this identifier
|
| - */
|
| - void set propagatedElement(Element element) {
|
| - _propagatedElement = _validateElement(element);
|
| - }
|
| -
|
| - /**
|
| - * Set the element associated with this identifier based on static type information to the given
|
| - * element.
|
| - *
|
| - * @param element the element to be associated with this identifier
|
| - */
|
| - void set staticElement(Element element) {
|
| - _staticElement = _validateElement(element);
|
| - }
|
| -
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| @@ -15805,7 +16946,8 @@ class SimpleIdentifier extends Identifier {
|
| * @param element the element to be associated with this identifier
|
| * @return the element to be associated with this identifier
|
| */
|
| - Element _returnOrReportElement(AstNode parent, bool isValid, Element element) {
|
| + Element _returnOrReportElement(AstNode parent, bool isValid,
|
| + Element element) {
|
| if (!isValid) {
|
| AnalysisEngine.instance.logger.logInformation(
|
| "Internal error: attempting to set the name of a ${parent.runtimeType} to a ${element.runtimeType}",
|
| @@ -15831,20 +16973,43 @@ class SimpleIdentifier extends Identifier {
|
| return _returnOrReportElement(parent, element is ClassElement, element);
|
| } else if (parent is ClassTypeAlias && identical(parent.name, this)) {
|
| return _returnOrReportElement(parent, element is ClassElement, element);
|
| - } else if (parent is DeclaredIdentifier && identical(parent.identifier, this)) {
|
| - return _returnOrReportElement(parent, element is LocalVariableElement, element);
|
| - } else if (parent is FormalParameter && identical(parent.identifier, this)) {
|
| - return _returnOrReportElement(parent, element is ParameterElement, element);
|
| + } else if (parent is DeclaredIdentifier &&
|
| + identical(parent.identifier, this)) {
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is LocalVariableElement,
|
| + element);
|
| + } else if (parent is FormalParameter &&
|
| + identical(parent.identifier, this)) {
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is ParameterElement,
|
| + element);
|
| } else if (parent is FunctionDeclaration && identical(parent.name, this)) {
|
| - return _returnOrReportElement(parent, element is ExecutableElement, element);
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is ExecutableElement,
|
| + element);
|
| } else if (parent is FunctionTypeAlias && identical(parent.name, this)) {
|
| - return _returnOrReportElement(parent, element is FunctionTypeAliasElement, element);
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is FunctionTypeAliasElement,
|
| + element);
|
| } else if (parent is MethodDeclaration && identical(parent.name, this)) {
|
| - return _returnOrReportElement(parent, element is ExecutableElement, element);
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is ExecutableElement,
|
| + element);
|
| } else if (parent is TypeParameter && identical(parent.name, this)) {
|
| - return _returnOrReportElement(parent, element is TypeParameterElement, element);
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is TypeParameterElement,
|
| + element);
|
| } else if (parent is VariableDeclaration && identical(parent.name, this)) {
|
| - return _returnOrReportElement(parent, element is VariableElement, element);
|
| + return _returnOrReportElement(
|
| + parent,
|
| + element is VariableElement,
|
| + element);
|
| }
|
| return element;
|
| }
|
| @@ -15902,10 +17067,12 @@ class SimpleStringLiteral extends SingleStringLiteral {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this);
|
| + Token get beginToken => literal;
|
|
|
| @override
|
| - Token get beginToken => literal;
|
| + int get contentsEnd {
|
| + return contentsOffset + value.length;
|
| + }
|
|
|
| @override
|
| int get contentsOffset {
|
| @@ -15922,20 +17089,8 @@ class SimpleStringLiteral extends SingleStringLiteral {
|
| }
|
|
|
| @override
|
| - int get contentsEnd {
|
| - return contentsOffset + value.length;
|
| - }
|
| -
|
| - @override
|
| Token get endToken => literal;
|
|
|
| - /**
|
| - * Return the value of the literal.
|
| - *
|
| - * @return the value of the literal
|
| - */
|
| - String get value => _value;
|
| -
|
| @override
|
| bool get isMultiline {
|
| String lexeme = literal.lexeme;
|
| @@ -15972,6 +17127,13 @@ class SimpleStringLiteral extends SingleStringLiteral {
|
| bool get isSynthetic => literal.isSynthetic;
|
|
|
| /**
|
| + * Return the value of the literal.
|
| + *
|
| + * @return the value of the literal
|
| + */
|
| + String get value => _value;
|
| +
|
| + /**
|
| * Set the value of the literal to the given string.
|
| *
|
| * @param string the value of the literal
|
| @@ -15981,14 +17143,55 @@ class SimpleStringLiteral extends SingleStringLiteral {
|
| }
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - // There are no children to visit.
|
| - }
|
| + accept(AstVisitor visitor) => visitor.visitSimpleStringLiteral(this);
|
|
|
| @override
|
| void appendStringValue(StringBuffer buffer) {
|
| buffer.write(value);
|
| }
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + // There are no children to visit.
|
| + }
|
| +}
|
| +
|
| +/**
|
| + * Instances of the class [SingleStringLiteral] represent a single string
|
| + * literal expression.
|
| + *
|
| + * <pre>
|
| + * singleStringLiteral ::=
|
| + * [SimpleStringLiteral]
|
| + * | [StringInterpolation]
|
| + * </pre>
|
| + */
|
| +abstract class SingleStringLiteral extends StringLiteral {
|
| + /**
|
| + * Return the offset of the after-last contents character.
|
| + */
|
| + int get contentsEnd;
|
| +
|
| + /**
|
| + * Return the offset of the first contents character.
|
| + */
|
| + int get contentsOffset;
|
| +
|
| + /**
|
| + * Return `true` if this string literal is a multi-line string.
|
| + */
|
| + bool get isMultiline;
|
| +
|
| + /**
|
| + * Return `true` if this string literal is a raw string.
|
| + */
|
| + bool get isRaw;
|
| +
|
| + /**
|
| + * Return `true` if this string literal uses single qoutes (' or ''').
|
| + * Return `false` if this string literal uses double qoutes (" or """).
|
| + */
|
| + bool get isSingleQuoted;
|
| }
|
|
|
| /**
|
| @@ -16041,29 +17244,12 @@ class StringInterpolation extends SingleStringLiteral {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitStringInterpolation(this);
|
| -
|
| - @override
|
| Token get beginToken => _elements.beginToken;
|
|
|
| - /**
|
| - * Return the elements that will be composed to produce the resulting string.
|
| - *
|
| - * @return the elements that will be composed to produce the resulting string
|
| - */
|
| - NodeList<InterpolationElement> get elements => _elements;
|
| -
|
| - @override
|
| - Token get endToken => _elements.endToken;
|
| -
|
| - @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - _elements.accept(visitor);
|
| - }
|
| -
|
| @override
|
| - void appendStringValue(StringBuffer buffer) {
|
| - throw new IllegalArgumentException();
|
| + int get contentsEnd {
|
| + InterpolationString element = _elements.last;
|
| + return element.contentsEnd;
|
| }
|
|
|
| @override
|
| @@ -16072,11 +17258,15 @@ class StringInterpolation extends SingleStringLiteral {
|
| return element.contentsOffset;
|
| }
|
|
|
| + /**
|
| + * Return the elements that will be composed to produce the resulting string.
|
| + *
|
| + * @return the elements that will be composed to produce the resulting string
|
| + */
|
| + NodeList<InterpolationElement> get elements => _elements;
|
| +
|
| @override
|
| - int get contentsEnd {
|
| - InterpolationString element = _elements.last;
|
| - return element.contentsEnd;
|
| - }
|
| + Token get endToken => _elements.endToken;
|
|
|
| @override
|
| bool get isMultiline {
|
| @@ -16092,84 +17282,59 @@ class StringInterpolation extends SingleStringLiteral {
|
| @override
|
| bool get isRaw => false;
|
|
|
| -
|
| @override
|
| bool get isSingleQuoted {
|
| InterpolationString lastString = _elements.first;
|
| String lexeme = lastString.contents.lexeme;
|
| return StringUtilities.startsWithChar(lexeme, 0x27);
|
| }
|
| -}
|
| -
|
| -/**
|
| - * Instances of the class `StringLiteral` represent a string literal expression.
|
| - *
|
| - * <pre>
|
| - * stringLiteral ::=
|
| - * [SimpleStringLiteral]
|
| - * | [AdjacentStrings]
|
| - * | [StringInterpolation]
|
| - * </pre>
|
| - */
|
| -abstract class StringLiteral extends Literal {
|
| - /**
|
| - * Return the value of the string literal, or `null` if the string is not a
|
| - * constant string without any string interpolation.
|
| - */
|
| - String get stringValue {
|
| - StringBuffer buffer = new StringBuffer();
|
| - try {
|
| - appendStringValue(buffer);
|
| - } on IllegalArgumentException catch (exception) {
|
| - return null;
|
| - }
|
| - return buffer.toString();
|
| - }
|
|
|
| - /**
|
| - * Append the value of this string literal to the given [buffer]. Throw an
|
| - * [IllegalArgumentException] if the string is not a constant string without
|
| - * any string interpolation.
|
| - */
|
| - void appendStringValue(StringBuffer buffer);
|
| -}
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitStringInterpolation(this);
|
|
|
| -/**
|
| - * Instances of the class [SingleStringLiteral] represent a single string
|
| - * literal expression.
|
| - *
|
| - * <pre>
|
| - * singleStringLiteral ::=
|
| - * [SimpleStringLiteral]
|
| - * | [StringInterpolation]
|
| - * </pre>
|
| - */
|
| -abstract class SingleStringLiteral extends StringLiteral {
|
| - /**
|
| - * Return the offset of the first contents character.
|
| - */
|
| - int get contentsOffset;
|
| + @override
|
| + void appendStringValue(StringBuffer buffer) {
|
| + throw new IllegalArgumentException();
|
| + }
|
|
|
| - /**
|
| - * Return the offset of the after-last contents character.
|
| - */
|
| - int get contentsEnd;
|
|
|
| - /**
|
| - * Return `true` if this string literal is a multi-line string.
|
| - */
|
| - bool get isMultiline;
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + _elements.accept(visitor);
|
| + }
|
| +}
|
|
|
| +/**
|
| + * Instances of the class `StringLiteral` represent a string literal expression.
|
| + *
|
| + * <pre>
|
| + * stringLiteral ::=
|
| + * [SimpleStringLiteral]
|
| + * | [AdjacentStrings]
|
| + * | [StringInterpolation]
|
| + * </pre>
|
| + */
|
| +abstract class StringLiteral extends Literal {
|
| /**
|
| - * Return `true` if this string literal is a raw string.
|
| + * Return the value of the string literal, or `null` if the string is not a
|
| + * constant string without any string interpolation.
|
| */
|
| - bool get isRaw;
|
| + String get stringValue {
|
| + StringBuffer buffer = new StringBuffer();
|
| + try {
|
| + appendStringValue(buffer);
|
| + } on IllegalArgumentException catch (exception) {
|
| + return null;
|
| + }
|
| + return buffer.toString();
|
| + }
|
|
|
| /**
|
| - * Return `true` if this string literal uses single qoutes (' or ''').
|
| - * Return `false` if this string literal uses double qoutes (" or """).
|
| + * Append the value of this string literal to the given [buffer]. Throw an
|
| + * [IllegalArgumentException] if the string is not a constant string without
|
| + * any string interpolation.
|
| */
|
| - bool get isSingleQuoted;
|
| + void appendStringValue(StringBuffer buffer);
|
| }
|
|
|
| /**
|
| @@ -16219,14 +17384,12 @@ class SuperConstructorInvocation extends ConstructorInitializer {
|
| * @param constructorName the name of the constructor that is being invoked
|
| * @param argumentList the list of arguments to the constructor
|
| */
|
| - SuperConstructorInvocation(this.keyword, this.period, SimpleIdentifier constructorName, ArgumentList argumentList) {
|
| + SuperConstructorInvocation(this.keyword, this.period,
|
| + SimpleIdentifier constructorName, ArgumentList argumentList) {
|
| _constructorName = becomeParentOf(constructorName);
|
| _argumentList = becomeParentOf(argumentList);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
|
| -
|
| /**
|
| * Return the list of arguments to the constructor.
|
| *
|
| @@ -16234,6 +17397,15 @@ class SuperConstructorInvocation extends ConstructorInitializer {
|
| */
|
| ArgumentList get argumentList => _argumentList;
|
|
|
| + /**
|
| + * Set the list of arguments to the constructor to the given list.
|
| + *
|
| + * @param argumentList the list of arguments to the constructor
|
| + */
|
| + void set argumentList(ArgumentList argumentList) {
|
| + _argumentList = becomeParentOf(argumentList);
|
| + }
|
| +
|
| @override
|
| Token get beginToken => keyword;
|
|
|
| @@ -16245,18 +17417,6 @@ class SuperConstructorInvocation extends ConstructorInitializer {
|
| */
|
| SimpleIdentifier get constructorName => _constructorName;
|
|
|
| - @override
|
| - Token get endToken => _argumentList.endToken;
|
| -
|
| - /**
|
| - * Set the list of arguments to the constructor to the given list.
|
| - *
|
| - * @param argumentList the list of arguments to the constructor
|
| - */
|
| - void set argumentList(ArgumentList argumentList) {
|
| - _argumentList = becomeParentOf(argumentList);
|
| - }
|
| -
|
| /**
|
| * Set the name of the constructor that is being invoked to the given identifier.
|
| *
|
| @@ -16267,6 +17427,12 @@ class SuperConstructorInvocation extends ConstructorInitializer {
|
| }
|
|
|
| @override
|
| + Token get endToken => _argumentList.endToken;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitSuperConstructorInvocation(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_constructorName, visitor);
|
| safelyVisitChild(_argumentList, visitor);
|
| @@ -16295,9 +17461,6 @@ class SuperExpression extends Expression {
|
| SuperExpression(this.keyword);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSuperExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -16307,6 +17470,9 @@ class SuperExpression extends Expression {
|
| int get precedence => 16;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitSuperExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -16335,13 +17501,12 @@ class SwitchCase extends SwitchMember {
|
| * @param colon the colon separating the keyword or the expression from the statements
|
| * @param statements the statements that will be executed if this switch member is selected
|
| */
|
| - SwitchCase(List<Label> labels, Token keyword, Expression expression, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements) {
|
| + SwitchCase(List<Label> labels, Token keyword, Expression expression,
|
| + Token colon, List<Statement> statements)
|
| + : super(labels, keyword, colon, statements) {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitSwitchCase(this);
|
| -
|
| /**
|
| * Return the expression controlling whether the statements will be executed.
|
| *
|
| @@ -16359,6 +17524,9 @@ class SwitchCase extends SwitchMember {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitSwitchCase(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| labels.accept(visitor);
|
| safelyVisitChild(_expression, visitor);
|
| @@ -16383,7 +17551,9 @@ class SwitchDefault extends SwitchMember {
|
| * @param colon the colon separating the keyword or the expression from the statements
|
| * @param statements the statements that will be executed if this switch member is selected
|
| */
|
| - SwitchDefault(List<Label> labels, Token keyword, Token colon, List<Statement> statements) : super(labels, keyword, colon, statements);
|
| + SwitchDefault(List<Label> labels, Token keyword, Token colon,
|
| + List<Statement> statements)
|
| + : super(labels, keyword, colon, statements);
|
|
|
| @override
|
| accept(AstVisitor visitor) => visitor.visitSwitchDefault(this);
|
| @@ -16434,7 +17604,8 @@ abstract class SwitchMember extends AstNode {
|
| * @param colon the colon separating the keyword or the expression from the statements
|
| * @param statements the statements that will be executed if this switch member is selected
|
| */
|
| - SwitchMember(List<Label> labels, this.keyword, this.colon, List<Statement> statements) {
|
| + SwitchMember(List<Label> labels, this.keyword, this.colon,
|
| + List<Statement> statements) {
|
| _labels = new NodeList<Label>(this, labels);
|
| _statements = new NodeList<Statement>(this, statements);
|
| }
|
| @@ -16525,15 +17696,14 @@ class SwitchStatement extends Statement {
|
| * @param members the switch members that can be selected by the expression
|
| * @param rightBracket the right curly bracket
|
| */
|
| - SwitchStatement(this.keyword, this.leftParenthesis, Expression expression, this.rightParenthesis, this.leftBracket, List<SwitchMember> members, this.rightBracket) {
|
| + SwitchStatement(this.keyword, this.leftParenthesis, Expression expression,
|
| + this.rightParenthesis, this.leftBracket, List<SwitchMember> members,
|
| + this.rightBracket) {
|
| _expression = becomeParentOf(expression);
|
| _members = new NodeList<SwitchMember>(this, members);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSwitchStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -16547,13 +17717,6 @@ class SwitchStatement extends Statement {
|
| Expression get expression => _expression;
|
|
|
| /**
|
| - * Return the switch members that can be selected by the expression.
|
| - *
|
| - * @return the switch members that can be selected by the expression
|
| - */
|
| - NodeList<SwitchMember> get members => _members;
|
| -
|
| - /**
|
| * Set the expression used to determine which of the switch members will be selected to the given
|
| * expression.
|
| *
|
| @@ -16563,6 +17726,16 @@ class SwitchStatement extends Statement {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| + /**
|
| + * Return the switch members that can be selected by the expression.
|
| + *
|
| + * @return the switch members that can be selected by the expression
|
| + */
|
| + NodeList<SwitchMember> get members => _members;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitSwitchStatement(this);
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| @@ -16598,15 +17771,15 @@ class SymbolLiteral extends Literal {
|
| SymbolLiteral(this.poundSign, this.components);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this);
|
| -
|
| - @override
|
| Token get beginToken => poundSign;
|
|
|
| @override
|
| Token get endToken => components[components.length - 1];
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitSymbolLiteral(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -16634,9 +17807,6 @@ class ThisExpression extends Expression {
|
| ThisExpression(this.keyword);
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitThisExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -16646,6 +17816,9 @@ class ThisExpression extends Expression {
|
| int get precedence => 16;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitThisExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| // There are no children to visit.
|
| }
|
| @@ -16681,9 +17854,6 @@ class ThrowExpression extends Expression {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitThrowExpression(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| @override
|
| @@ -16701,9 +17871,6 @@ class ThrowExpression extends Expression {
|
| */
|
| Expression get expression => _expression;
|
|
|
| - @override
|
| - int get precedence => 0;
|
| -
|
| /**
|
| * Set the expression computing the exception to be thrown to the given expression.
|
| *
|
| @@ -16714,12 +17881,88 @@ class ThrowExpression extends Expression {
|
| }
|
|
|
| @override
|
| + int get precedence => 0;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitThrowExpression(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_expression, visitor);
|
| }
|
| }
|
|
|
| /**
|
| + * Instances of the class `TopLevelVariableDeclaration` represent the declaration of one or
|
| + * more top-level variables of the same type.
|
| + *
|
| + * <pre>
|
| + * topLevelVariableDeclaration ::=
|
| + * ('final' | 'const') type? staticFinalDeclarationList ';'
|
| + * | variableDeclaration ';'
|
| + * </pre>
|
| + */
|
| +class TopLevelVariableDeclaration extends CompilationUnitMember {
|
| + /**
|
| + * The top-level variables being declared.
|
| + */
|
| + VariableDeclarationList _variableList;
|
| +
|
| + /**
|
| + * The semicolon terminating the declaration.
|
| + */
|
| + Token semicolon;
|
| +
|
| + /**
|
| + * Initialize a newly created top-level variable declaration.
|
| + *
|
| + * @param comment the documentation comment associated with this variable
|
| + * @param metadata the annotations associated with this variable
|
| + * @param variableList the top-level variables being declared
|
| + * @param semicolon the semicolon terminating the declaration
|
| + */
|
| + TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata,
|
| + VariableDeclarationList variableList, this.semicolon)
|
| + : super(comment, metadata) {
|
| + _variableList = becomeParentOf(variableList);
|
| + }
|
| +
|
| + @override
|
| + Element get element => null;
|
| +
|
| + @override
|
| + Token get endToken => semicolon;
|
| +
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
|
| +
|
| + /**
|
| + * Return the top-level variables being declared.
|
| + *
|
| + * @return the top-level variables being declared
|
| + */
|
| + VariableDeclarationList get variables => _variableList;
|
| +
|
| + /**
|
| + * Set the top-level variables being declared to the given list of variables.
|
| + *
|
| + * @param variableList the top-level variables being declared
|
| + */
|
| + void set variables(VariableDeclarationList variableList) {
|
| + _variableList = becomeParentOf(variableList);
|
| + }
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + super.visitChildren(visitor);
|
| + safelyVisitChild(_variableList, visitor);
|
| + }
|
| +}
|
| +
|
| +/**
|
| * Instances of the class `ToSourceVisitor` write a source representation of a visited AST
|
| * node (and all of it's children) to a writer.
|
| */
|
| @@ -17482,7 +18725,8 @@ class ToSourceVisitor implements AstVisitor<Object> {
|
| }
|
|
|
| @override
|
| - Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| + Object
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
|
| _writer.print("this");
|
| _visitNodeWithPrefix(".", node.constructorName);
|
| _visitNode(node.argumentList);
|
| @@ -17772,7 +19016,8 @@ class ToSourceVisitor implements AstVisitor<Object> {
|
| * @param nodes the nodes to be printed
|
| * @param separator the separator to be printed between adjacent nodes
|
| */
|
| - void _visitNodeListWithSeparatorAndPrefix(String prefix, NodeList<AstNode> nodes, String separator) {
|
| + void _visitNodeListWithSeparatorAndPrefix(String prefix,
|
| + NodeList<AstNode> nodes, String separator) {
|
| if (nodes != null) {
|
| int size = nodes.length;
|
| if (size > 0) {
|
| @@ -17794,7 +19039,8 @@ class ToSourceVisitor implements AstVisitor<Object> {
|
| * @param separator the separator to be printed between adjacent nodes
|
| * @param suffix the suffix to be printed if the list is not empty
|
| */
|
| - void _visitNodeListWithSeparatorAndSuffix(NodeList<AstNode> nodes, String separator, String suffix) {
|
| + void _visitNodeListWithSeparatorAndSuffix(NodeList<AstNode> nodes,
|
| + String separator, String suffix) {
|
| if (nodes != null) {
|
| int size = nodes.length;
|
| if (size > 0) {
|
| @@ -17850,74 +19096,6 @@ class ToSourceVisitor implements AstVisitor<Object> {
|
| }
|
|
|
| /**
|
| - * Instances of the class `TopLevelVariableDeclaration` represent the declaration of one or
|
| - * more top-level variables of the same type.
|
| - *
|
| - * <pre>
|
| - * topLevelVariableDeclaration ::=
|
| - * ('final' | 'const') type? staticFinalDeclarationList ';'
|
| - * | variableDeclaration ';'
|
| - * </pre>
|
| - */
|
| -class TopLevelVariableDeclaration extends CompilationUnitMember {
|
| - /**
|
| - * The top-level variables being declared.
|
| - */
|
| - VariableDeclarationList _variableList;
|
| -
|
| - /**
|
| - * The semicolon terminating the declaration.
|
| - */
|
| - Token semicolon;
|
| -
|
| - /**
|
| - * Initialize a newly created top-level variable declaration.
|
| - *
|
| - * @param comment the documentation comment associated with this variable
|
| - * @param metadata the annotations associated with this variable
|
| - * @param variableList the top-level variables being declared
|
| - * @param semicolon the semicolon terminating the declaration
|
| - */
|
| - TopLevelVariableDeclaration(Comment comment, List<Annotation> metadata, VariableDeclarationList variableList, this.semicolon) : super(comment, metadata) {
|
| - _variableList = becomeParentOf(variableList);
|
| - }
|
| -
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitTopLevelVariableDeclaration(this);
|
| -
|
| - @override
|
| - Element get element => null;
|
| -
|
| - @override
|
| - Token get endToken => semicolon;
|
| -
|
| - /**
|
| - * Return the top-level variables being declared.
|
| - *
|
| - * @return the top-level variables being declared
|
| - */
|
| - VariableDeclarationList get variables => _variableList;
|
| -
|
| - /**
|
| - * Set the top-level variables being declared to the given list of variables.
|
| - *
|
| - * @param variableList the top-level variables being declared
|
| - */
|
| - void set variables(VariableDeclarationList variableList) {
|
| - _variableList = becomeParentOf(variableList);
|
| - }
|
| -
|
| - @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - super.visitChildren(visitor);
|
| - safelyVisitChild(_variableList, visitor);
|
| - }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
|
| -}
|
| -
|
| -/**
|
| * Instances of the class `TryStatement` represent a try statement.
|
| *
|
| * <pre>
|
| @@ -17965,14 +19143,12 @@ class TryStatement extends Statement {
|
| * @param finallyKeyword the token representing the 'finally' keyword
|
| * @param finallyBlock the finally block contained in the try statement
|
| */
|
| - TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses, this.finallyKeyword, Block finallyBlock) {
|
| + TryStatement(this.tryKeyword, Block body, List<CatchClause> catchClauses,
|
| + this.finallyKeyword, Block finallyBlock) {
|
| _body = becomeParentOf(body);
|
| _catchClauses = new NodeList<CatchClause>(this, catchClauses);
|
| _finallyBlock = becomeParentOf(finallyBlock);
|
| - }
|
| -
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitTryStatement(this);
|
| + }
|
|
|
| @override
|
| Token get beginToken => tryKeyword;
|
| @@ -17985,6 +19161,15 @@ class TryStatement extends Statement {
|
| Block get body => _body;
|
|
|
| /**
|
| + * Set the body of the statement to the given block.
|
| + *
|
| + * @param block the body of the statement
|
| + */
|
| + void set body(Block block) {
|
| + _body = becomeParentOf(block);
|
| + }
|
| +
|
| + /**
|
| * Return the catch clauses contained in the try statement.
|
| *
|
| * @return the catch clauses contained in the try statement
|
| @@ -18012,15 +19197,6 @@ class TryStatement extends Statement {
|
| Block get finallyBlock => _finallyBlock;
|
|
|
| /**
|
| - * Set the body of the statement to the given block.
|
| - *
|
| - * @param block the body of the statement
|
| - */
|
| - void set body(Block block) {
|
| - _body = becomeParentOf(block);
|
| - }
|
| -
|
| - /**
|
| * Set the finally block contained in the try statement to the given block.
|
| *
|
| * @param block the finally block contained in the try statement
|
| @@ -18030,6 +19206,9 @@ class TryStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitTryStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_body, visitor);
|
| _catchClauses.accept(visitor);
|
| @@ -18068,7 +19247,9 @@ abstract class TypeAlias extends CompilationUnitMember {
|
| * @param keyword the token representing the 'typedef' keyword
|
| * @param semicolon the semicolon terminating the declaration
|
| */
|
| - TypeAlias(Comment comment, List<Annotation> metadata, this.keyword, this.semicolon) : super(comment, metadata);
|
| + TypeAlias(Comment comment, List<Annotation> metadata, this.keyword,
|
| + this.semicolon)
|
| + : super(comment, metadata);
|
|
|
| @override
|
| Token get endToken => semicolon;
|
| @@ -18108,13 +19289,11 @@ class TypeArgumentList extends AstNode {
|
| * @param arguments the type arguments associated with the type
|
| * @param rightBracket the right bracket
|
| */
|
| - TypeArgumentList(this.leftBracket, List<TypeName> arguments, this.rightBracket) {
|
| + TypeArgumentList(this.leftBracket, List<TypeName> arguments,
|
| + this.rightBracket) {
|
| _arguments = new NodeList<TypeName>(this, arguments);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this);
|
| -
|
| /**
|
| * Return the type arguments associated with the type.
|
| *
|
| @@ -18129,12 +19308,71 @@ class TypeArgumentList extends AstNode {
|
| Token get endToken => rightBracket;
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitTypeArgumentList(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| _arguments.accept(visitor);
|
| }
|
| }
|
|
|
| /**
|
| + * The abstract class `TypedLiteral` defines the behavior common to literals that have a type
|
| + * associated with them.
|
| + *
|
| + * <pre>
|
| + * listLiteral ::=
|
| + * [ListLiteral]
|
| + * | [MapLiteral]
|
| + * </pre>
|
| + */
|
| +abstract class TypedLiteral extends Literal {
|
| + /**
|
| + * The token representing the 'const' keyword, or `null` if the literal is not a constant.
|
| + */
|
| + Token constKeyword;
|
| +
|
| + /**
|
| + * The type argument associated with this literal, or `null` if no type arguments were
|
| + * declared.
|
| + */
|
| + TypeArgumentList _typeArguments;
|
| +
|
| + /**
|
| + * Initialize a newly created typed literal.
|
| + *
|
| + * @param constKeyword the token representing the 'const' keyword
|
| + * @param typeArguments the type argument associated with this literal, or `null` if no type
|
| + * arguments were declared
|
| + */
|
| + TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
|
| + _typeArguments = becomeParentOf(typeArguments);
|
| + }
|
| +
|
| + /**
|
| + * Return the type argument associated with this literal, or `null` if no type arguments
|
| + * were declared.
|
| + *
|
| + * @return the type argument associated with this literal
|
| + */
|
| + TypeArgumentList get typeArguments => _typeArguments;
|
| +
|
| + /**
|
| + * Set the type argument associated with this literal to the given arguments.
|
| + *
|
| + * @param typeArguments the type argument associated with this literal
|
| + */
|
| + void set typeArguments(TypeArgumentList typeArguments) {
|
| + _typeArguments = becomeParentOf(typeArguments);
|
| + }
|
| +
|
| + @override
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_typeArguments, visitor);
|
| + }
|
| +}
|
| +
|
| +/**
|
| * Instances of the class `TypeName` represent the name of a type, which can optionally
|
| * include type arguments.
|
| *
|
| @@ -18172,9 +19410,6 @@ class TypeName extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitTypeName(this);
|
| -
|
| - @override
|
| Token get beginToken => _name.beginToken;
|
|
|
| @override
|
| @@ -18186,21 +19421,6 @@ class TypeName extends AstNode {
|
| }
|
|
|
| /**
|
| - * Return the name of the type.
|
| - *
|
| - * @return the name of the type
|
| - */
|
| - Identifier get name => _name;
|
| -
|
| - /**
|
| - * Return the type arguments associated with the type, or `null` if there are no type
|
| - * arguments.
|
| - *
|
| - * @return the type arguments associated with the type
|
| - */
|
| - TypeArgumentList get typeArguments => _typeArguments;
|
| -
|
| - /**
|
| * Return `true` if this type is a deferred type.
|
| *
|
| * 15.1 Static Types: A type <i>T</i> is deferred iff it is of the form </i>p.T</i> where <i>p</i>
|
| @@ -18220,6 +19440,13 @@ class TypeName extends AstNode {
|
| bool get isSynthetic => _name.isSynthetic && _typeArguments == null;
|
|
|
| /**
|
| + * Return the name of the type.
|
| + *
|
| + * @return the name of the type
|
| + */
|
| + Identifier get name => _name;
|
| +
|
| + /**
|
| * Set the name of the type to the given identifier.
|
| *
|
| * @param identifier the name of the type
|
| @@ -18229,6 +19456,14 @@ class TypeName extends AstNode {
|
| }
|
|
|
| /**
|
| + * Return the type arguments associated with the type, or `null` if there are no type
|
| + * arguments.
|
| + *
|
| + * @return the type arguments associated with the type
|
| + */
|
| + TypeArgumentList get typeArguments => _typeArguments;
|
| +
|
| + /**
|
| * Set the type arguments associated with the type to the given type arguments.
|
| *
|
| * @param typeArguments the type arguments associated with the type
|
| @@ -18238,6 +19473,9 @@ class TypeName extends AstNode {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitTypeName(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_typeArguments, visitor);
|
| @@ -18279,14 +19517,13 @@ class TypeParameter extends Declaration {
|
| * @param keyword the token representing the 'extends' keyword
|
| * @param bound the name of the upper bound for legal arguments
|
| */
|
| - TypeParameter(Comment comment, List<Annotation> metadata, SimpleIdentifier name, this.keyword, TypeName bound) : super(comment, metadata) {
|
| + TypeParameter(Comment comment, List<Annotation> metadata,
|
| + SimpleIdentifier name, this.keyword, TypeName bound)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| _bound = becomeParentOf(bound);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitTypeParameter(this);
|
| -
|
| /**
|
| * Return the name of the upper bound for legal arguments, or `null` if there was no
|
| * explicit upper bound.
|
| @@ -18295,8 +19532,18 @@ class TypeParameter extends Declaration {
|
| */
|
| TypeName get bound => _bound;
|
|
|
| + /**
|
| + * Set the name of the upper bound for legal arguments to the given type name.
|
| + *
|
| + * @param typeName the name of the upper bound for legal arguments
|
| + */
|
| + void set bound(TypeName typeName) {
|
| + _bound = becomeParentOf(typeName);
|
| + }
|
| +
|
| @override
|
| - TypeParameterElement get element => _name != null ? (_name.staticElement as TypeParameterElement) : null;
|
| + TypeParameterElement get element =>
|
| + _name != null ? (_name.staticElement as TypeParameterElement) : null;
|
|
|
| @override
|
| Token get endToken {
|
| @@ -18306,6 +19553,9 @@ class TypeParameter extends Declaration {
|
| return _bound.endToken;
|
| }
|
|
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
| +
|
| /**
|
| * Return the name of the type parameter.
|
| *
|
| @@ -18314,15 +19564,6 @@ class TypeParameter extends Declaration {
|
| SimpleIdentifier get name => _name;
|
|
|
| /**
|
| - * Set the name of the upper bound for legal arguments to the given type name.
|
| - *
|
| - * @param typeName the name of the upper bound for legal arguments
|
| - */
|
| - void set bound(TypeName typeName) {
|
| - _bound = becomeParentOf(typeName);
|
| - }
|
| -
|
| - /**
|
| * Set the name of the type parameter to the given identifier.
|
| *
|
| * @param identifier the name of the type parameter
|
| @@ -18332,14 +19573,14 @@ class TypeParameter extends Declaration {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitTypeParameter(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_bound, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
| }
|
|
|
| /**
|
| @@ -18373,14 +19614,12 @@ class TypeParameterList extends AstNode {
|
| * @param typeParameters the type parameters in the list
|
| * @param rightBracket the right angle bracket
|
| */
|
| - TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters, this.rightBracket) {
|
| + TypeParameterList(this.leftBracket, List<TypeParameter> typeParameters,
|
| + this.rightBracket) {
|
| _typeParameters = new NodeList<TypeParameter>(this, typeParameters);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitTypeParameterList(this);
|
| -
|
| - @override
|
| Token get beginToken => leftBracket;
|
|
|
| @override
|
| @@ -18394,64 +19633,11 @@ class TypeParameterList extends AstNode {
|
| NodeList<TypeParameter> get typeParameters => _typeParameters;
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - _typeParameters.accept(visitor);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * The abstract class `TypedLiteral` defines the behavior common to literals that have a type
|
| - * associated with them.
|
| - *
|
| - * <pre>
|
| - * listLiteral ::=
|
| - * [ListLiteral]
|
| - * | [MapLiteral]
|
| - * </pre>
|
| - */
|
| -abstract class TypedLiteral extends Literal {
|
| - /**
|
| - * The token representing the 'const' keyword, or `null` if the literal is not a constant.
|
| - */
|
| - Token constKeyword;
|
| -
|
| - /**
|
| - * The type argument associated with this literal, or `null` if no type arguments were
|
| - * declared.
|
| - */
|
| - TypeArgumentList _typeArguments;
|
| -
|
| - /**
|
| - * Initialize a newly created typed literal.
|
| - *
|
| - * @param constKeyword the token representing the 'const' keyword
|
| - * @param typeArguments the type argument associated with this literal, or `null` if no type
|
| - * arguments were declared
|
| - */
|
| - TypedLiteral(this.constKeyword, TypeArgumentList typeArguments) {
|
| - _typeArguments = becomeParentOf(typeArguments);
|
| - }
|
| -
|
| - /**
|
| - * Return the type argument associated with this literal, or `null` if no type arguments
|
| - * were declared.
|
| - *
|
| - * @return the type argument associated with this literal
|
| - */
|
| - TypeArgumentList get typeArguments => _typeArguments;
|
| -
|
| - /**
|
| - * Set the type argument associated with this literal to the given arguments.
|
| - *
|
| - * @param typeArguments the type argument associated with this literal
|
| - */
|
| - void set typeArguments(TypeArgumentList typeArguments) {
|
| - _typeArguments = becomeParentOf(typeArguments);
|
| - }
|
| + accept(AstVisitor visitor) => visitor.visitTypeParameterList(this);
|
|
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_typeArguments, visitor);
|
| + _typeParameters.accept(visitor);
|
| }
|
| }
|
|
|
| @@ -18530,7 +19716,8 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitConstructorDeclaration(ConstructorDeclaration node) => visitNode(node);
|
|
|
| @override
|
| - R visitConstructorFieldInitializer(ConstructorFieldInitializer node) => visitNode(node);
|
| + R visitConstructorFieldInitializer(ConstructorFieldInitializer node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitConstructorName(ConstructorName node) => visitNode(node);
|
| @@ -18557,7 +19744,8 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitEmptyStatement(EmptyStatement node) => visitNode(node);
|
|
|
| @override
|
| - R visitEnumConstantDeclaration(EnumConstantDeclaration node) => visitNode(node);
|
| + R visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitEnumDeclaration(EnumDeclaration node) => visitNode(node);
|
| @@ -18593,19 +19781,22 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitFunctionDeclaration(FunctionDeclaration node) => visitNode(node);
|
|
|
| @override
|
| - R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) => visitNode(node);
|
| + R visitFunctionDeclarationStatement(FunctionDeclarationStatement node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitFunctionExpression(FunctionExpression node) => visitNode(node);
|
|
|
| @override
|
| - R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) => visitNode(node);
|
| + R visitFunctionExpressionInvocation(FunctionExpressionInvocation node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitFunctionTypeAlias(FunctionTypeAlias node) => visitNode(node);
|
|
|
| @override
|
| - R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) => visitNode(node);
|
| + R visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitHideCombinator(HideCombinator node) => visitNode(node);
|
| @@ -18623,13 +19814,15 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitIndexExpression(IndexExpression node) => visitNode(node);
|
|
|
| @override
|
| - R visitInstanceCreationExpression(InstanceCreationExpression node) => visitNode(node);
|
| + R visitInstanceCreationExpression(InstanceCreationExpression node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitIntegerLiteral(IntegerLiteral node) => visitNode(node);
|
|
|
| @override
|
| - R visitInterpolationExpression(InterpolationExpression node) => visitNode(node);
|
| + R visitInterpolationExpression(InterpolationExpression node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitInterpolationString(InterpolationString node) => visitNode(node);
|
| @@ -18682,7 +19875,8 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitNullLiteral(NullLiteral node) => visitNode(node);
|
|
|
| @override
|
| - R visitParenthesizedExpression(ParenthesizedExpression node) => visitNode(node);
|
| + R visitParenthesizedExpression(ParenthesizedExpression node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitPartDirective(PartDirective node) => visitNode(node);
|
| @@ -18703,7 +19897,9 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitPropertyAccess(PropertyAccess node) => visitNode(node);
|
|
|
| @override
|
| - R visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) => visitNode(node);
|
| + R
|
| + visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitRethrowExpression(RethrowExpression node) => visitNode(node);
|
| @@ -18730,7 +19926,8 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitStringInterpolation(StringInterpolation node) => visitNode(node);
|
|
|
| @override
|
| - R visitSuperConstructorInvocation(SuperConstructorInvocation node) => visitNode(node);
|
| + R visitSuperConstructorInvocation(SuperConstructorInvocation node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitSuperExpression(SuperExpression node) => visitNode(node);
|
| @@ -18754,7 +19951,8 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitThrowExpression(ThrowExpression node) => visitNode(node);
|
|
|
| @override
|
| - R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) => visitNode(node);
|
| + R visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitTryStatement(TryStatement node) => visitNode(node);
|
| @@ -18775,10 +19973,12 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| R visitVariableDeclaration(VariableDeclaration node) => visitNode(node);
|
|
|
| @override
|
| - R visitVariableDeclarationList(VariableDeclarationList node) => visitNode(node);
|
| + R visitVariableDeclarationList(VariableDeclarationList node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| - R visitVariableDeclarationStatement(VariableDeclarationStatement node) => visitNode(node);
|
| + R visitVariableDeclarationStatement(VariableDeclarationStatement node) =>
|
| + visitNode(node);
|
|
|
| @override
|
| R visitWhileStatement(WhileStatement node) => visitNode(node);
|
| @@ -18803,14 +20003,14 @@ class UnifyingAstVisitor<R> implements AstVisitor<R> {
|
| */
|
| abstract class UriBasedDirective extends Directive {
|
| /**
|
| - * The URI referenced by this directive.
|
| + * The prefix of a URI using the `dart-ext` scheme to reference a native code library.
|
| */
|
| - StringLiteral _uri;
|
| + static String _DART_EXT_SCHEME = "dart-ext:";
|
|
|
| /**
|
| - * The prefix of a URI using the `dart-ext` scheme to reference a native code library.
|
| + * The URI referenced by this directive.
|
| */
|
| - static String _DART_EXT_SCHEME = "dart-ext:";
|
| + StringLiteral _uri;
|
|
|
| /**
|
| * The content of the URI.
|
| @@ -18829,7 +20029,9 @@ abstract class UriBasedDirective extends Directive {
|
| * @param metadata the annotations associated with the directive
|
| * @param uri the URI referenced by this directive
|
| */
|
| - UriBasedDirective(Comment comment, List<Annotation> metadata, StringLiteral uri) : super(comment, metadata) {
|
| + UriBasedDirective(Comment comment, List<Annotation> metadata,
|
| + StringLiteral uri)
|
| + : super(comment, metadata) {
|
| _uri = becomeParentOf(uri);
|
| }
|
|
|
| @@ -18841,15 +20043,6 @@ abstract class UriBasedDirective extends Directive {
|
| StringLiteral get uri => _uri;
|
|
|
| /**
|
| - * Return the element associated with the URI of this directive, or `null` if the AST
|
| - * structure has not been resolved or if the URI could not be resolved. Examples of the latter
|
| - * case include a directive that contains an invalid URL or a URL that does not exist.
|
| - *
|
| - * @return the element associated with this directive
|
| - */
|
| - Element get uriElement;
|
| -
|
| - /**
|
| * Set the URI referenced by this directive to the given URI.
|
| *
|
| * @param uri the URI referenced by this directive
|
| @@ -18859,6 +20052,15 @@ abstract class UriBasedDirective extends Directive {
|
| }
|
|
|
| /**
|
| + * Return the element associated with the URI of this directive, or `null` if the AST
|
| + * structure has not been resolved or if the URI could not be resolved. Examples of the latter
|
| + * case include a directive that contains an invalid URL or a URL that does not exist.
|
| + *
|
| + * @return the element associated with this directive
|
| + */
|
| + Element get uriElement;
|
| +
|
| + /**
|
| * Validate the given directive, but do not check for existence.
|
| *
|
| * @return a code indicating the problem if there is one, or `null` no problem
|
| @@ -18894,17 +20096,20 @@ abstract class UriBasedDirective extends Directive {
|
| * Validation codes returned by [UriBasedDirective.validate].
|
| */
|
| class UriValidationCode {
|
| + static const UriValidationCode INVALID_URI =
|
| + const UriValidationCode('INVALID_URI');
|
| +
|
| + static const UriValidationCode URI_WITH_INTERPOLATION =
|
| + const UriValidationCode('URI_WITH_INTERPOLATION');
|
| +
|
| + static const UriValidationCode URI_WITH_DART_EXT_SCHEME =
|
| + const UriValidationCode('URI_WITH_DART_EXT_SCHEME');
|
| +
|
| /**
|
| * The name of the validation code.
|
| */
|
| final String name;
|
|
|
| - static const UriValidationCode INVALID_URI = const UriValidationCode('INVALID_URI');
|
| -
|
| - static const UriValidationCode URI_WITH_INTERPOLATION = const UriValidationCode('URI_WITH_INTERPOLATION');
|
| -
|
| - static const UriValidationCode URI_WITH_DART_EXT_SCHEME = const UriValidationCode('URI_WITH_DART_EXT_SCHEME');
|
| -
|
| /**
|
| * Initialize a newly created validation code to have the given [name].
|
| */
|
| @@ -18951,14 +20156,13 @@ class VariableDeclaration extends Declaration {
|
| * @param equals the equal sign separating the variable name from the initial value
|
| * @param initializer the expression used to compute the initial value for the variable
|
| */
|
| - VariableDeclaration(Comment comment, List<Annotation> metadata, SimpleIdentifier name, this.equals, Expression initializer) : super(comment, metadata) {
|
| + VariableDeclaration(Comment comment, List<Annotation> metadata,
|
| + SimpleIdentifier name, this.equals, Expression initializer)
|
| + : super(comment, metadata) {
|
| _name = becomeParentOf(name);
|
| _initializer = becomeParentOf(initializer);
|
| }
|
|
|
| - @override
|
| - accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this);
|
| -
|
| /**
|
| * This overridden implementation of getDocumentationComment() looks in the grandparent node for
|
| * dartdoc comments if no documentation is specifically available on the node.
|
| @@ -18978,7 +20182,8 @@ class VariableDeclaration extends Declaration {
|
| }
|
|
|
| @override
|
| - VariableElement get element => _name != null ? (_name.staticElement as VariableElement) : null;
|
| + VariableElement get element =>
|
| + _name != null ? (_name.staticElement as VariableElement) : null;
|
|
|
| @override
|
| Token get endToken {
|
| @@ -18988,6 +20193,9 @@ class VariableDeclaration extends Declaration {
|
| return _name.endToken;
|
| }
|
|
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
| +
|
| /**
|
| * Return the expression used to compute the initial value for the variable, or `null` if
|
| * the initial value was not specified.
|
| @@ -18997,11 +20205,13 @@ class VariableDeclaration extends Declaration {
|
| Expression get initializer => _initializer;
|
|
|
| /**
|
| - * Return the name of the variable being declared.
|
| + * Set the expression used to compute the initial value for the variable to the given expression.
|
| *
|
| - * @return the name of the variable being declared
|
| + * @param initializer the expression used to compute the initial value for the variable
|
| */
|
| - SimpleIdentifier get name => _name;
|
| + void set initializer(Expression initializer) {
|
| + _initializer = becomeParentOf(initializer);
|
| + }
|
|
|
| /**
|
| * Return `true` if this variable was declared with the 'const' modifier.
|
| @@ -19026,13 +20236,11 @@ class VariableDeclaration extends Declaration {
|
| }
|
|
|
| /**
|
| - * Set the expression used to compute the initial value for the variable to the given expression.
|
| + * Return the name of the variable being declared.
|
| *
|
| - * @param initializer the expression used to compute the initial value for the variable
|
| + * @return the name of the variable being declared
|
| */
|
| - void set initializer(Expression initializer) {
|
| - _initializer = becomeParentOf(initializer);
|
| - }
|
| + SimpleIdentifier get name => _name;
|
|
|
| /**
|
| * Set the name of the variable being declared to the given identifier.
|
| @@ -19044,14 +20252,14 @@ class VariableDeclaration extends Declaration {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitVariableDeclaration(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_name, visitor);
|
| safelyVisitChild(_initializer, visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
|
| }
|
|
|
| /**
|
| @@ -19095,37 +20303,33 @@ class VariableDeclarationList extends AnnotatedNode {
|
| * @param type the type of the variables being declared
|
| * @param variables a list containing the individual variables being declared
|
| */
|
| - VariableDeclarationList(Comment comment, List<Annotation> metadata, this.keyword, TypeName type, List<VariableDeclaration> variables) : super(comment, metadata) {
|
| + VariableDeclarationList(Comment comment, List<Annotation> metadata,
|
| + this.keyword, TypeName type, List<VariableDeclaration> variables)
|
| + : super(comment, metadata) {
|
| _type = becomeParentOf(type);
|
| _variables = new NodeList<VariableDeclaration>(this, variables);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this);
|
| -
|
| - @override
|
| Token get endToken => _variables.endToken;
|
|
|
| - /**
|
| - * Return the type of the variables being declared, or `null` if no type was provided.
|
| - *
|
| - * @return the type of the variables being declared
|
| - */
|
| - TypeName get type => _type;
|
| -
|
| - /**
|
| - * Return a list containing the individual variables being declared.
|
| - *
|
| - * @return a list containing the individual variables being declared
|
| - */
|
| - NodeList<VariableDeclaration> get variables => _variables;
|
| + @override
|
| + Token get firstTokenAfterCommentAndMetadata {
|
| + if (keyword != null) {
|
| + return keyword;
|
| + } else if (_type != null) {
|
| + return _type.beginToken;
|
| + }
|
| + return _variables.beginToken;
|
| + }
|
|
|
| /**
|
| * Return `true` if the variables in this list were declared with the 'const' modifier.
|
| *
|
| * @return `true` if the variables in this list were declared with the 'const' modifier
|
| */
|
| - bool get isConst => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
|
| + bool get isConst =>
|
| + keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.CONST;
|
|
|
| /**
|
| * Return `true` if the variables in this list were declared with the 'final' modifier.
|
| @@ -19134,7 +20338,15 @@ class VariableDeclarationList extends AnnotatedNode {
|
| *
|
| * @return `true` if the variables in this list were declared with the 'final' modifier
|
| */
|
| - bool get isFinal => keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| + bool get isFinal =>
|
| + keyword is KeywordToken && (keyword as KeywordToken).keyword == Keyword.FINAL;
|
| +
|
| + /**
|
| + * Return the type of the variables being declared, or `null` if no type was provided.
|
| + *
|
| + * @return the type of the variables being declared
|
| + */
|
| + TypeName get type => _type;
|
|
|
| /**
|
| * Set the type of the variables being declared to the given type name.
|
| @@ -19145,22 +20357,22 @@ class VariableDeclarationList extends AnnotatedNode {
|
| _type = becomeParentOf(typeName);
|
| }
|
|
|
| + /**
|
| + * Return a list containing the individual variables being declared.
|
| + *
|
| + * @return a list containing the individual variables being declared
|
| + */
|
| + NodeList<VariableDeclaration> get variables => _variables;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitVariableDeclarationList(this);
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| super.visitChildren(visitor);
|
| safelyVisitChild(_type, visitor);
|
| _variables.accept(visitor);
|
| }
|
| -
|
| - @override
|
| - Token get firstTokenAfterCommentAndMetadata {
|
| - if (keyword != null) {
|
| - return keyword;
|
| - } else if (_type != null) {
|
| - return _type.beginToken;
|
| - }
|
| - return _variables.beginToken;
|
| - }
|
| }
|
|
|
| /**
|
| @@ -19189,14 +20401,12 @@ class VariableDeclarationStatement extends Statement {
|
| * @param variableList the fields being declared
|
| * @param semicolon the semicolon terminating the statement
|
| */
|
| - VariableDeclarationStatement(VariableDeclarationList variableList, this.semicolon) {
|
| + VariableDeclarationStatement(VariableDeclarationList variableList,
|
| + this.semicolon) {
|
| _variableList = becomeParentOf(variableList);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => _variableList.beginToken;
|
|
|
| @override
|
| @@ -19219,6 +20429,9 @@ class VariableDeclarationStatement extends Statement {
|
| }
|
|
|
| @override
|
| + accept(AstVisitor visitor) => visitor.visitVariableDeclarationStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_variableList, visitor);
|
| }
|
| @@ -19267,15 +20480,13 @@ class WhileStatement extends Statement {
|
| * @param rightParenthesis the right parenthesis
|
| * @param body the body of the loop
|
| */
|
| - WhileStatement(this.keyword, this.leftParenthesis, Expression condition, this.rightParenthesis, Statement body) {
|
| + WhileStatement(this.keyword, this.leftParenthesis, Expression condition,
|
| + this.rightParenthesis, Statement body) {
|
| _condition = becomeParentOf(condition);
|
| _body = becomeParentOf(body);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitWhileStatement(this);
|
| -
|
| - @override
|
| Token get beginToken => keyword;
|
|
|
| /**
|
| @@ -19286,16 +20497,6 @@ class WhileStatement extends Statement {
|
| Statement get body => _body;
|
|
|
| /**
|
| - * Return the expression used to determine whether to execute the body of the loop.
|
| - *
|
| - * @return the expression used to determine whether to execute the body of the loop
|
| - */
|
| - Expression get condition => _condition;
|
| -
|
| - @override
|
| - Token get endToken => _body.endToken;
|
| -
|
| - /**
|
| * Set the body of the loop to the given statement.
|
| *
|
| * @param statement the body of the loop
|
| @@ -19305,6 +20506,13 @@ class WhileStatement extends Statement {
|
| }
|
|
|
| /**
|
| + * Return the expression used to determine whether to execute the body of the loop.
|
| + *
|
| + * @return the expression used to determine whether to execute the body of the loop
|
| + */
|
| + Expression get condition => _condition;
|
| +
|
| + /**
|
| * Set the expression used to determine whether to execute the body of the loop to the given
|
| * expression.
|
| *
|
| @@ -19315,6 +20523,12 @@ class WhileStatement extends Statement {
|
| }
|
|
|
| @override
|
| + Token get endToken => _body.endToken;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitWhileStatement(this);
|
| +
|
| + @override
|
| void visitChildren(AstVisitor visitor) {
|
| safelyVisitChild(_condition, visitor);
|
| safelyVisitChild(_body, visitor);
|
| @@ -19351,22 +20565,12 @@ class WithClause extends AstNode {
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitWithClause(this);
|
| -
|
| - @override
|
| Token get beginToken => withKeyword;
|
|
|
| @override
|
| Token get endToken => _mixinTypes.endToken;
|
|
|
| /**
|
| - * Return the names of the mixins that were specified.
|
| - *
|
| - * @return the names of the mixins that were specified
|
| - */
|
| - NodeList<TypeName> get mixinTypes => _mixinTypes;
|
| -
|
| - /**
|
| * Set the token representing the 'with' keyword to the given token.
|
| *
|
| * @param withKeyword the token representing the 'with' keyword
|
| @@ -19376,6 +20580,16 @@ class WithClause extends AstNode {
|
| this.withKeyword = withKeyword;
|
| }
|
|
|
| + /**
|
| + * Return the names of the mixins that were specified.
|
| + *
|
| + * @return the names of the mixins that were specified
|
| + */
|
| + NodeList<TypeName> get mixinTypes => _mixinTypes;
|
| +
|
| + @override
|
| + accept(AstVisitor visitor) => visitor.visitWithClause(this);
|
| +
|
| @override
|
| void visitChildren(AstVisitor visitor) {
|
| _mixinTypes.accept(visitor);
|
| @@ -19414,14 +20628,12 @@ class YieldStatement extends Statement {
|
| * @param expression the expression whose value will be yielded
|
| * @param semicolon the semicolon following the expression
|
| */
|
| - YieldStatement(this.yieldKeyword, this.star, Expression expression, this.semicolon) {
|
| + YieldStatement(this.yieldKeyword, this.star, Expression expression,
|
| + this.semicolon) {
|
| _expression = becomeParentOf(expression);
|
| }
|
|
|
| @override
|
| - accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
|
| -
|
| - @override
|
| Token get beginToken {
|
| if (yieldKeyword != null) {
|
| return yieldKeyword;
|
| @@ -19454,141 +20666,10 @@ class YieldStatement extends Statement {
|
| }
|
|
|
| @override
|
| - void visitChildren(AstVisitor visitor) {
|
| - safelyVisitChild(_expression, visitor);
|
| - }
|
| -}
|
| -
|
| -/**
|
| - * Instances of the class `NodeList` represent a list of AST nodes that have a
|
| - * common parent.
|
| - */
|
| -class NodeList<E extends AstNode> extends Object with ListMixin<E> {
|
| - /**
|
| - * Create an empty list with the given [owner].
|
| - *
|
| - * Use "new NodeList<E>(owner)"
|
| - */
|
| - @deprecated
|
| - static NodeList create(AstNode owner) => new NodeList(owner);
|
| -
|
| - /**
|
| - * The node that is the parent of each of the elements in the list.
|
| - */
|
| - AstNode owner;
|
| -
|
| - /**
|
| - * The elements contained in the list.
|
| - */
|
| - List<E> _elements = <E>[];
|
| -
|
| - /**
|
| - * Initialize a newly created list of nodes such that all of the nodes that
|
| - * are added to the list will have their parent set to the given [owner]. The
|
| - * list will initially be populated with the given [elements].
|
| - */
|
| - NodeList(this.owner, [List<E> elements]) {
|
| - addAll(elements);
|
| - }
|
| -
|
| - /**
|
| - * Use the given [visitor] to visit each of the nodes in this list.
|
| - */
|
| - accept(AstVisitor visitor) {
|
| - int length = _elements.length;
|
| - for (var i = 0; i < length; i++) {
|
| - _elements[i].accept(visitor);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void add(E node) {
|
| - insert(length, node);
|
| - }
|
| -
|
| - @override
|
| - void insert(int index, E node) {
|
| - int length = _elements.length;
|
| - if (index < 0 || index > length) {
|
| - throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| - }
|
| - owner.becomeParentOf(node);
|
| - if (length == 0) {
|
| - _elements.add(node);
|
| - } else {
|
| - _elements.insert(index, node);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - bool addAll(Iterable<E> nodes) {
|
| - if (nodes != null && !nodes.isEmpty) {
|
| - _elements.addAll(nodes);
|
| - for (E node in nodes) {
|
| - owner.becomeParentOf(node);
|
| - }
|
| - return true;
|
| - }
|
| - return false;
|
| - }
|
| -
|
| - E operator[](int index) {
|
| - if (index < 0 || index >= _elements.length) {
|
| - throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| - }
|
| - return _elements[index];
|
| - }
|
| -
|
| - /**
|
| - * Return the first token included in this node list's source range, or `null`
|
| - * if the list is empty.
|
| - */
|
| - Token get beginToken {
|
| - if (_elements.length == 0) {
|
| - return null;
|
| - }
|
| - return _elements[0].beginToken;
|
| - }
|
| -
|
| - /**
|
| - * Return the last token included in this node list's source range, or `null`
|
| - * if the list is empty.
|
| - */
|
| - Token get endToken {
|
| - int length = _elements.length;
|
| - if (length == 0) {
|
| - return null;
|
| - }
|
| - return _elements[length - 1].endToken;
|
| - }
|
| -
|
| - @override
|
| - E removeAt(int index) {
|
| - if (index < 0 || index >= _elements.length) {
|
| - throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| - }
|
| - E removedNode = _elements[index];
|
| - _elements.removeAt(index);
|
| - return removedNode;
|
| - }
|
| -
|
| - void operator[]=(int index, E node) {
|
| - if (index < 0 || index >= _elements.length) {
|
| - throw new RangeError("Index: $index, Size: ${_elements.length}");
|
| - }
|
| - owner.becomeParentOf(node);
|
| - _elements[index] = node;
|
| - }
|
| + accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
|
|
|
| @override
|
| - void clear() {
|
| - _elements = <E>[];
|
| - }
|
| -
|
| - int get length => _elements.length;
|
| -
|
| - @deprecated
|
| - void set length(int value) {
|
| - throw new UnsupportedError("Cannot resize NodeList.");
|
| + void visitChildren(AstVisitor visitor) {
|
| + safelyVisitChild(_expression, visitor);
|
| }
|
| }
|
|
|