| Index: pkg/analyzer/lib/src/generated/parser.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
|
| index ca76b3a5ae3c809c6b6568630098dbed39c72dde..ed1c3b1a7a5fd4d035cda1f04ad3fa4021dbe5fe 100644
|
| --- a/pkg/analyzer/lib/src/generated/parser.dart
|
| +++ b/pkg/analyzer/lib/src/generated/parser.dart
|
| @@ -1112,6 +1112,12 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| + AstNode visitFormalParameterList(FormalParameterList node) {
|
| + // We don't know which kind of parameter to parse.
|
| + throw new InsufficientContextException();
|
| + }
|
| +
|
| + @override
|
| AstNode visitForStatement(ForStatement node) {
|
| if (identical(_oldNode, node.variables)) {
|
| throw new InsufficientContextException();
|
| @@ -1128,12 +1134,6 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - AstNode visitFormalParameterList(FormalParameterList node) {
|
| - // We don't know which kind of parameter to parse.
|
| - throw new InsufficientContextException();
|
| - }
|
| -
|
| - @override
|
| AstNode visitFunctionDeclaration(FunctionDeclaration node) {
|
| if (identical(_oldNode, node.documentationComment)) {
|
| throw new InsufficientContextException();
|
| @@ -1482,14 +1482,6 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| - AstNode visitPrefixExpression(PrefixExpression node) {
|
| - if (identical(_oldNode, node.operand)) {
|
| - throw new InsufficientContextException();
|
| - }
|
| - return _notAChild(node);
|
| - }
|
| -
|
| - @override
|
| AstNode visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| if (identical(_oldNode, node.prefix)) {
|
| return _parser.parseSimpleIdentifier();
|
| @@ -1500,6 +1492,14 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> {
|
| }
|
|
|
| @override
|
| + AstNode visitPrefixExpression(PrefixExpression node) {
|
| + if (identical(_oldNode, node.operand)) {
|
| + throw new InsufficientContextException();
|
| + }
|
| + return _notAChild(node);
|
| + }
|
| +
|
| + @override
|
| AstNode visitPropertyAccess(PropertyAccess node) {
|
| if (identical(_oldNode, node.target)) {
|
| throw new InsufficientContextException();
|
| @@ -1825,100 +1825,6 @@ class IncrementalParseException extends RuntimeException {
|
| }
|
|
|
| /**
|
| - * Visitor capable of inferring the correct parser state for incremental
|
| - * parsing. This visitor visits each parent/child relationship in the chain of
|
| - * ancestors of the node to be replaced (starting with the root of the parse
|
| - * tree), updating the parser to the correct state for parsing the child of the
|
| - * given parent. Once it has visited all of these relationships, the parser
|
| - * will be in the correct state for reparsing the node to be replaced.
|
| - *
|
| - * TODO(paulberry): add support for other pieces of parser state (_inAsync,
|
| - * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
|
| - * affect error message generation.
|
| - */
|
| -class IncrementalParseStateBuilder extends SimpleAstVisitor {
|
| - /**
|
| - * The parser whose state should be built.
|
| - */
|
| - final Parser _parser;
|
| -
|
| - /**
|
| - * The child node in the parent/child relationship currently being visited.
|
| - * (The corresponding parent is the node passed to the visit...() function.)
|
| - */
|
| - AstNode _childNode;
|
| -
|
| - /**
|
| - * Create an IncrementalParseStateBuilder which will build the correct state
|
| - * for [_parser].
|
| - */
|
| - IncrementalParseStateBuilder(this._parser);
|
| -
|
| - /**
|
| - * Build the correct parser state for parsing a replacement for [node].
|
| - */
|
| - void buildState(AstNode node) {
|
| - List<AstNode> ancestors = <AstNode>[];
|
| - while (node != null) {
|
| - ancestors.add(node);
|
| - node = node.parent;
|
| - }
|
| - _parser._inInitializer = false;
|
| - for (int i = ancestors.length - 2; i >= 0; i--) {
|
| - _childNode = ancestors[i];
|
| - ancestors[i + 1].accept(this);
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitArgumentList(ArgumentList node) {
|
| - _parser._inInitializer = false;
|
| - }
|
| -
|
| - @override
|
| - void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
|
| - if (identical(_childNode, node.expression)) {
|
| - _parser._inInitializer = true;
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitIndexExpression(IndexExpression node) {
|
| - if (identical(_childNode, node.index)) {
|
| - _parser._inInitializer = false;
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitInterpolationExpression(InterpolationExpression node) {
|
| - if (identical(_childNode, node.expression)) {
|
| - _parser._inInitializer = false;
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitListLiteral(ListLiteral node) {
|
| - if (node.elements.contains(_childNode)) {
|
| - _parser._inInitializer = false;
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitMapLiteral(MapLiteral node) {
|
| - if (node.entries.contains(_childNode)) {
|
| - _parser._inInitializer = false;
|
| - }
|
| - }
|
| -
|
| - @override
|
| - void visitParenthesizedExpression(ParenthesizedExpression node) {
|
| - if (identical(_childNode, node.expression)) {
|
| - _parser._inInitializer = false;
|
| - }
|
| - }
|
| -}
|
| -
|
| -/**
|
| * Instances of the class `IncrementalParser` re-parse a single AST structure within a larger
|
| * AST structure.
|
| */
|
| @@ -2096,6 +2002,100 @@ class IncrementalParser {
|
| }
|
|
|
| /**
|
| + * Visitor capable of inferring the correct parser state for incremental
|
| + * parsing. This visitor visits each parent/child relationship in the chain of
|
| + * ancestors of the node to be replaced (starting with the root of the parse
|
| + * tree), updating the parser to the correct state for parsing the child of the
|
| + * given parent. Once it has visited all of these relationships, the parser
|
| + * will be in the correct state for reparsing the node to be replaced.
|
| + *
|
| + * TODO(paulberry): add support for other pieces of parser state (_inAsync,
|
| + * _inGenerator, _inLoop, and _inSwitch). Note that _inLoop and _inSwitch only
|
| + * affect error message generation.
|
| + */
|
| +class IncrementalParseStateBuilder extends SimpleAstVisitor {
|
| + /**
|
| + * The parser whose state should be built.
|
| + */
|
| + final Parser _parser;
|
| +
|
| + /**
|
| + * The child node in the parent/child relationship currently being visited.
|
| + * (The corresponding parent is the node passed to the visit...() function.)
|
| + */
|
| + AstNode _childNode;
|
| +
|
| + /**
|
| + * Create an IncrementalParseStateBuilder which will build the correct state
|
| + * for [_parser].
|
| + */
|
| + IncrementalParseStateBuilder(this._parser);
|
| +
|
| + /**
|
| + * Build the correct parser state for parsing a replacement for [node].
|
| + */
|
| + void buildState(AstNode node) {
|
| + List<AstNode> ancestors = <AstNode>[];
|
| + while (node != null) {
|
| + ancestors.add(node);
|
| + node = node.parent;
|
| + }
|
| + _parser._inInitializer = false;
|
| + for (int i = ancestors.length - 2; i >= 0; i--) {
|
| + _childNode = ancestors[i];
|
| + ancestors[i + 1].accept(this);
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitArgumentList(ArgumentList node) {
|
| + _parser._inInitializer = false;
|
| + }
|
| +
|
| + @override
|
| + void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
|
| + if (identical(_childNode, node.expression)) {
|
| + _parser._inInitializer = true;
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitIndexExpression(IndexExpression node) {
|
| + if (identical(_childNode, node.index)) {
|
| + _parser._inInitializer = false;
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitInterpolationExpression(InterpolationExpression node) {
|
| + if (identical(_childNode, node.expression)) {
|
| + _parser._inInitializer = false;
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitListLiteral(ListLiteral node) {
|
| + if (node.elements.contains(_childNode)) {
|
| + _parser._inInitializer = false;
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitMapLiteral(MapLiteral node) {
|
| + if (node.entries.contains(_childNode)) {
|
| + _parser._inInitializer = false;
|
| + }
|
| + }
|
| +
|
| + @override
|
| + void visitParenthesizedExpression(ParenthesizedExpression node) {
|
| + if (identical(_childNode, node.expression)) {
|
| + _parser._inInitializer = false;
|
| + }
|
| + }
|
| +}
|
| +
|
| +/**
|
| * Instances of the class `InsufficientContextException` represent a situation in which an AST
|
| * node cannot be re-parsed because there is not enough context to know how to re-parse the node.
|
| * Clients can attempt to re-parse the parent of the node.
|
| @@ -2992,7 +2992,7 @@ class Parser {
|
| if (directives.length > 0) {
|
| _reportErrorForToken(
|
| ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST,
|
| - directive.libraryToken);
|
| + directive.libraryKeyword);
|
| }
|
| libraryDirectiveFound = true;
|
| }
|
| @@ -5123,12 +5123,12 @@ class Parser {
|
| } else if (implementsClause != null) {
|
| _reportErrorForToken(
|
| ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS,
|
| - implementsClause.keyword);
|
| + implementsClause.implementsKeyword);
|
| }
|
| } else {
|
| _reportErrorForToken(
|
| ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES,
|
| - extendsClause.keyword);
|
| + extendsClause.extendsKeyword);
|
| parseExtendsClause();
|
| }
|
| } else if (_matchesKeyword(Keyword.WITH)) {
|
| @@ -5137,7 +5137,7 @@ class Parser {
|
| if (implementsClause != null) {
|
| _reportErrorForToken(
|
| ParserErrorCode.IMPLEMENTS_BEFORE_WITH,
|
| - implementsClause.keyword);
|
| + implementsClause.implementsKeyword);
|
| }
|
| } else {
|
| _reportErrorForToken(
|
| @@ -5153,7 +5153,7 @@ class Parser {
|
| } else {
|
| _reportErrorForToken(
|
| ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES,
|
| - implementsClause.keyword);
|
| + implementsClause.implementsKeyword);
|
| parseImplementsClause();
|
| // TODO(brianwilkerson) Should we merge the list of implemented
|
| // classes into a single list?
|
| @@ -6006,40 +6006,6 @@ class Parser {
|
| }
|
|
|
| /**
|
| - * Parse a do statement.
|
| - *
|
| - * <pre>
|
| - * doStatement ::=
|
| - * 'do' statement 'while' '(' expression ')' ';'
|
| - * </pre>
|
| - *
|
| - * @return the do statement that was parsed
|
| - */
|
| - Statement _parseDoStatement() {
|
| - bool wasInLoop = _inLoop;
|
| - _inLoop = true;
|
| - try {
|
| - Token doKeyword = _expectKeyword(Keyword.DO);
|
| - Statement body = parseStatement2();
|
| - Token whileKeyword = _expectKeyword(Keyword.WHILE);
|
| - Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
|
| - Expression condition = parseExpression2();
|
| - Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
|
| - Token semicolon = _expect(TokenType.SEMICOLON);
|
| - return new DoStatement(
|
| - doKeyword,
|
| - body,
|
| - whileKeyword,
|
| - leftParenthesis,
|
| - condition,
|
| - rightParenthesis,
|
| - semicolon);
|
| - } finally {
|
| - _inLoop = wasInLoop;
|
| - }
|
| - }
|
| -
|
| - /**
|
| * Parse a documentation comment.
|
| *
|
| * <pre>
|
| @@ -6081,6 +6047,40 @@ class Parser {
|
| }
|
|
|
| /**
|
| + * Parse a do statement.
|
| + *
|
| + * <pre>
|
| + * doStatement ::=
|
| + * 'do' statement 'while' '(' expression ')' ';'
|
| + * </pre>
|
| + *
|
| + * @return the do statement that was parsed
|
| + */
|
| + Statement _parseDoStatement() {
|
| + bool wasInLoop = _inLoop;
|
| + _inLoop = true;
|
| + try {
|
| + Token doKeyword = _expectKeyword(Keyword.DO);
|
| + Statement body = parseStatement2();
|
| + Token whileKeyword = _expectKeyword(Keyword.WHILE);
|
| + Token leftParenthesis = _expect(TokenType.OPEN_PAREN);
|
| + Expression condition = parseExpression2();
|
| + Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
|
| + Token semicolon = _expect(TokenType.SEMICOLON);
|
| + return new DoStatement(
|
| + doKeyword,
|
| + body,
|
| + whileKeyword,
|
| + leftParenthesis,
|
| + condition,
|
| + rightParenthesis,
|
| + semicolon);
|
| + } finally {
|
| + _inLoop = wasInLoop;
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Parse an empty statement.
|
| *
|
| * <pre>
|
| @@ -6277,6 +6277,64 @@ class Parser {
|
| }
|
|
|
| /**
|
| + * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
|
| + * `true`.
|
| + *
|
| + * <pre>
|
| + * defaultFormalParameter ::=
|
| + * normalFormalParameter ('=' expression)?
|
| + *
|
| + * defaultNamedParameter ::=
|
| + * normalFormalParameter (':' expression)?
|
| + * </pre>
|
| + *
|
| + * @param kind the kind of parameter being expected based on the presence or absence of group
|
| + * delimiters
|
| + * @return the formal parameter that was parsed
|
| + */
|
| + FormalParameter _parseFormalParameter(ParameterKind kind) {
|
| + NormalFormalParameter parameter = parseNormalFormalParameter();
|
| + if (_matches(TokenType.EQ)) {
|
| + Token seperator = getAndAdvance();
|
| + Expression defaultValue = parseExpression2();
|
| + if (kind == ParameterKind.NAMED) {
|
| + _reportErrorForToken(
|
| + ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
|
| + seperator);
|
| + } else if (kind == ParameterKind.REQUIRED) {
|
| + _reportErrorForNode(
|
| + ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
|
| + parameter);
|
| + }
|
| + return new DefaultFormalParameter(
|
| + parameter,
|
| + kind,
|
| + seperator,
|
| + defaultValue);
|
| + } else if (_matches(TokenType.COLON)) {
|
| + Token seperator = getAndAdvance();
|
| + Expression defaultValue = parseExpression2();
|
| + if (kind == ParameterKind.POSITIONAL) {
|
| + _reportErrorForToken(
|
| + ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
|
| + seperator);
|
| + } else if (kind == ParameterKind.REQUIRED) {
|
| + _reportErrorForNode(
|
| + ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
|
| + parameter);
|
| + }
|
| + return new DefaultFormalParameter(
|
| + parameter,
|
| + kind,
|
| + seperator,
|
| + defaultValue);
|
| + } else if (kind != ParameterKind.REQUIRED) {
|
| + return new DefaultFormalParameter(parameter, kind, null, null);
|
| + }
|
| + return parameter;
|
| + }
|
| +
|
| + /**
|
| * Parse a for statement.
|
| *
|
| * <pre>
|
| @@ -6428,64 +6486,6 @@ class Parser {
|
| }
|
|
|
| /**
|
| - * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be
|
| - * `true`.
|
| - *
|
| - * <pre>
|
| - * defaultFormalParameter ::=
|
| - * normalFormalParameter ('=' expression)?
|
| - *
|
| - * defaultNamedParameter ::=
|
| - * normalFormalParameter (':' expression)?
|
| - * </pre>
|
| - *
|
| - * @param kind the kind of parameter being expected based on the presence or absence of group
|
| - * delimiters
|
| - * @return the formal parameter that was parsed
|
| - */
|
| - FormalParameter _parseFormalParameter(ParameterKind kind) {
|
| - NormalFormalParameter parameter = parseNormalFormalParameter();
|
| - if (_matches(TokenType.EQ)) {
|
| - Token seperator = getAndAdvance();
|
| - Expression defaultValue = parseExpression2();
|
| - if (kind == ParameterKind.NAMED) {
|
| - _reportErrorForToken(
|
| - ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER,
|
| - seperator);
|
| - } else if (kind == ParameterKind.REQUIRED) {
|
| - _reportErrorForNode(
|
| - ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP,
|
| - parameter);
|
| - }
|
| - return new DefaultFormalParameter(
|
| - parameter,
|
| - kind,
|
| - seperator,
|
| - defaultValue);
|
| - } else if (_matches(TokenType.COLON)) {
|
| - Token seperator = getAndAdvance();
|
| - Expression defaultValue = parseExpression2();
|
| - if (kind == ParameterKind.POSITIONAL) {
|
| - _reportErrorForToken(
|
| - ParserErrorCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER,
|
| - seperator);
|
| - } else if (kind == ParameterKind.REQUIRED) {
|
| - _reportErrorForNode(
|
| - ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP,
|
| - parameter);
|
| - }
|
| - return new DefaultFormalParameter(
|
| - parameter,
|
| - kind,
|
| - seperator,
|
| - defaultValue);
|
| - } else if (kind != ParameterKind.REQUIRED) {
|
| - return new DefaultFormalParameter(parameter, kind, null, null);
|
| - }
|
| - return parameter;
|
| - }
|
| -
|
| - /**
|
| * Parse a function body.
|
| *
|
| * <pre>
|
| @@ -10003,6 +10003,27 @@ class Parser {
|
| }
|
| }
|
| /**
|
| + * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
|
| + */
|
| +class Parser_SyntheticKeywordToken extends KeywordToken {
|
| + /**
|
| + * Initialize a newly created token to represent the given keyword.
|
| + *
|
| + * @param keyword the keyword being represented by this token
|
| + * @param offset the offset from the beginning of the file to the first character in the token
|
| + */
|
| + Parser_SyntheticKeywordToken(Keyword keyword, int offset)
|
| + : super(keyword, offset);
|
| +
|
| + @override
|
| + int get length => 0;
|
| +
|
| + @override
|
| + Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
|
| +}
|
| +
|
| +
|
| +/**
|
| * The enumeration `ParserErrorCode` defines the error codes used for errors
|
| * detected by the parser. The convention for this class is for the name of the
|
| * error code to indicate the problem that caused the error to be generated and
|
| @@ -10720,27 +10741,6 @@ class ParserErrorCode extends ErrorCode {
|
|
|
|
|
| /**
|
| - * Instances of the class `SyntheticKeywordToken` implement a synthetic keyword token.
|
| - */
|
| -class Parser_SyntheticKeywordToken extends KeywordToken {
|
| - /**
|
| - * Initialize a newly created token to represent the given keyword.
|
| - *
|
| - * @param keyword the keyword being represented by this token
|
| - * @param offset the offset from the beginning of the file to the first character in the token
|
| - */
|
| - Parser_SyntheticKeywordToken(Keyword keyword, int offset)
|
| - : super(keyword, offset);
|
| -
|
| - @override
|
| - int get length => 0;
|
| -
|
| - @override
|
| - Token copy() => new Parser_SyntheticKeywordToken(keyword, offset);
|
| -}
|
| -
|
| -
|
| -/**
|
| * Instances of the class `ResolutionCopier` copies resolution information from one AST
|
| * structure to another as long as the structures of the corresponding children of a pair of nodes
|
| * are the same.
|
| @@ -10800,7 +10800,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitAssertStatement(AssertStatement node) {
|
| AssertStatement toNode = this._toNode as AssertStatement;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.assertKeyword, toNode.assertKeyword),
|
| _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
|
| _isEqualNodes(node.condition, toNode.condition),
|
| _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
|
| @@ -10879,7 +10879,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitBreakStatement(BreakStatement node) {
|
| BreakStatement toNode = this._toNode as BreakStatement;
|
| if (_and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.breakKeyword, toNode.breakKeyword),
|
| _isEqualNodes(node.label, toNode.label),
|
| _isEqualTokens(node.semicolon, toNode.semicolon))) {
|
| // TODO(paulberry): map node.target to toNode.target.
|
| @@ -10940,7 +10940,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| return _and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.typedefKeyword, toNode.typedefKeyword),
|
| _isEqualNodes(node.name, toNode.name),
|
| _isEqualNodes(node.typeParameters, toNode.typeParameters),
|
| _isEqualTokens(node.equals, toNode.equals),
|
| @@ -11024,7 +11024,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| ConstructorFieldInitializer toNode =
|
| this._toNode as ConstructorFieldInitializer;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
|
| _isEqualTokens(node.period, toNode.period),
|
| _isEqualNodes(node.fieldName, toNode.fieldName),
|
| _isEqualTokens(node.equals, toNode.equals),
|
| @@ -11048,7 +11048,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitContinueStatement(ContinueStatement node) {
|
| ContinueStatement toNode = this._toNode as ContinueStatement;
|
| if (_and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.continueKeyword, toNode.continueKeyword),
|
| _isEqualNodes(node.label, toNode.label),
|
| _isEqualTokens(node.semicolon, toNode.semicolon))) {
|
| // TODO(paulberry): map node.target to toNode.target.
|
| @@ -11131,7 +11131,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| return _and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.enumKeyword, toNode.enumKeyword),
|
| _isEqualNodes(node.name, toNode.name),
|
| _isEqualTokens(node.leftBracket, toNode.leftBracket),
|
| _isEqualNodeLists(node.constants, toNode.constants),
|
| @@ -11175,7 +11175,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitExtendsClause(ExtendsClause node) {
|
| ExtendsClause toNode = this._toNode as ExtendsClause;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
|
| _isEqualNodes(node.superclass, toNode.superclass));
|
| }
|
|
|
| @@ -11198,7 +11198,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| _isEqualTokens(node.keyword, toNode.keyword),
|
| _isEqualNodes(node.type, toNode.type),
|
| - _isEqualTokens(node.thisToken, toNode.thisToken),
|
| + _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
|
| _isEqualTokens(node.period, toNode.period),
|
| _isEqualNodes(node.identifier, toNode.identifier));
|
| }
|
| @@ -11217,6 +11217,17 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| + bool visitFormalParameterList(FormalParameterList node) {
|
| + FormalParameterList toNode = this._toNode as FormalParameterList;
|
| + return _and(
|
| + _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
|
| + _isEqualNodeLists(node.parameters, toNode.parameters),
|
| + _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
|
| + _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
|
| + _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
|
| + }
|
| +
|
| + @override
|
| bool visitForStatement(ForStatement node) {
|
| ForStatement toNode = this._toNode as ForStatement;
|
| return _and(
|
| @@ -11233,17 +11244,6 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitFormalParameterList(FormalParameterList node) {
|
| - FormalParameterList toNode = this._toNode as FormalParameterList;
|
| - return _and(
|
| - _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
|
| - _isEqualNodeLists(node.parameters, toNode.parameters),
|
| - _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
|
| - _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
|
| - _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
|
| - }
|
| -
|
| - @override
|
| bool visitFunctionDeclaration(FunctionDeclaration node) {
|
| FunctionDeclaration toNode = this._toNode as FunctionDeclaration;
|
| return _and(
|
| @@ -11299,7 +11299,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| return _and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.typedefKeyword, toNode.typedefKeyword),
|
| _isEqualNodes(node.returnType, toNode.returnType),
|
| _isEqualNodes(node.name, toNode.name),
|
| _isEqualNodes(node.typeParameters, toNode.typeParameters),
|
| @@ -11344,7 +11344,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitImplementsClause(ImplementsClause node) {
|
| ImplementsClause toNode = this._toNode as ImplementsClause;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.implementsKeyword, toNode.implementsKeyword),
|
| _isEqualNodeLists(node.interfaces, toNode.interfaces));
|
| }
|
|
|
| @@ -11356,7 +11356,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| _isEqualTokens(node.keyword, toNode.keyword),
|
| _isEqualNodes(node.uri, toNode.uri),
|
| - _isEqualTokens(node.asToken, toNode.asToken),
|
| + _isEqualTokens(node.asKeyword, toNode.asKeyword),
|
| _isEqualNodes(node.prefix, toNode.prefix),
|
| _isEqualNodeLists(node.combinators, toNode.combinators),
|
| _isEqualTokens(node.semicolon, toNode.semicolon))) {
|
| @@ -11467,7 +11467,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| return _and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.libraryToken, toNode.libraryToken),
|
| + _isEqualTokens(node.libraryKeyword, toNode.libraryKeyword),
|
| _isEqualNodes(node.name, toNode.name),
|
| _isEqualTokens(node.semicolon, toNode.semicolon));
|
| }
|
| @@ -11572,7 +11572,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitNativeClause(NativeClause node) {
|
| NativeClause toNode = this._toNode as NativeClause;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
|
| _isEqualNodes(node.name, toNode.name));
|
| }
|
|
|
| @@ -11580,7 +11580,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitNativeFunctionBody(NativeFunctionBody node) {
|
| NativeFunctionBody toNode = this._toNode as NativeFunctionBody;
|
| return _and(
|
| - _isEqualTokens(node.nativeToken, toNode.nativeToken),
|
| + _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
|
| _isEqualNodes(node.stringLiteral, toNode.stringLiteral),
|
| _isEqualTokens(node.semicolon, toNode.semicolon));
|
| }
|
| @@ -11616,7 +11616,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| if (_and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.partToken, toNode.partToken),
|
| + _isEqualTokens(node.partKeyword, toNode.partKeyword),
|
| _isEqualNodes(node.uri, toNode.uri),
|
| _isEqualTokens(node.semicolon, toNode.semicolon))) {
|
| toNode.element = node.element;
|
| @@ -11631,8 +11631,8 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| if (_and(
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| - _isEqualTokens(node.partToken, toNode.partToken),
|
| - _isEqualTokens(node.ofToken, toNode.ofToken),
|
| + _isEqualTokens(node.partKeyword, toNode.partKeyword),
|
| + _isEqualTokens(node.ofKeyword, toNode.ofKeyword),
|
| _isEqualNodes(node.libraryName, toNode.libraryName),
|
| _isEqualTokens(node.semicolon, toNode.semicolon))) {
|
| toNode.element = node.element;
|
| @@ -11657,14 +11657,13 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitPrefixExpression(PrefixExpression node) {
|
| - PrefixExpression toNode = this._toNode as PrefixExpression;
|
| + bool visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| + PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
|
| if (_and(
|
| - _isEqualTokens(node.operator, toNode.operator),
|
| - _isEqualNodes(node.operand, toNode.operand))) {
|
| - toNode.propagatedElement = node.propagatedElement;
|
| + _isEqualNodes(node.prefix, toNode.prefix),
|
| + _isEqualTokens(node.period, toNode.period),
|
| + _isEqualNodes(node.identifier, toNode.identifier))) {
|
| toNode.propagatedType = node.propagatedType;
|
| - toNode.staticElement = node.staticElement;
|
| toNode.staticType = node.staticType;
|
| return true;
|
| }
|
| @@ -11672,13 +11671,14 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| }
|
|
|
| @override
|
| - bool visitPrefixedIdentifier(PrefixedIdentifier node) {
|
| - PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
|
| + bool visitPrefixExpression(PrefixExpression node) {
|
| + PrefixExpression toNode = this._toNode as PrefixExpression;
|
| if (_and(
|
| - _isEqualNodes(node.prefix, toNode.prefix),
|
| - _isEqualTokens(node.period, toNode.period),
|
| - _isEqualNodes(node.identifier, toNode.identifier))) {
|
| + _isEqualTokens(node.operator, toNode.operator),
|
| + _isEqualNodes(node.operand, toNode.operand))) {
|
| + toNode.propagatedElement = node.propagatedElement;
|
| toNode.propagatedType = node.propagatedType;
|
| + toNode.staticElement = node.staticElement;
|
| toNode.staticType = node.staticType;
|
| return true;
|
| }
|
| @@ -11705,7 +11705,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| RedirectingConstructorInvocation toNode =
|
| this._toNode as RedirectingConstructorInvocation;
|
| if (_and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
|
| _isEqualTokens(node.period, toNode.period),
|
| _isEqualNodes(node.constructorName, toNode.constructorName),
|
| _isEqualNodes(node.argumentList, toNode.argumentList))) {
|
| @@ -11718,7 +11718,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| @override
|
| bool visitRethrowExpression(RethrowExpression node) {
|
| RethrowExpression toNode = this._toNode as RethrowExpression;
|
| - if (_isEqualTokens(node.keyword, toNode.keyword)) {
|
| + if (_isEqualTokens(node.rethrowKeyword, toNode.rethrowKeyword)) {
|
| toNode.propagatedType = node.propagatedType;
|
| toNode.staticType = node.staticType;
|
| return true;
|
| @@ -11730,7 +11730,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitReturnStatement(ReturnStatement node) {
|
| ReturnStatement toNode = this._toNode as ReturnStatement;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.returnKeyword, toNode.returnKeyword),
|
| _isEqualNodes(node.expression, toNode.expression),
|
| _isEqualTokens(node.semicolon, toNode.semicolon));
|
| }
|
| @@ -11803,7 +11803,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| SuperConstructorInvocation toNode =
|
| this._toNode as SuperConstructorInvocation;
|
| if (_and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.superKeyword, toNode.superKeyword),
|
| _isEqualTokens(node.period, toNode.period),
|
| _isEqualNodes(node.constructorName, toNode.constructorName),
|
| _isEqualNodes(node.argumentList, toNode.argumentList))) {
|
| @@ -11816,7 +11816,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| @override
|
| bool visitSuperExpression(SuperExpression node) {
|
| SuperExpression toNode = this._toNode as SuperExpression;
|
| - if (_isEqualTokens(node.keyword, toNode.keyword)) {
|
| + if (_isEqualTokens(node.superKeyword, toNode.superKeyword)) {
|
| toNode.propagatedType = node.propagatedType;
|
| toNode.staticType = node.staticType;
|
| return true;
|
| @@ -11849,7 +11849,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitSwitchStatement(SwitchStatement node) {
|
| SwitchStatement toNode = this._toNode as SwitchStatement;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.switchKeyword, toNode.switchKeyword),
|
| _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
|
| _isEqualNodes(node.expression, toNode.expression),
|
| _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
|
| @@ -11874,7 +11874,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| @override
|
| bool visitThisExpression(ThisExpression node) {
|
| ThisExpression toNode = this._toNode as ThisExpression;
|
| - if (_isEqualTokens(node.keyword, toNode.keyword)) {
|
| + if (_isEqualTokens(node.thisKeyword, toNode.thisKeyword)) {
|
| toNode.propagatedType = node.propagatedType;
|
| toNode.staticType = node.staticType;
|
| return true;
|
| @@ -11886,7 +11886,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitThrowExpression(ThrowExpression node) {
|
| ThrowExpression toNode = this._toNode as ThrowExpression;
|
| if (_and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.throwKeyword, toNode.throwKeyword),
|
| _isEqualNodes(node.expression, toNode.expression))) {
|
| toNode.propagatedType = node.propagatedType;
|
| toNode.staticType = node.staticType;
|
| @@ -11945,7 +11945,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| _isEqualNodes(node.documentationComment, toNode.documentationComment),
|
| _isEqualNodeLists(node.metadata, toNode.metadata),
|
| _isEqualNodes(node.name, toNode.name),
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.extendsKeyword, toNode.extendsKeyword),
|
| _isEqualNodes(node.bound, toNode.bound));
|
| }
|
|
|
| @@ -11993,7 +11993,7 @@ class ResolutionCopier implements AstVisitor<bool> {
|
| bool visitWhileStatement(WhileStatement node) {
|
| WhileStatement toNode = this._toNode as WhileStatement;
|
| return _and(
|
| - _isEqualTokens(node.keyword, toNode.keyword),
|
| + _isEqualTokens(node.whileKeyword, toNode.whileKeyword),
|
| _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
|
| _isEqualNodes(node.condition, toNode.condition),
|
| _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
|
|
|