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

Side by Side Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 186153005: New analzyer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use meaningful name instead of '_' in predicate. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/bin/analyzer.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.ast; 8 library engine.ast;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 */ 1004 */
1005 accept(AstVisitor visitor); 1005 accept(AstVisitor visitor);
1006 1006
1007 /** 1007 /**
1008 * Return the node of the given class that most immediately encloses this node , or `null` if 1008 * Return the node of the given class that most immediately encloses this node , or `null` if
1009 * there is no enclosing node of the given class. 1009 * there is no enclosing node of the given class.
1010 * 1010 *
1011 * @param nodeClass the class of the node to be returned 1011 * @param nodeClass the class of the node to be returned
1012 * @return the node of the given type that encloses this node 1012 * @return the node of the given type that encloses this node
1013 */ 1013 */
1014 AstNode getAncestor(Type enclosingClass) { 1014 AstNode getAncestor(Predicate<AstNode> predicate) {
1015 AstNode node = this; 1015 AstNode node = this;
1016 while (node != null && !isInstanceOf(node, enclosingClass)) { 1016 while (node != null && !predicate(node)) {
1017 node = node.parent; 1017 node = node.parent;
1018 } 1018 }
1019 return node; 1019 return node;
1020 } 1020 }
1021 1021
1022 /** 1022 /**
1023 * Return the first token included in this node's source range. 1023 * Return the first token included in this node's source range.
1024 * 1024 *
1025 * @return the first token included in this node's source range 1025 * @return the first token included in this node's source range
1026 */ 1026 */
(...skipping 8751 matching lines...) Expand 10 before | Expand all | Expand 10 after
9778 9778
9779 bool get isSynthetic => token.isSynthetic; 9779 bool get isSynthetic => token.isSynthetic;
9780 9780
9781 /** 9781 /**
9782 * Set the element associated with this identifier based on propagated type in formation to the 9782 * Set the element associated with this identifier based on propagated type in formation to the
9783 * given element. 9783 * given element.
9784 * 9784 *
9785 * @param element the element to be associated with this identifier 9785 * @param element the element to be associated with this identifier
9786 */ 9786 */
9787 void set propagatedElement(Element element) { 9787 void set propagatedElement(Element element) {
9788 _propagatedElement = validateElement2(element); 9788 _propagatedElement = validateElement(element);
9789 } 9789 }
9790 9790
9791 /** 9791 /**
9792 * Set the element associated with this identifier based on static type inform ation to the given 9792 * Set the element associated with this identifier based on static type inform ation to the given
9793 * element. 9793 * element.
9794 * 9794 *
9795 * @param element the element to be associated with this identifier 9795 * @param element the element to be associated with this identifier
9796 */ 9796 */
9797 void set staticElement(Element element) { 9797 void set staticElement(Element element) {
9798 _staticElement = validateElement2(element); 9798 _staticElement = validateElement(element);
9799 } 9799 }
9800 9800
9801 void visitChildren(AstVisitor visitor) { 9801 void visitChildren(AstVisitor visitor) {
9802 } 9802 }
9803 9803
9804 /** 9804 /**
9805 * Return the given element if it is an appropriate element based on the paren t of this 9805 * Return the given element if it is valid, or report the problem and return ` null` if it is
9806 * identifier, or `null` if it is not appropriate. 9806 * not appropriate.
9807 * 9807 *
9808 * @param parent the parent of the element, used for reporting when there is a problem
9809 * @param isValid `true` if the element is appropriate
9808 * @param element the element to be associated with this identifier 9810 * @param element the element to be associated with this identifier
9809 * @return the element to be associated with this identifier 9811 * @return the element to be associated with this identifier
9810 */ 9812 */
9811 Element validateElement(AstNode parent, Type expectedClass, Element element) { 9813 Element returnOrReportElement(AstNode parent, bool isValid, Element element) {
9812 if (!isInstanceOf(element, expectedClass)) { 9814 if (!isValid) {
9813 AnalysisEngine.instance.logger.logInformation3("Internal error: attempting to set the name of a ${parent.runtimeType.toString()} to a ${element.runtimeTyp e.toString()}", new JavaException()); 9815 AnalysisEngine.instance.logger.logInformation3("Internal error: attempting to set the name of a ${parent.runtimeType.toString()} to a ${element.runtimeTyp e.toString()}", new JavaException());
9814 return null; 9816 return null;
9815 } 9817 }
9816 return element; 9818 return element;
9817 } 9819 }
9818 9820
9819 /** 9821 /**
9820 * Return the given element if it is an appropriate element based on the paren t of this 9822 * Return the given element if it is an appropriate element based on the paren t of this
9821 * identifier, or `null` if it is not appropriate. 9823 * identifier, or `null` if it is not appropriate.
9822 * 9824 *
9823 * @param element the element to be associated with this identifier 9825 * @param element the element to be associated with this identifier
9824 * @return the element to be associated with this identifier 9826 * @return the element to be associated with this identifier
9825 */ 9827 */
9826 Element validateElement2(Element element) { 9828 Element validateElement(Element element) {
9827 if (element == null) { 9829 if (element == null) {
9828 return null; 9830 return null;
9829 } 9831 }
9830 AstNode parent = this.parent; 9832 AstNode parent = this.parent;
9831 if (parent is ClassDeclaration && identical(parent.name, this)) { 9833 if (parent is ClassDeclaration && identical(parent.name, this)) {
9832 return validateElement(parent, ClassElement, element); 9834 return returnOrReportElement(parent, element is ClassElement, element);
9833 } else if (parent is ClassTypeAlias && identical(parent.name, this)) { 9835 } else if (parent is ClassTypeAlias && identical(parent.name, this)) {
9834 return validateElement(parent, ClassElement, element); 9836 return returnOrReportElement(parent, element is ClassElement, element);
9835 } else if (parent is DeclaredIdentifier && identical(parent.identifier, this )) { 9837 } else if (parent is DeclaredIdentifier && identical(parent.identifier, this )) {
9836 return validateElement(parent, LocalVariableElement, element); 9838 return returnOrReportElement(parent, element is LocalVariableElement, elem ent);
9837 } else if (parent is FormalParameter && identical(parent.identifier, this)) { 9839 } else if (parent is FormalParameter && identical(parent.identifier, this)) {
9838 return validateElement(parent, ParameterElement, element); 9840 return returnOrReportElement(parent, element is ParameterElement, element) ;
9839 } else if (parent is FunctionDeclaration && identical(parent.name, this)) { 9841 } else if (parent is FunctionDeclaration && identical(parent.name, this)) {
9840 return validateElement(parent, ExecutableElement, element); 9842 return returnOrReportElement(parent, element is ExecutableElement, element );
9841 } else if (parent is FunctionTypeAlias && identical(parent.name, this)) { 9843 } else if (parent is FunctionTypeAlias && identical(parent.name, this)) {
9842 return validateElement(parent, FunctionTypeAliasElement, element); 9844 return returnOrReportElement(parent, element is FunctionTypeAliasElement, element);
9843 } else if (parent is MethodDeclaration && identical(parent.name, this)) { 9845 } else if (parent is MethodDeclaration && identical(parent.name, this)) {
9844 return validateElement(parent, ExecutableElement, element); 9846 return returnOrReportElement(parent, element is ExecutableElement, element );
9845 } else if (parent is TypeParameter && identical(parent.name, this)) { 9847 } else if (parent is TypeParameter && identical(parent.name, this)) {
9846 return validateElement(parent, TypeParameterElement, element); 9848 return returnOrReportElement(parent, element is TypeParameterElement, elem ent);
9847 } else if (parent is VariableDeclaration && identical(parent.name, this)) { 9849 } else if (parent is VariableDeclaration && identical(parent.name, this)) {
9848 return validateElement(parent, VariableElement, element); 9850 return returnOrReportElement(parent, element is VariableElement, element);
9849 } 9851 }
9850 return element; 9852 return element;
9851 } 9853 }
9852 } 9854 }
9853 9855
9854 /** 9856 /**
9855 * Instances of the class `SimpleStringLiteral` represent a string literal expre ssion that 9857 * Instances of the class `SimpleStringLiteral` represent a string literal expre ssion that
9856 * does not contain any interpolations. 9858 * does not contain any interpolations.
9857 * 9859 *
9858 * <pre> 9860 * <pre>
(...skipping 3482 matching lines...) Expand 10 before | Expand all | Expand 10 after
13341 * Initialize a newly created visitor to write source code representing the vi sited nodes to the 13343 * Initialize a newly created visitor to write source code representing the vi sited nodes to the
13342 * given writer. 13344 * given writer.
13343 * 13345 *
13344 * @param writer the writer to which the source is to be written 13346 * @param writer the writer to which the source is to be written
13345 */ 13347 */
13346 ToSourceVisitor(PrintWriter writer) { 13348 ToSourceVisitor(PrintWriter writer) {
13347 this._writer = writer; 13349 this._writer = writer;
13348 } 13350 }
13349 13351
13350 Object visitAdjacentStrings(AdjacentStrings node) { 13352 Object visitAdjacentStrings(AdjacentStrings node) {
13351 visitList2(node.strings, " "); 13353 visitNodeListWithSeparator(node.strings, " ");
13352 return null; 13354 return null;
13353 } 13355 }
13354 13356
13355 Object visitAnnotation(Annotation node) { 13357 Object visitAnnotation(Annotation node) {
13356 _writer.print('@'); 13358 _writer.print('@');
13357 visit(node.name); 13359 visitNode(node.name);
13358 visit3(".", node.constructorName); 13360 visitNodeWithPrefix(".", node.constructorName);
13359 visit(node.arguments); 13361 visitNode(node.arguments);
13360 return null; 13362 return null;
13361 } 13363 }
13362 13364
13363 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) { 13365 Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
13364 _writer.print('?'); 13366 _writer.print('?');
13365 visit(node.identifier); 13367 visitNode(node.identifier);
13366 return null; 13368 return null;
13367 } 13369 }
13368 13370
13369 Object visitArgumentList(ArgumentList node) { 13371 Object visitArgumentList(ArgumentList node) {
13370 _writer.print('('); 13372 _writer.print('(');
13371 visitList2(node.arguments, ", "); 13373 visitNodeListWithSeparator(node.arguments, ", ");
13372 _writer.print(')'); 13374 _writer.print(')');
13373 return null; 13375 return null;
13374 } 13376 }
13375 13377
13376 Object visitAsExpression(AsExpression node) { 13378 Object visitAsExpression(AsExpression node) {
13377 visit(node.expression); 13379 visitNode(node.expression);
13378 _writer.print(" as "); 13380 _writer.print(" as ");
13379 visit(node.type); 13381 visitNode(node.type);
13380 return null; 13382 return null;
13381 } 13383 }
13382 13384
13383 Object visitAssertStatement(AssertStatement node) { 13385 Object visitAssertStatement(AssertStatement node) {
13384 _writer.print("assert ("); 13386 _writer.print("assert (");
13385 visit(node.condition); 13387 visitNode(node.condition);
13386 _writer.print(");"); 13388 _writer.print(");");
13387 return null; 13389 return null;
13388 } 13390 }
13389 13391
13390 Object visitAssignmentExpression(AssignmentExpression node) { 13392 Object visitAssignmentExpression(AssignmentExpression node) {
13391 visit(node.leftHandSide); 13393 visitNode(node.leftHandSide);
13392 _writer.print(' '); 13394 _writer.print(' ');
13393 _writer.print(node.operator.lexeme); 13395 _writer.print(node.operator.lexeme);
13394 _writer.print(' '); 13396 _writer.print(' ');
13395 visit(node.rightHandSide); 13397 visitNode(node.rightHandSide);
13396 return null; 13398 return null;
13397 } 13399 }
13398 13400
13399 Object visitBinaryExpression(BinaryExpression node) { 13401 Object visitBinaryExpression(BinaryExpression node) {
13400 visit(node.leftOperand); 13402 visitNode(node.leftOperand);
13401 _writer.print(' '); 13403 _writer.print(' ');
13402 _writer.print(node.operator.lexeme); 13404 _writer.print(node.operator.lexeme);
13403 _writer.print(' '); 13405 _writer.print(' ');
13404 visit(node.rightOperand); 13406 visitNode(node.rightOperand);
13405 return null; 13407 return null;
13406 } 13408 }
13407 13409
13408 Object visitBlock(Block node) { 13410 Object visitBlock(Block node) {
13409 _writer.print('{'); 13411 _writer.print('{');
13410 visitList2(node.statements, " "); 13412 visitNodeListWithSeparator(node.statements, " ");
13411 _writer.print('}'); 13413 _writer.print('}');
13412 return null; 13414 return null;
13413 } 13415 }
13414 13416
13415 Object visitBlockFunctionBody(BlockFunctionBody node) { 13417 Object visitBlockFunctionBody(BlockFunctionBody node) {
13416 visit(node.block); 13418 visitNode(node.block);
13417 return null; 13419 return null;
13418 } 13420 }
13419 13421
13420 Object visitBooleanLiteral(BooleanLiteral node) { 13422 Object visitBooleanLiteral(BooleanLiteral node) {
13421 _writer.print(node.literal.lexeme); 13423 _writer.print(node.literal.lexeme);
13422 return null; 13424 return null;
13423 } 13425 }
13424 13426
13425 Object visitBreakStatement(BreakStatement node) { 13427 Object visitBreakStatement(BreakStatement node) {
13426 _writer.print("break"); 13428 _writer.print("break");
13427 visit3(" ", node.label); 13429 visitNodeWithPrefix(" ", node.label);
13428 _writer.print(";"); 13430 _writer.print(";");
13429 return null; 13431 return null;
13430 } 13432 }
13431 13433
13432 Object visitCascadeExpression(CascadeExpression node) { 13434 Object visitCascadeExpression(CascadeExpression node) {
13433 visit(node.target); 13435 visitNode(node.target);
13434 visitList(node.cascadeSections); 13436 visitNodeList(node.cascadeSections);
13435 return null; 13437 return null;
13436 } 13438 }
13437 13439
13438 Object visitCatchClause(CatchClause node) { 13440 Object visitCatchClause(CatchClause node) {
13439 visit3("on ", node.exceptionType); 13441 visitNodeWithPrefix("on ", node.exceptionType);
13440 if (node.catchKeyword != null) { 13442 if (node.catchKeyword != null) {
13441 if (node.exceptionType != null) { 13443 if (node.exceptionType != null) {
13442 _writer.print(' '); 13444 _writer.print(' ');
13443 } 13445 }
13444 _writer.print("catch ("); 13446 _writer.print("catch (");
13445 visit(node.exceptionParameter); 13447 visitNode(node.exceptionParameter);
13446 visit3(", ", node.stackTraceParameter); 13448 visitNodeWithPrefix(", ", node.stackTraceParameter);
13447 _writer.print(") "); 13449 _writer.print(") ");
13448 } else { 13450 } else {
13449 _writer.print(" "); 13451 _writer.print(" ");
13450 } 13452 }
13451 visit(node.body); 13453 visitNode(node.body);
13452 return null; 13454 return null;
13453 } 13455 }
13454 13456
13455 Object visitClassDeclaration(ClassDeclaration node) { 13457 Object visitClassDeclaration(ClassDeclaration node) {
13456 visit5(node.abstractKeyword, " "); 13458 visitTokenWithSuffix(node.abstractKeyword, " ");
13457 _writer.print("class "); 13459 _writer.print("class ");
13458 visit(node.name); 13460 visitNode(node.name);
13459 visit(node.typeParameters); 13461 visitNode(node.typeParameters);
13460 visit3(" ", node.extendsClause); 13462 visitNodeWithPrefix(" ", node.extendsClause);
13461 visit3(" ", node.withClause); 13463 visitNodeWithPrefix(" ", node.withClause);
13462 visit3(" ", node.implementsClause); 13464 visitNodeWithPrefix(" ", node.implementsClause);
13463 _writer.print(" {"); 13465 _writer.print(" {");
13464 visitList2(node.members, " "); 13466 visitNodeListWithSeparator(node.members, " ");
13465 _writer.print("}"); 13467 _writer.print("}");
13466 return null; 13468 return null;
13467 } 13469 }
13468 13470
13469 Object visitClassTypeAlias(ClassTypeAlias node) { 13471 Object visitClassTypeAlias(ClassTypeAlias node) {
13470 if (node.abstractKeyword != null) { 13472 if (node.abstractKeyword != null) {
13471 _writer.print("abstract "); 13473 _writer.print("abstract ");
13472 } 13474 }
13473 _writer.print("class "); 13475 _writer.print("class ");
13474 visit(node.name); 13476 visitNode(node.name);
13475 visit(node.typeParameters); 13477 visitNode(node.typeParameters);
13476 _writer.print(" = "); 13478 _writer.print(" = ");
13477 visit(node.superclass); 13479 visitNode(node.superclass);
13478 visit3(" ", node.withClause); 13480 visitNodeWithPrefix(" ", node.withClause);
13479 visit3(" ", node.implementsClause); 13481 visitNodeWithPrefix(" ", node.implementsClause);
13480 _writer.print(";"); 13482 _writer.print(";");
13481 return null; 13483 return null;
13482 } 13484 }
13483 13485
13484 Object visitComment(Comment node) => null; 13486 Object visitComment(Comment node) => null;
13485 13487
13486 Object visitCommentReference(CommentReference node) => null; 13488 Object visitCommentReference(CommentReference node) => null;
13487 13489
13488 Object visitCompilationUnit(CompilationUnit node) { 13490 Object visitCompilationUnit(CompilationUnit node) {
13489 ScriptTag scriptTag = node.scriptTag; 13491 ScriptTag scriptTag = node.scriptTag;
13490 NodeList<Directive> directives = node.directives; 13492 NodeList<Directive> directives = node.directives;
13491 visit(scriptTag); 13493 visitNode(scriptTag);
13492 String prefix = scriptTag == null ? "" : " "; 13494 String prefix = scriptTag == null ? "" : " ";
13493 visitList4(prefix, directives, " "); 13495 visitNodeListWithSeparatorAndPrefix(prefix, directives, " ");
13494 prefix = scriptTag == null && directives.isEmpty ? "" : " "; 13496 prefix = scriptTag == null && directives.isEmpty ? "" : " ";
13495 visitList4(prefix, node.declarations, " "); 13497 visitNodeListWithSeparatorAndPrefix(prefix, node.declarations, " ");
13496 return null; 13498 return null;
13497 } 13499 }
13498 13500
13499 Object visitConditionalExpression(ConditionalExpression node) { 13501 Object visitConditionalExpression(ConditionalExpression node) {
13500 visit(node.condition); 13502 visitNode(node.condition);
13501 _writer.print(" ? "); 13503 _writer.print(" ? ");
13502 visit(node.thenExpression); 13504 visitNode(node.thenExpression);
13503 _writer.print(" : "); 13505 _writer.print(" : ");
13504 visit(node.elseExpression); 13506 visitNode(node.elseExpression);
13505 return null; 13507 return null;
13506 } 13508 }
13507 13509
13508 Object visitConstructorDeclaration(ConstructorDeclaration node) { 13510 Object visitConstructorDeclaration(ConstructorDeclaration node) {
13509 visit5(node.externalKeyword, " "); 13511 visitTokenWithSuffix(node.externalKeyword, " ");
13510 visit5(node.constKeyword, " "); 13512 visitTokenWithSuffix(node.constKeyword, " ");
13511 visit5(node.factoryKeyword, " "); 13513 visitTokenWithSuffix(node.factoryKeyword, " ");
13512 visit(node.returnType); 13514 visitNode(node.returnType);
13513 visit3(".", node.name); 13515 visitNodeWithPrefix(".", node.name);
13514 visit(node.parameters); 13516 visitNode(node.parameters);
13515 visitList4(" : ", node.initializers, ", "); 13517 visitNodeListWithSeparatorAndPrefix(" : ", node.initializers, ", ");
13516 visit3(" = ", node.redirectedConstructor); 13518 visitNodeWithPrefix(" = ", node.redirectedConstructor);
13517 visit4(" ", node.body); 13519 visitFunctionWithPrefix(" ", node.body);
13518 return null; 13520 return null;
13519 } 13521 }
13520 13522
13521 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 13523 Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
13522 visit5(node.keyword, "."); 13524 visitTokenWithSuffix(node.keyword, ".");
13523 visit(node.fieldName); 13525 visitNode(node.fieldName);
13524 _writer.print(" = "); 13526 _writer.print(" = ");
13525 visit(node.expression); 13527 visitNode(node.expression);
13526 return null; 13528 return null;
13527 } 13529 }
13528 13530
13529 Object visitConstructorName(ConstructorName node) { 13531 Object visitConstructorName(ConstructorName node) {
13530 visit(node.type); 13532 visitNode(node.type);
13531 visit3(".", node.name); 13533 visitNodeWithPrefix(".", node.name);
13532 return null; 13534 return null;
13533 } 13535 }
13534 13536
13535 Object visitContinueStatement(ContinueStatement node) { 13537 Object visitContinueStatement(ContinueStatement node) {
13536 _writer.print("continue"); 13538 _writer.print("continue");
13537 visit3(" ", node.label); 13539 visitNodeWithPrefix(" ", node.label);
13538 _writer.print(";"); 13540 _writer.print(";");
13539 return null; 13541 return null;
13540 } 13542 }
13541 13543
13542 Object visitDeclaredIdentifier(DeclaredIdentifier node) { 13544 Object visitDeclaredIdentifier(DeclaredIdentifier node) {
13543 visit5(node.keyword, " "); 13545 visitTokenWithSuffix(node.keyword, " ");
13544 visit2(node.type, " "); 13546 visitNodeWithSuffix(node.type, " ");
13545 visit(node.identifier); 13547 visitNode(node.identifier);
13546 return null; 13548 return null;
13547 } 13549 }
13548 13550
13549 Object visitDefaultFormalParameter(DefaultFormalParameter node) { 13551 Object visitDefaultFormalParameter(DefaultFormalParameter node) {
13550 visit(node.parameter); 13552 visitNode(node.parameter);
13551 if (node.separator != null) { 13553 if (node.separator != null) {
13552 _writer.print(" "); 13554 _writer.print(" ");
13553 _writer.print(node.separator.lexeme); 13555 _writer.print(node.separator.lexeme);
13554 visit3(" ", node.defaultValue); 13556 visitNodeWithPrefix(" ", node.defaultValue);
13555 } 13557 }
13556 return null; 13558 return null;
13557 } 13559 }
13558 13560
13559 Object visitDoStatement(DoStatement node) { 13561 Object visitDoStatement(DoStatement node) {
13560 _writer.print("do "); 13562 _writer.print("do ");
13561 visit(node.body); 13563 visitNode(node.body);
13562 _writer.print(" while ("); 13564 _writer.print(" while (");
13563 visit(node.condition); 13565 visitNode(node.condition);
13564 _writer.print(");"); 13566 _writer.print(");");
13565 return null; 13567 return null;
13566 } 13568 }
13567 13569
13568 Object visitDoubleLiteral(DoubleLiteral node) { 13570 Object visitDoubleLiteral(DoubleLiteral node) {
13569 _writer.print(node.literal.lexeme); 13571 _writer.print(node.literal.lexeme);
13570 return null; 13572 return null;
13571 } 13573 }
13572 13574
13573 Object visitEmptyFunctionBody(EmptyFunctionBody node) { 13575 Object visitEmptyFunctionBody(EmptyFunctionBody node) {
13574 _writer.print(';'); 13576 _writer.print(';');
13575 return null; 13577 return null;
13576 } 13578 }
13577 13579
13578 Object visitEmptyStatement(EmptyStatement node) { 13580 Object visitEmptyStatement(EmptyStatement node) {
13579 _writer.print(';'); 13581 _writer.print(';');
13580 return null; 13582 return null;
13581 } 13583 }
13582 13584
13583 Object visitExportDirective(ExportDirective node) { 13585 Object visitExportDirective(ExportDirective node) {
13584 _writer.print("export "); 13586 _writer.print("export ");
13585 visit(node.uri); 13587 visitNode(node.uri);
13586 visitList4(" ", node.combinators, " "); 13588 visitNodeListWithSeparatorAndPrefix(" ", node.combinators, " ");
13587 _writer.print(';'); 13589 _writer.print(';');
13588 return null; 13590 return null;
13589 } 13591 }
13590 13592
13591 Object visitExpressionFunctionBody(ExpressionFunctionBody node) { 13593 Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
13592 _writer.print("=> "); 13594 _writer.print("=> ");
13593 visit(node.expression); 13595 visitNode(node.expression);
13594 if (node.semicolon != null) { 13596 if (node.semicolon != null) {
13595 _writer.print(';'); 13597 _writer.print(';');
13596 } 13598 }
13597 return null; 13599 return null;
13598 } 13600 }
13599 13601
13600 Object visitExpressionStatement(ExpressionStatement node) { 13602 Object visitExpressionStatement(ExpressionStatement node) {
13601 visit(node.expression); 13603 visitNode(node.expression);
13602 _writer.print(';'); 13604 _writer.print(';');
13603 return null; 13605 return null;
13604 } 13606 }
13605 13607
13606 Object visitExtendsClause(ExtendsClause node) { 13608 Object visitExtendsClause(ExtendsClause node) {
13607 _writer.print("extends "); 13609 _writer.print("extends ");
13608 visit(node.superclass); 13610 visitNode(node.superclass);
13609 return null; 13611 return null;
13610 } 13612 }
13611 13613
13612 Object visitFieldDeclaration(FieldDeclaration node) { 13614 Object visitFieldDeclaration(FieldDeclaration node) {
13613 visit5(node.staticKeyword, " "); 13615 visitTokenWithSuffix(node.staticKeyword, " ");
13614 visit(node.fields); 13616 visitNode(node.fields);
13615 _writer.print(";"); 13617 _writer.print(";");
13616 return null; 13618 return null;
13617 } 13619 }
13618 13620
13619 Object visitFieldFormalParameter(FieldFormalParameter node) { 13621 Object visitFieldFormalParameter(FieldFormalParameter node) {
13620 visit5(node.keyword, " "); 13622 visitTokenWithSuffix(node.keyword, " ");
13621 visit2(node.type, " "); 13623 visitNodeWithSuffix(node.type, " ");
13622 _writer.print("this."); 13624 _writer.print("this.");
13623 visit(node.identifier); 13625 visitNode(node.identifier);
13624 visit(node.parameters); 13626 visitNode(node.parameters);
13625 return null; 13627 return null;
13626 } 13628 }
13627 13629
13628 Object visitForEachStatement(ForEachStatement node) { 13630 Object visitForEachStatement(ForEachStatement node) {
13629 DeclaredIdentifier loopVariable = node.loopVariable; 13631 DeclaredIdentifier loopVariable = node.loopVariable;
13630 _writer.print("for ("); 13632 _writer.print("for (");
13631 if (loopVariable == null) { 13633 if (loopVariable == null) {
13632 visit(node.identifier); 13634 visitNode(node.identifier);
13633 } else { 13635 } else {
13634 visit(loopVariable); 13636 visitNode(loopVariable);
13635 } 13637 }
13636 _writer.print(" in "); 13638 _writer.print(" in ");
13637 visit(node.iterator); 13639 visitNode(node.iterator);
13638 _writer.print(") "); 13640 _writer.print(") ");
13639 visit(node.body); 13641 visitNode(node.body);
13640 return null; 13642 return null;
13641 } 13643 }
13642 13644
13643 Object visitFormalParameterList(FormalParameterList node) { 13645 Object visitFormalParameterList(FormalParameterList node) {
13644 String groupEnd = null; 13646 String groupEnd = null;
13645 _writer.print('('); 13647 _writer.print('(');
13646 NodeList<FormalParameter> parameters = node.parameters; 13648 NodeList<FormalParameter> parameters = node.parameters;
13647 int size = parameters.length; 13649 int size = parameters.length;
13648 for (int i = 0; i < size; i++) { 13650 for (int i = 0; i < size; i++) {
13649 FormalParameter parameter = parameters[i]; 13651 FormalParameter parameter = parameters[i];
(...skipping 15 matching lines...) Expand all
13665 _writer.print(groupEnd); 13667 _writer.print(groupEnd);
13666 } 13668 }
13667 _writer.print(')'); 13669 _writer.print(')');
13668 return null; 13670 return null;
13669 } 13671 }
13670 13672
13671 Object visitForStatement(ForStatement node) { 13673 Object visitForStatement(ForStatement node) {
13672 Expression initialization = node.initialization; 13674 Expression initialization = node.initialization;
13673 _writer.print("for ("); 13675 _writer.print("for (");
13674 if (initialization != null) { 13676 if (initialization != null) {
13675 visit(initialization); 13677 visitNode(initialization);
13676 } else { 13678 } else {
13677 visit(node.variables); 13679 visitNode(node.variables);
13678 } 13680 }
13679 _writer.print(";"); 13681 _writer.print(";");
13680 visit3(" ", node.condition); 13682 visitNodeWithPrefix(" ", node.condition);
13681 _writer.print(";"); 13683 _writer.print(";");
13682 visitList4(" ", node.updaters, ", "); 13684 visitNodeListWithSeparatorAndPrefix(" ", node.updaters, ", ");
13683 _writer.print(") "); 13685 _writer.print(") ");
13684 visit(node.body); 13686 visitNode(node.body);
13685 return null; 13687 return null;
13686 } 13688 }
13687 13689
13688 Object visitFunctionDeclaration(FunctionDeclaration node) { 13690 Object visitFunctionDeclaration(FunctionDeclaration node) {
13689 visit2(node.returnType, " "); 13691 visitNodeWithSuffix(node.returnType, " ");
13690 visit5(node.propertyKeyword, " "); 13692 visitTokenWithSuffix(node.propertyKeyword, " ");
13691 visit(node.name); 13693 visitNode(node.name);
13692 visit(node.functionExpression); 13694 visitNode(node.functionExpression);
13693 return null; 13695 return null;
13694 } 13696 }
13695 13697
13696 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 13698 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
13697 visit(node.functionDeclaration); 13699 visitNode(node.functionDeclaration);
13698 _writer.print(';'); 13700 _writer.print(';');
13699 return null; 13701 return null;
13700 } 13702 }
13701 13703
13702 Object visitFunctionExpression(FunctionExpression node) { 13704 Object visitFunctionExpression(FunctionExpression node) {
13703 visit(node.parameters); 13705 visitNode(node.parameters);
13704 _writer.print(' '); 13706 _writer.print(' ');
13705 visit(node.body); 13707 visitNode(node.body);
13706 return null; 13708 return null;
13707 } 13709 }
13708 13710
13709 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 13711 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
13710 visit(node.function); 13712 visitNode(node.function);
13711 visit(node.argumentList); 13713 visitNode(node.argumentList);
13712 return null; 13714 return null;
13713 } 13715 }
13714 13716
13715 Object visitFunctionTypeAlias(FunctionTypeAlias node) { 13717 Object visitFunctionTypeAlias(FunctionTypeAlias node) {
13716 _writer.print("typedef "); 13718 _writer.print("typedef ");
13717 visit2(node.returnType, " "); 13719 visitNodeWithSuffix(node.returnType, " ");
13718 visit(node.name); 13720 visitNode(node.name);
13719 visit(node.typeParameters); 13721 visitNode(node.typeParameters);
13720 visit(node.parameters); 13722 visitNode(node.parameters);
13721 _writer.print(";"); 13723 _writer.print(";");
13722 return null; 13724 return null;
13723 } 13725 }
13724 13726
13725 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 13727 Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
13726 visit2(node.returnType, " "); 13728 visitNodeWithSuffix(node.returnType, " ");
13727 visit(node.identifier); 13729 visitNode(node.identifier);
13728 visit(node.parameters); 13730 visitNode(node.parameters);
13729 return null; 13731 return null;
13730 } 13732 }
13731 13733
13732 Object visitHideCombinator(HideCombinator node) { 13734 Object visitHideCombinator(HideCombinator node) {
13733 _writer.print("hide "); 13735 _writer.print("hide ");
13734 visitList2(node.hiddenNames, ", "); 13736 visitNodeListWithSeparator(node.hiddenNames, ", ");
13735 return null; 13737 return null;
13736 } 13738 }
13737 13739
13738 Object visitIfStatement(IfStatement node) { 13740 Object visitIfStatement(IfStatement node) {
13739 _writer.print("if ("); 13741 _writer.print("if (");
13740 visit(node.condition); 13742 visitNode(node.condition);
13741 _writer.print(") "); 13743 _writer.print(") ");
13742 visit(node.thenStatement); 13744 visitNode(node.thenStatement);
13743 visit3(" else ", node.elseStatement); 13745 visitNodeWithPrefix(" else ", node.elseStatement);
13744 return null; 13746 return null;
13745 } 13747 }
13746 13748
13747 Object visitImplementsClause(ImplementsClause node) { 13749 Object visitImplementsClause(ImplementsClause node) {
13748 _writer.print("implements "); 13750 _writer.print("implements ");
13749 visitList2(node.interfaces, ", "); 13751 visitNodeListWithSeparator(node.interfaces, ", ");
13750 return null; 13752 return null;
13751 } 13753 }
13752 13754
13753 Object visitImportDirective(ImportDirective node) { 13755 Object visitImportDirective(ImportDirective node) {
13754 _writer.print("import "); 13756 _writer.print("import ");
13755 visit(node.uri); 13757 visitNode(node.uri);
13756 visit3(" as ", node.prefix); 13758 visitNodeWithPrefix(" as ", node.prefix);
13757 visitList4(" ", node.combinators, " "); 13759 visitNodeListWithSeparatorAndPrefix(" ", node.combinators, " ");
13758 _writer.print(';'); 13760 _writer.print(';');
13759 return null; 13761 return null;
13760 } 13762 }
13761 13763
13762 Object visitIndexExpression(IndexExpression node) { 13764 Object visitIndexExpression(IndexExpression node) {
13763 if (node.isCascaded) { 13765 if (node.isCascaded) {
13764 _writer.print(".."); 13766 _writer.print("..");
13765 } else { 13767 } else {
13766 visit(node.target); 13768 visitNode(node.target);
13767 } 13769 }
13768 _writer.print('['); 13770 _writer.print('[');
13769 visit(node.index); 13771 visitNode(node.index);
13770 _writer.print(']'); 13772 _writer.print(']');
13771 return null; 13773 return null;
13772 } 13774 }
13773 13775
13774 Object visitInstanceCreationExpression(InstanceCreationExpression node) { 13776 Object visitInstanceCreationExpression(InstanceCreationExpression node) {
13775 visit5(node.keyword, " "); 13777 visitTokenWithSuffix(node.keyword, " ");
13776 visit(node.constructorName); 13778 visitNode(node.constructorName);
13777 visit(node.argumentList); 13779 visitNode(node.argumentList);
13778 return null; 13780 return null;
13779 } 13781 }
13780 13782
13781 Object visitIntegerLiteral(IntegerLiteral node) { 13783 Object visitIntegerLiteral(IntegerLiteral node) {
13782 _writer.print(node.literal.lexeme); 13784 _writer.print(node.literal.lexeme);
13783 return null; 13785 return null;
13784 } 13786 }
13785 13787
13786 Object visitInterpolationExpression(InterpolationExpression node) { 13788 Object visitInterpolationExpression(InterpolationExpression node) {
13787 if (node.rightBracket != null) { 13789 if (node.rightBracket != null) {
13788 _writer.print("\${"); 13790 _writer.print("\${");
13789 visit(node.expression); 13791 visitNode(node.expression);
13790 _writer.print("}"); 13792 _writer.print("}");
13791 } else { 13793 } else {
13792 _writer.print("\$"); 13794 _writer.print("\$");
13793 visit(node.expression); 13795 visitNode(node.expression);
13794 } 13796 }
13795 return null; 13797 return null;
13796 } 13798 }
13797 13799
13798 Object visitInterpolationString(InterpolationString node) { 13800 Object visitInterpolationString(InterpolationString node) {
13799 _writer.print(node.contents.lexeme); 13801 _writer.print(node.contents.lexeme);
13800 return null; 13802 return null;
13801 } 13803 }
13802 13804
13803 Object visitIsExpression(IsExpression node) { 13805 Object visitIsExpression(IsExpression node) {
13804 visit(node.expression); 13806 visitNode(node.expression);
13805 if (node.notOperator == null) { 13807 if (node.notOperator == null) {
13806 _writer.print(" is "); 13808 _writer.print(" is ");
13807 } else { 13809 } else {
13808 _writer.print(" is! "); 13810 _writer.print(" is! ");
13809 } 13811 }
13810 visit(node.type); 13812 visitNode(node.type);
13811 return null; 13813 return null;
13812 } 13814 }
13813 13815
13814 Object visitLabel(Label node) { 13816 Object visitLabel(Label node) {
13815 visit(node.label); 13817 visitNode(node.label);
13816 _writer.print(":"); 13818 _writer.print(":");
13817 return null; 13819 return null;
13818 } 13820 }
13819 13821
13820 Object visitLabeledStatement(LabeledStatement node) { 13822 Object visitLabeledStatement(LabeledStatement node) {
13821 visitList3(node.labels, " ", " "); 13823 visitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
13822 visit(node.statement); 13824 visitNode(node.statement);
13823 return null; 13825 return null;
13824 } 13826 }
13825 13827
13826 Object visitLibraryDirective(LibraryDirective node) { 13828 Object visitLibraryDirective(LibraryDirective node) {
13827 _writer.print("library "); 13829 _writer.print("library ");
13828 visit(node.name); 13830 visitNode(node.name);
13829 _writer.print(';'); 13831 _writer.print(';');
13830 return null; 13832 return null;
13831 } 13833 }
13832 13834
13833 Object visitLibraryIdentifier(LibraryIdentifier node) { 13835 Object visitLibraryIdentifier(LibraryIdentifier node) {
13834 _writer.print(node.name); 13836 _writer.print(node.name);
13835 return null; 13837 return null;
13836 } 13838 }
13837 13839
13838 Object visitListLiteral(ListLiteral node) { 13840 Object visitListLiteral(ListLiteral node) {
13839 if (node.constKeyword != null) { 13841 if (node.constKeyword != null) {
13840 _writer.print(node.constKeyword.lexeme); 13842 _writer.print(node.constKeyword.lexeme);
13841 _writer.print(' '); 13843 _writer.print(' ');
13842 } 13844 }
13843 visit2(node.typeArguments, " "); 13845 visitNodeWithSuffix(node.typeArguments, " ");
13844 _writer.print("["); 13846 _writer.print("[");
13845 visitList2(node.elements, ", "); 13847 visitNodeListWithSeparator(node.elements, ", ");
13846 _writer.print("]"); 13848 _writer.print("]");
13847 return null; 13849 return null;
13848 } 13850 }
13849 13851
13850 Object visitMapLiteral(MapLiteral node) { 13852 Object visitMapLiteral(MapLiteral node) {
13851 if (node.constKeyword != null) { 13853 if (node.constKeyword != null) {
13852 _writer.print(node.constKeyword.lexeme); 13854 _writer.print(node.constKeyword.lexeme);
13853 _writer.print(' '); 13855 _writer.print(' ');
13854 } 13856 }
13855 visit2(node.typeArguments, " "); 13857 visitNodeWithSuffix(node.typeArguments, " ");
13856 _writer.print("{"); 13858 _writer.print("{");
13857 visitList2(node.entries, ", "); 13859 visitNodeListWithSeparator(node.entries, ", ");
13858 _writer.print("}"); 13860 _writer.print("}");
13859 return null; 13861 return null;
13860 } 13862 }
13861 13863
13862 Object visitMapLiteralEntry(MapLiteralEntry node) { 13864 Object visitMapLiteralEntry(MapLiteralEntry node) {
13863 visit(node.key); 13865 visitNode(node.key);
13864 _writer.print(" : "); 13866 _writer.print(" : ");
13865 visit(node.value); 13867 visitNode(node.value);
13866 return null; 13868 return null;
13867 } 13869 }
13868 13870
13869 Object visitMethodDeclaration(MethodDeclaration node) { 13871 Object visitMethodDeclaration(MethodDeclaration node) {
13870 visit5(node.externalKeyword, " "); 13872 visitTokenWithSuffix(node.externalKeyword, " ");
13871 visit5(node.modifierKeyword, " "); 13873 visitTokenWithSuffix(node.modifierKeyword, " ");
13872 visit2(node.returnType, " "); 13874 visitNodeWithSuffix(node.returnType, " ");
13873 visit5(node.propertyKeyword, " "); 13875 visitTokenWithSuffix(node.propertyKeyword, " ");
13874 visit5(node.operatorKeyword, " "); 13876 visitTokenWithSuffix(node.operatorKeyword, " ");
13875 visit(node.name); 13877 visitNode(node.name);
13876 if (!node.isGetter) { 13878 if (!node.isGetter) {
13877 visit(node.parameters); 13879 visitNode(node.parameters);
13878 } 13880 }
13879 visit4(" ", node.body); 13881 visitFunctionWithPrefix(" ", node.body);
13880 return null; 13882 return null;
13881 } 13883 }
13882 13884
13883 Object visitMethodInvocation(MethodInvocation node) { 13885 Object visitMethodInvocation(MethodInvocation node) {
13884 if (node.isCascaded) { 13886 if (node.isCascaded) {
13885 _writer.print(".."); 13887 _writer.print("..");
13886 } else { 13888 } else {
13887 visit2(node.target, "."); 13889 visitNodeWithSuffix(node.target, ".");
13888 } 13890 }
13889 visit(node.methodName); 13891 visitNode(node.methodName);
13890 visit(node.argumentList); 13892 visitNode(node.argumentList);
13891 return null; 13893 return null;
13892 } 13894 }
13893 13895
13894 Object visitNamedExpression(NamedExpression node) { 13896 Object visitNamedExpression(NamedExpression node) {
13895 visit(node.name); 13897 visitNode(node.name);
13896 visit3(" ", node.expression); 13898 visitNodeWithPrefix(" ", node.expression);
13897 return null; 13899 return null;
13898 } 13900 }
13899 13901
13900 Object visitNativeClause(NativeClause node) { 13902 Object visitNativeClause(NativeClause node) {
13901 _writer.print("native "); 13903 _writer.print("native ");
13902 visit(node.name); 13904 visitNode(node.name);
13903 return null; 13905 return null;
13904 } 13906 }
13905 13907
13906 Object visitNativeFunctionBody(NativeFunctionBody node) { 13908 Object visitNativeFunctionBody(NativeFunctionBody node) {
13907 _writer.print("native "); 13909 _writer.print("native ");
13908 visit(node.stringLiteral); 13910 visitNode(node.stringLiteral);
13909 _writer.print(';'); 13911 _writer.print(';');
13910 return null; 13912 return null;
13911 } 13913 }
13912 13914
13913 Object visitNullLiteral(NullLiteral node) { 13915 Object visitNullLiteral(NullLiteral node) {
13914 _writer.print("null"); 13916 _writer.print("null");
13915 return null; 13917 return null;
13916 } 13918 }
13917 13919
13918 Object visitParenthesizedExpression(ParenthesizedExpression node) { 13920 Object visitParenthesizedExpression(ParenthesizedExpression node) {
13919 _writer.print('('); 13921 _writer.print('(');
13920 visit(node.expression); 13922 visitNode(node.expression);
13921 _writer.print(')'); 13923 _writer.print(')');
13922 return null; 13924 return null;
13923 } 13925 }
13924 13926
13925 Object visitPartDirective(PartDirective node) { 13927 Object visitPartDirective(PartDirective node) {
13926 _writer.print("part "); 13928 _writer.print("part ");
13927 visit(node.uri); 13929 visitNode(node.uri);
13928 _writer.print(';'); 13930 _writer.print(';');
13929 return null; 13931 return null;
13930 } 13932 }
13931 13933
13932 Object visitPartOfDirective(PartOfDirective node) { 13934 Object visitPartOfDirective(PartOfDirective node) {
13933 _writer.print("part of "); 13935 _writer.print("part of ");
13934 visit(node.libraryName); 13936 visitNode(node.libraryName);
13935 _writer.print(';'); 13937 _writer.print(';');
13936 return null; 13938 return null;
13937 } 13939 }
13938 13940
13939 Object visitPostfixExpression(PostfixExpression node) { 13941 Object visitPostfixExpression(PostfixExpression node) {
13940 visit(node.operand); 13942 visitNode(node.operand);
13941 _writer.print(node.operator.lexeme); 13943 _writer.print(node.operator.lexeme);
13942 return null; 13944 return null;
13943 } 13945 }
13944 13946
13945 Object visitPrefixedIdentifier(PrefixedIdentifier node) { 13947 Object visitPrefixedIdentifier(PrefixedIdentifier node) {
13946 visit(node.prefix); 13948 visitNode(node.prefix);
13947 _writer.print('.'); 13949 _writer.print('.');
13948 visit(node.identifier); 13950 visitNode(node.identifier);
13949 return null; 13951 return null;
13950 } 13952 }
13951 13953
13952 Object visitPrefixExpression(PrefixExpression node) { 13954 Object visitPrefixExpression(PrefixExpression node) {
13953 _writer.print(node.operator.lexeme); 13955 _writer.print(node.operator.lexeme);
13954 visit(node.operand); 13956 visitNode(node.operand);
13955 return null; 13957 return null;
13956 } 13958 }
13957 13959
13958 Object visitPropertyAccess(PropertyAccess node) { 13960 Object visitPropertyAccess(PropertyAccess node) {
13959 if (node.isCascaded) { 13961 if (node.isCascaded) {
13960 _writer.print(".."); 13962 _writer.print("..");
13961 } else { 13963 } else {
13962 visit(node.target); 13964 visitNode(node.target);
13963 _writer.print('.'); 13965 _writer.print('.');
13964 } 13966 }
13965 visit(node.propertyName); 13967 visitNode(node.propertyName);
13966 return null; 13968 return null;
13967 } 13969 }
13968 13970
13969 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { 13971 Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
13970 _writer.print("this"); 13972 _writer.print("this");
13971 visit3(".", node.constructorName); 13973 visitNodeWithPrefix(".", node.constructorName);
13972 visit(node.argumentList); 13974 visitNode(node.argumentList);
13973 return null; 13975 return null;
13974 } 13976 }
13975 13977
13976 Object visitRethrowExpression(RethrowExpression node) { 13978 Object visitRethrowExpression(RethrowExpression node) {
13977 _writer.print("rethrow"); 13979 _writer.print("rethrow");
13978 return null; 13980 return null;
13979 } 13981 }
13980 13982
13981 Object visitReturnStatement(ReturnStatement node) { 13983 Object visitReturnStatement(ReturnStatement node) {
13982 Expression expression = node.expression; 13984 Expression expression = node.expression;
13983 if (expression == null) { 13985 if (expression == null) {
13984 _writer.print("return;"); 13986 _writer.print("return;");
13985 } else { 13987 } else {
13986 _writer.print("return "); 13988 _writer.print("return ");
13987 expression.accept(this); 13989 expression.accept(this);
13988 _writer.print(";"); 13990 _writer.print(";");
13989 } 13991 }
13990 return null; 13992 return null;
13991 } 13993 }
13992 13994
13993 Object visitScriptTag(ScriptTag node) { 13995 Object visitScriptTag(ScriptTag node) {
13994 _writer.print(node.scriptTag.lexeme); 13996 _writer.print(node.scriptTag.lexeme);
13995 return null; 13997 return null;
13996 } 13998 }
13997 13999
13998 Object visitShowCombinator(ShowCombinator node) { 14000 Object visitShowCombinator(ShowCombinator node) {
13999 _writer.print("show "); 14001 _writer.print("show ");
14000 visitList2(node.shownNames, ", "); 14002 visitNodeListWithSeparator(node.shownNames, ", ");
14001 return null; 14003 return null;
14002 } 14004 }
14003 14005
14004 Object visitSimpleFormalParameter(SimpleFormalParameter node) { 14006 Object visitSimpleFormalParameter(SimpleFormalParameter node) {
14005 visit5(node.keyword, " "); 14007 visitTokenWithSuffix(node.keyword, " ");
14006 visit2(node.type, " "); 14008 visitNodeWithSuffix(node.type, " ");
14007 visit(node.identifier); 14009 visitNode(node.identifier);
14008 return null; 14010 return null;
14009 } 14011 }
14010 14012
14011 Object visitSimpleIdentifier(SimpleIdentifier node) { 14013 Object visitSimpleIdentifier(SimpleIdentifier node) {
14012 _writer.print(node.token.lexeme); 14014 _writer.print(node.token.lexeme);
14013 return null; 14015 return null;
14014 } 14016 }
14015 14017
14016 Object visitSimpleStringLiteral(SimpleStringLiteral node) { 14018 Object visitSimpleStringLiteral(SimpleStringLiteral node) {
14017 _writer.print(node.literal.lexeme); 14019 _writer.print(node.literal.lexeme);
14018 return null; 14020 return null;
14019 } 14021 }
14020 14022
14021 Object visitStringInterpolation(StringInterpolation node) { 14023 Object visitStringInterpolation(StringInterpolation node) {
14022 visitList(node.elements); 14024 visitNodeList(node.elements);
14023 return null; 14025 return null;
14024 } 14026 }
14025 14027
14026 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) { 14028 Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
14027 _writer.print("super"); 14029 _writer.print("super");
14028 visit3(".", node.constructorName); 14030 visitNodeWithPrefix(".", node.constructorName);
14029 visit(node.argumentList); 14031 visitNode(node.argumentList);
14030 return null; 14032 return null;
14031 } 14033 }
14032 14034
14033 Object visitSuperExpression(SuperExpression node) { 14035 Object visitSuperExpression(SuperExpression node) {
14034 _writer.print("super"); 14036 _writer.print("super");
14035 return null; 14037 return null;
14036 } 14038 }
14037 14039
14038 Object visitSwitchCase(SwitchCase node) { 14040 Object visitSwitchCase(SwitchCase node) {
14039 visitList3(node.labels, " ", " "); 14041 visitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
14040 _writer.print("case "); 14042 _writer.print("case ");
14041 visit(node.expression); 14043 visitNode(node.expression);
14042 _writer.print(": "); 14044 _writer.print(": ");
14043 visitList2(node.statements, " "); 14045 visitNodeListWithSeparator(node.statements, " ");
14044 return null; 14046 return null;
14045 } 14047 }
14046 14048
14047 Object visitSwitchDefault(SwitchDefault node) { 14049 Object visitSwitchDefault(SwitchDefault node) {
14048 visitList3(node.labels, " ", " "); 14050 visitNodeListWithSeparatorAndSuffix(node.labels, " ", " ");
14049 _writer.print("default: "); 14051 _writer.print("default: ");
14050 visitList2(node.statements, " "); 14052 visitNodeListWithSeparator(node.statements, " ");
14051 return null; 14053 return null;
14052 } 14054 }
14053 14055
14054 Object visitSwitchStatement(SwitchStatement node) { 14056 Object visitSwitchStatement(SwitchStatement node) {
14055 _writer.print("switch ("); 14057 _writer.print("switch (");
14056 visit(node.expression); 14058 visitNode(node.expression);
14057 _writer.print(") {"); 14059 _writer.print(") {");
14058 visitList2(node.members, " "); 14060 visitNodeListWithSeparator(node.members, " ");
14059 _writer.print("}"); 14061 _writer.print("}");
14060 return null; 14062 return null;
14061 } 14063 }
14062 14064
14063 Object visitSymbolLiteral(SymbolLiteral node) { 14065 Object visitSymbolLiteral(SymbolLiteral node) {
14064 _writer.print("#"); 14066 _writer.print("#");
14065 List<Token> components = node.components; 14067 List<Token> components = node.components;
14066 for (int i = 0; i < components.length; i++) { 14068 for (int i = 0; i < components.length; i++) {
14067 if (i > 0) { 14069 if (i > 0) {
14068 _writer.print("."); 14070 _writer.print(".");
14069 } 14071 }
14070 _writer.print(components[i].lexeme); 14072 _writer.print(components[i].lexeme);
14071 } 14073 }
14072 return null; 14074 return null;
14073 } 14075 }
14074 14076
14075 Object visitThisExpression(ThisExpression node) { 14077 Object visitThisExpression(ThisExpression node) {
14076 _writer.print("this"); 14078 _writer.print("this");
14077 return null; 14079 return null;
14078 } 14080 }
14079 14081
14080 Object visitThrowExpression(ThrowExpression node) { 14082 Object visitThrowExpression(ThrowExpression node) {
14081 _writer.print("throw "); 14083 _writer.print("throw ");
14082 visit(node.expression); 14084 visitNode(node.expression);
14083 return null; 14085 return null;
14084 } 14086 }
14085 14087
14086 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 14088 Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
14087 visit2(node.variables, ";"); 14089 visitNodeWithSuffix(node.variables, ";");
14088 return null; 14090 return null;
14089 } 14091 }
14090 14092
14091 Object visitTryStatement(TryStatement node) { 14093 Object visitTryStatement(TryStatement node) {
14092 _writer.print("try "); 14094 _writer.print("try ");
14093 visit(node.body); 14095 visitNode(node.body);
14094 visitList4(" ", node.catchClauses, " "); 14096 visitNodeListWithSeparatorAndPrefix(" ", node.catchClauses, " ");
14095 visit3(" finally ", node.finallyBlock); 14097 visitNodeWithPrefix(" finally ", node.finallyBlock);
14096 return null; 14098 return null;
14097 } 14099 }
14098 14100
14099 Object visitTypeArgumentList(TypeArgumentList node) { 14101 Object visitTypeArgumentList(TypeArgumentList node) {
14100 _writer.print('<'); 14102 _writer.print('<');
14101 visitList2(node.arguments, ", "); 14103 visitNodeListWithSeparator(node.arguments, ", ");
14102 _writer.print('>'); 14104 _writer.print('>');
14103 return null; 14105 return null;
14104 } 14106 }
14105 14107
14106 Object visitTypeName(TypeName node) { 14108 Object visitTypeName(TypeName node) {
14107 visit(node.name); 14109 visitNode(node.name);
14108 visit(node.typeArguments); 14110 visitNode(node.typeArguments);
14109 return null; 14111 return null;
14110 } 14112 }
14111 14113
14112 Object visitTypeParameter(TypeParameter node) { 14114 Object visitTypeParameter(TypeParameter node) {
14113 visit(node.name); 14115 visitNode(node.name);
14114 visit3(" extends ", node.bound); 14116 visitNodeWithPrefix(" extends ", node.bound);
14115 return null; 14117 return null;
14116 } 14118 }
14117 14119
14118 Object visitTypeParameterList(TypeParameterList node) { 14120 Object visitTypeParameterList(TypeParameterList node) {
14119 _writer.print('<'); 14121 _writer.print('<');
14120 visitList2(node.typeParameters, ", "); 14122 visitNodeListWithSeparator(node.typeParameters, ", ");
14121 _writer.print('>'); 14123 _writer.print('>');
14122 return null; 14124 return null;
14123 } 14125 }
14124 14126
14125 Object visitVariableDeclaration(VariableDeclaration node) { 14127 Object visitVariableDeclaration(VariableDeclaration node) {
14126 visit(node.name); 14128 visitNode(node.name);
14127 visit3(" = ", node.initializer); 14129 visitNodeWithPrefix(" = ", node.initializer);
14128 return null; 14130 return null;
14129 } 14131 }
14130 14132
14131 Object visitVariableDeclarationList(VariableDeclarationList node) { 14133 Object visitVariableDeclarationList(VariableDeclarationList node) {
14132 visit5(node.keyword, " "); 14134 visitTokenWithSuffix(node.keyword, " ");
14133 visit2(node.type, " "); 14135 visitNodeWithSuffix(node.type, " ");
14134 visitList2(node.variables, ", "); 14136 visitNodeListWithSeparator(node.variables, ", ");
14135 return null; 14137 return null;
14136 } 14138 }
14137 14139
14138 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) { 14140 Object visitVariableDeclarationStatement(VariableDeclarationStatement node) {
14139 visit(node.variables); 14141 visitNode(node.variables);
14140 _writer.print(";"); 14142 _writer.print(";");
14141 return null; 14143 return null;
14142 } 14144 }
14143 14145
14144 Object visitWhileStatement(WhileStatement node) { 14146 Object visitWhileStatement(WhileStatement node) {
14145 _writer.print("while ("); 14147 _writer.print("while (");
14146 visit(node.condition); 14148 visitNode(node.condition);
14147 _writer.print(") "); 14149 _writer.print(") ");
14148 visit(node.body); 14150 visitNode(node.body);
14149 return null; 14151 return null;
14150 } 14152 }
14151 14153
14152 Object visitWithClause(WithClause node) { 14154 Object visitWithClause(WithClause node) {
14153 _writer.print("with "); 14155 _writer.print("with ");
14154 visitList2(node.mixinTypes, ", "); 14156 visitNodeListWithSeparator(node.mixinTypes, ", ");
14155 return null; 14157 return null;
14156 } 14158 }
14157 14159
14158 /** 14160 /**
14159 * Safely visit the given node.
14160 *
14161 * @param node the node to be visited
14162 */
14163 void visit(AstNode node) {
14164 if (node != null) {
14165 node.accept(this);
14166 }
14167 }
14168
14169 /**
14170 * Safely visit the given node, printing the suffix after the node if it is no n-`null`.
14171 *
14172 * @param suffix the suffix to be printed if there is a node to visit
14173 * @param node the node to be visited
14174 */
14175 void visit2(AstNode node, String suffix) {
14176 if (node != null) {
14177 node.accept(this);
14178 _writer.print(suffix);
14179 }
14180 }
14181
14182 /**
14183 * Safely visit the given node, printing the prefix before the node if it is n on-`null`.
14184 *
14185 * @param prefix the prefix to be printed if there is a node to visit
14186 * @param node the node to be visited
14187 */
14188 void visit3(String prefix, AstNode node) {
14189 if (node != null) {
14190 _writer.print(prefix);
14191 node.accept(this);
14192 }
14193 }
14194
14195 /**
14196 * Visit the given function body, printing the prefix before if given body is not empty. 14161 * Visit the given function body, printing the prefix before if given body is not empty.
14197 * 14162 *
14198 * @param prefix the prefix to be printed if there is a node to visit 14163 * @param prefix the prefix to be printed if there is a node to visit
14199 * @param body the function body to be visited 14164 * @param body the function body to be visited
14200 */ 14165 */
14201 void visit4(String prefix, FunctionBody body) { 14166 void visitFunctionWithPrefix(String prefix, FunctionBody body) {
14202 if (body is! EmptyFunctionBody) { 14167 if (body is! EmptyFunctionBody) {
14203 _writer.print(prefix); 14168 _writer.print(prefix);
14204 } 14169 }
14205 visit(body); 14170 visitNode(body);
14206 } 14171 }
14207 14172
14208 /** 14173 /**
14209 * Safely visit the given node, printing the suffix after the node if it is no n-`null`. 14174 * Safely visit the given node.
14210 * 14175 *
14211 * @param suffix the suffix to be printed if there is a node to visit
14212 * @param node the node to be visited 14176 * @param node the node to be visited
14213 */ 14177 */
14214 void visit5(Token token, String suffix) { 14178 void visitNode(AstNode node) {
14215 if (token != null) { 14179 if (node != null) {
14216 _writer.print(token.lexeme); 14180 node.accept(this);
14217 _writer.print(suffix);
14218 } 14181 }
14219 } 14182 }
14220 14183
14221 /** 14184 /**
14222 * Print a list of nodes without any separation. 14185 * Print a list of nodes without any separation.
14223 * 14186 *
14224 * @param nodes the nodes to be printed 14187 * @param nodes the nodes to be printed
14225 * @param separator the separator to be printed between adjacent nodes 14188 * @param separator the separator to be printed between adjacent nodes
14226 */ 14189 */
14227 void visitList(NodeList<AstNode> nodes) { 14190 void visitNodeList(NodeList<AstNode> nodes) {
14228 visitList2(nodes, ""); 14191 visitNodeListWithSeparator(nodes, "");
14229 } 14192 }
14230 14193
14231 /** 14194 /**
14232 * Print a list of nodes, separated by the given separator. 14195 * Print a list of nodes, separated by the given separator.
14233 * 14196 *
14234 * @param nodes the nodes to be printed 14197 * @param nodes the nodes to be printed
14235 * @param separator the separator to be printed between adjacent nodes 14198 * @param separator the separator to be printed between adjacent nodes
14236 */ 14199 */
14237 void visitList2(NodeList<AstNode> nodes, String separator) { 14200 void visitNodeListWithSeparator(NodeList<AstNode> nodes, String separator) {
14238 if (nodes != null) { 14201 if (nodes != null) {
14239 int size = nodes.length; 14202 int size = nodes.length;
14240 for (int i = 0; i < size; i++) { 14203 for (int i = 0; i < size; i++) {
14241 if (i > 0) { 14204 if (i > 0) {
14242 _writer.print(separator); 14205 _writer.print(separator);
14243 } 14206 }
14244 nodes[i].accept(this); 14207 nodes[i].accept(this);
14245 } 14208 }
14246 } 14209 }
14247 } 14210 }
14248 14211
14249 /** 14212 /**
14250 * Print a list of nodes, separated by the given separator. 14213 * Print a list of nodes, separated by the given separator.
14251 * 14214 *
14215 * @param prefix the prefix to be printed if the list is not empty
14252 * @param nodes the nodes to be printed 14216 * @param nodes the nodes to be printed
14253 * @param separator the separator to be printed between adjacent nodes 14217 * @param separator the separator to be printed between adjacent nodes
14254 * @param suffix the suffix to be printed if the list is not empty
14255 */ 14218 */
14256 void visitList3(NodeList<AstNode> nodes, String separator, String suffix) { 14219 void visitNodeListWithSeparatorAndPrefix(String prefix, NodeList<AstNode> node s, String separator) {
14257 if (nodes != null) { 14220 if (nodes != null) {
14258 int size = nodes.length; 14221 int size = nodes.length;
14259 if (size > 0) { 14222 if (size > 0) {
14223 _writer.print(prefix);
14260 for (int i = 0; i < size; i++) { 14224 for (int i = 0; i < size; i++) {
14261 if (i > 0) { 14225 if (i > 0) {
14262 _writer.print(separator); 14226 _writer.print(separator);
14263 } 14227 }
14264 nodes[i].accept(this); 14228 nodes[i].accept(this);
14265 } 14229 }
14266 _writer.print(suffix);
14267 } 14230 }
14268 } 14231 }
14269 } 14232 }
14270 14233
14271 /** 14234 /**
14272 * Print a list of nodes, separated by the given separator. 14235 * Print a list of nodes, separated by the given separator.
14273 * 14236 *
14274 * @param prefix the prefix to be printed if the list is not empty
14275 * @param nodes the nodes to be printed 14237 * @param nodes the nodes to be printed
14276 * @param separator the separator to be printed between adjacent nodes 14238 * @param separator the separator to be printed between adjacent nodes
14239 * @param suffix the suffix to be printed if the list is not empty
14277 */ 14240 */
14278 void visitList4(String prefix, NodeList<AstNode> nodes, String separator) { 14241 void visitNodeListWithSeparatorAndSuffix(NodeList<AstNode> nodes, String separ ator, String suffix) {
14279 if (nodes != null) { 14242 if (nodes != null) {
14280 int size = nodes.length; 14243 int size = nodes.length;
14281 if (size > 0) { 14244 if (size > 0) {
14282 _writer.print(prefix);
14283 for (int i = 0; i < size; i++) { 14245 for (int i = 0; i < size; i++) {
14284 if (i > 0) { 14246 if (i > 0) {
14285 _writer.print(separator); 14247 _writer.print(separator);
14286 } 14248 }
14287 nodes[i].accept(this); 14249 nodes[i].accept(this);
14288 } 14250 }
14251 _writer.print(suffix);
14289 } 14252 }
14290 } 14253 }
14291 } 14254 }
14255
14256 /**
14257 * Safely visit the given node, printing the prefix before the node if it is n on-`null`.
14258 *
14259 * @param prefix the prefix to be printed if there is a node to visit
14260 * @param node the node to be visited
14261 */
14262 void visitNodeWithPrefix(String prefix, AstNode node) {
14263 if (node != null) {
14264 _writer.print(prefix);
14265 node.accept(this);
14266 }
14267 }
14268
14269 /**
14270 * Safely visit the given node, printing the suffix after the node if it is no n-`null`.
14271 *
14272 * @param suffix the suffix to be printed if there is a node to visit
14273 * @param node the node to be visited
14274 */
14275 void visitNodeWithSuffix(AstNode node, String suffix) {
14276 if (node != null) {
14277 node.accept(this);
14278 _writer.print(suffix);
14279 }
14280 }
14281
14282 /**
14283 * Safely visit the given node, printing the suffix after the node if it is no n-`null`.
14284 *
14285 * @param suffix the suffix to be printed if there is a node to visit
14286 * @param node the node to be visited
14287 */
14288 void visitTokenWithSuffix(Token token, String suffix) {
14289 if (token != null) {
14290 _writer.print(token.lexeme);
14291 _writer.print(suffix);
14292 }
14293 }
14292 } 14294 }
14293 14295
14294 /** 14296 /**
14295 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil l recursively 14297 * Instances of the class `UnifyingAstVisitor` implement an AST visitor that wil l recursively
14296 * visit all of the nodes in an AST structure (like instances of the class 14298 * visit all of the nodes in an AST structure (like instances of the class
14297 * [RecursiveAstVisitor]). In addition, every node will also be visited by using a single 14299 * [RecursiveAstVisitor]). In addition, every node will also be visited by using a single
14298 * unified [visitNode] method. 14300 * unified [visitNode] method.
14299 * 14301 *
14300 * Subclasses that override a visit method must either invoke the overridden vis it method or 14302 * Subclasses that override a visit method must either invoke the overridden vis it method or
14301 * explicitly invoke the more general [visitNode] method. Failure to do so will 14303 * explicitly invoke the more general [visitNode] method. Failure to do so will
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
14513 14515
14514 R visitWithClause(WithClause node) => visitNode(node); 14516 R visitWithClause(WithClause node) => visitNode(node);
14515 } 14517 }
14516 14518
14517 /** 14519 /**
14518 * Instances of the class `AstCloner` implement an object that will clone any AS T structure 14520 * Instances of the class `AstCloner` implement an object that will clone any AS T structure
14519 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution 14521 * that it visits. The cloner will only clone the structure, it will not preserv e any resolution
14520 * results or properties associated with the nodes. 14522 * results or properties associated with the nodes.
14521 */ 14523 */
14522 class AstCloner implements AstVisitor<AstNode> { 14524 class AstCloner implements AstVisitor<AstNode> {
14523 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(clone3(node.strings)); 14525 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(cloneNodeList(node.strings));
14524 14526
14525 Annotation visitAnnotation(Annotation node) => new Annotation(node.atSign, clo ne2(node.name), node.period, clone2(node.constructorName), clone2(node.arguments )); 14527 Annotation visitAnnotation(Annotation node) => new Annotation(node.atSign, clo neNode(node.name), node.period, cloneNode(node.constructorName), cloneNode(node. arguments));
14526 14528
14527 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest(node.question, clone2(node.identifier)); 14529 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) => new ArgumentDefinitionTest(node.question, cloneNode(node.identifier));
14528 14530
14529 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(node.lef tParenthesis, clone3(node.arguments), node.rightParenthesis); 14531 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(node.lef tParenthesis, cloneNodeList(node.arguments), node.rightParenthesis);
14530 14532
14531 AsExpression visitAsExpression(AsExpression node) => new AsExpression(clone2(n ode.expression), node.asOperator, clone2(node.type)); 14533 AsExpression visitAsExpression(AsExpression node) => new AsExpression(cloneNod e(node.expression), node.asOperator, cloneNode(node.type));
14532 14534
14533 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node .keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, n ode.semicolon); 14535 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(node .keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis , node.semicolon);
14534 14536
14535 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression(clone2(node.leftHandSide), node.operator, clone2(node.ri ghtHandSide)); 14537 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => n ew AssignmentExpression(cloneNode(node.leftHandSide), node.operator, cloneNode(n ode.rightHandSide));
14536 14538
14537 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression(clone2(node.leftOperand), node.operator, clone2(node.rightOperand)); 14539 BinaryExpression visitBinaryExpression(BinaryExpression node) => new BinaryExp ression(cloneNode(node.leftOperand), node.operator, cloneNode(node.rightOperand) );
14538 14540
14539 Block visitBlock(Block node) => new Block(node.leftBracket, clone3(node.statem ents), node.rightBracket); 14541 Block visitBlock(Block node) => new Block(node.leftBracket, cloneNodeList(node .statements), node.rightBracket);
14540 14542
14541 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(clone2(node.block)); 14543 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(cloneNode(node.block));
14542 14544
14543 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral( node.literal, node.value); 14545 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => new BooleanLiteral( node.literal, node.value);
14544 14546
14545 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( node.keyword, clone2(node.label), node.semicolon); 14547 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( node.keyword, cloneNode(node.label), node.semicolon);
14546 14548
14547 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression(clone2(node.target), clone3(node.cascadeSections)); 14549 CascadeExpression visitCascadeExpression(CascadeExpression node) => new Cascad eExpression(cloneNode(node.target), cloneNodeList(node.cascadeSections));
14548 14550
14549 CatchClause visitCatchClause(CatchClause node) => new CatchClause(node.onKeywo rd, clone2(node.exceptionType), node.catchKeyword, node.leftParenthesis, clone2( node.exceptionParameter), node.comma, clone2(node.stackTraceParameter), node.rig htParenthesis, clone2(node.body)); 14551 CatchClause visitCatchClause(CatchClause node) => new CatchClause(node.onKeywo rd, cloneNode(node.exceptionType), node.catchKeyword, node.leftParenthesis, clon eNode(node.exceptionParameter), node.comma, cloneNode(node.stackTraceParameter), node.rightParenthesis, cloneNode(node.body));
14550 14552
14551 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 14553 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
14552 ClassDeclaration copy = new ClassDeclaration(clone2(node.documentationCommen t), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2(node. name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.with Clause), clone2(node.implementsClause), node.leftBracket, clone3(node.members), node.rightBracket); 14554 ClassDeclaration copy = new ClassDeclaration(cloneNode(node.documentationCom ment), cloneNodeList(node.metadata), node.abstractKeyword, node.classKeyword, cl oneNode(node.name), cloneNode(node.typeParameters), cloneNode(node.extendsClause ), cloneNode(node.withClause), cloneNode(node.implementsClause), node.leftBracke t, cloneNodeList(node.members), node.rightBracket);
14553 copy.nativeClause = clone2(node.nativeClause); 14555 copy.nativeClause = cloneNode(node.nativeClause);
14554 return copy; 14556 return copy;
14555 } 14557 }
14556 14558
14557 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(n ode.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone 2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node .semicolon); 14559 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.keyword , cloneNode(node.name), cloneNode(node.typeParameters), node.equals, node.abstra ctKeyword, cloneNode(node.superclass), cloneNode(node.withClause), cloneNode(nod e.implementsClause), node.semicolon);
14558 14560
14559 Comment visitComment(Comment node) { 14561 Comment visitComment(Comment node) {
14560 if (node.isDocumentation) { 14562 if (node.isDocumentation) {
14561 return Comment.createDocumentationComment2(node.tokens, clone3(node.refere nces)); 14563 return Comment.createDocumentationComment2(node.tokens, cloneNodeList(node .references));
14562 } else if (node.isBlock) { 14564 } else if (node.isBlock) {
14563 return Comment.createBlockComment(node.tokens); 14565 return Comment.createBlockComment(node.tokens);
14564 } 14566 }
14565 return Comment.createEndOfLineComment(node.tokens); 14567 return Comment.createEndOfLineComment(node.tokens);
14566 } 14568 }
14567 14569
14568 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(node.newKeyword, clone2(node.identifier)); 14570 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(node.newKeyword, cloneNode(node.identifier));
14569 14571
14570 CompilationUnit visitCompilationUnit(CompilationUnit node) { 14572 CompilationUnit visitCompilationUnit(CompilationUnit node) {
14571 CompilationUnit clone = new CompilationUnit(node.beginToken, clone2(node.scr iptTag), clone3(node.directives), clone3(node.declarations), node.endToken); 14573 CompilationUnit clone = new CompilationUnit(node.beginToken, cloneNode(node. scriptTag), cloneNodeList(node.directives), cloneNodeList(node.declarations), no de.endToken);
14572 clone.lineInfo = node.lineInfo; 14574 clone.lineInfo = node.lineInfo;
14573 return clone; 14575 return clone;
14574 } 14576 }
14575 14577
14576 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression(clone2(node.condition), node.question, clone2(node.t henExpression), node.colon, clone2(node.elseExpression)); 14578 ConditionalExpression visitConditionalExpression(ConditionalExpression node) = > new ConditionalExpression(cloneNode(node.condition), node.question, cloneNode( node.thenExpression), node.colon, cloneNode(node.elseExpression));
14577 14579
14578 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration(clone2(node.documentationComment), clone3(node.m etadata), node.externalKeyword, node.constKeyword, node.factoryKeyword, clone2(n ode.returnType), node.period, clone2(node.name), clone2(node.parameters), node.s eparator, clone3(node.initializers), clone2(node.redirectedConstructor), clone2( node.body)); 14580 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) => new ConstructorDeclaration(cloneNode(node.documentationComment), cloneNodeL ist(node.metadata), node.externalKeyword, node.constKeyword, node.factoryKeyword , cloneNode(node.returnType), node.period, cloneNode(node.name), cloneNode(node. parameters), node.separator, cloneNodeList(node.initializers), cloneNode(node.re directedConstructor), cloneNode(node.body));
14579 14581
14580 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(node.keyword, node.period, c lone2(node.fieldName), node.equals, clone2(node.expression)); 14582 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(node.keyword, node.period, c loneNode(node.fieldName), node.equals, cloneNode(node.expression));
14581 14583
14582 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame(clone2(node.type), node.period, clone2(node.name)); 14584 ConstructorName visitConstructorName(ConstructorName node) => new ConstructorN ame(cloneNode(node.type), node.period, cloneNode(node.name));
14583 14585
14584 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(node.keyword, clone2(node.label), node.semicolon); 14586 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(node.keyword, cloneNode(node.label), node.semicolon);
14585 14587
14586 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(clone2(node.documentationComment), clone3(node.metadata), node.k eyword, clone2(node.type), clone2(node.identifier)); 14588 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(cloneNode(node.documentationComment), cloneNodeList(node.metadat a), node.keyword, cloneNode(node.type), cloneNode(node.identifier));
14587 14589
14588 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(clone2(node.parameter), node.kind, node.separato r, clone2(node.defaultValue)); 14590 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(cloneNode(node.parameter), node.kind, node.separ ator, cloneNode(node.defaultValue));
14589 14591
14590 DoStatement visitDoStatement(DoStatement node) => new DoStatement(node.doKeywo rd, clone2(node.body), node.whileKeyword, node.leftParenthesis, clone2(node.cond ition), node.rightParenthesis, node.semicolon); 14592 DoStatement visitDoStatement(DoStatement node) => new DoStatement(node.doKeywo rd, cloneNode(node.body), node.whileKeyword, node.leftParenthesis, cloneNode(nod e.condition), node.rightParenthesis, node.semicolon);
14591 14593
14592 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral(node .literal, node.value); 14594 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => new DoubleLiteral(node .literal, node.value);
14593 14595
14594 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(node.semicolon); 14596 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(node.semicolon);
14595 14597
14596 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( node.semicolon); 14598 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( node.semicolon);
14597 14599
14598 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clon e2(node.uri), clone3(node.combinators), node.semicolon); 14600 ExportDirective visitExportDirective(ExportDirective node) => new ExportDirect ive(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.key word, cloneNode(node.uri), cloneNodeList(node.combinators), node.semicolon);
14599 14601
14600 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(node.functionDefinition, clone2(node.expression) , node.semicolon); 14602 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(node.functionDefinition, cloneNode(node.expressi on), node.semicolon);
14601 14603
14602 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(clone2(node.expression), node.semicolon); 14604 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(cloneNode(node.expression), node.semicolon);
14603 14605
14604 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node .keyword, clone2(node.superclass)); 14606 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(node .keyword, cloneNode(node.superclass));
14605 14607
14606 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(clone2(node.documentationComment), clone3(node.metadata), node.staticKey word, clone2(node.fields), node.semicolon); 14608 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node .staticKeyword, cloneNode(node.fields), node.semicolon);
14607 14609
14608 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(clone2(node.documentationComment), clone3(node.metadata) , node.keyword, clone2(node.type), node.thisToken, node.period, clone2(node.iden tifier), clone2(node.parameters)); 14610 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(cloneNode(node.documentationComment), cloneNodeList(node .metadata), node.keyword, cloneNode(node.type), node.thisToken, node.period, clo neNode(node.identifier), cloneNode(node.parameters));
14609 14611
14610 ForEachStatement visitForEachStatement(ForEachStatement node) { 14612 ForEachStatement visitForEachStatement(ForEachStatement node) {
14611 DeclaredIdentifier loopVariable = node.loopVariable; 14613 DeclaredIdentifier loopVariable = node.loopVariable;
14612 if (loopVariable == null) { 14614 if (loopVariable == null) {
14613 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, cl one2(node.identifier), node.inKeyword, clone2(node.iterator), node.rightParenthe sis, clone2(node.body)); 14615 return new ForEachStatement.con2(node.forKeyword, node.leftParenthesis, cl oneNode(node.identifier), node.inKeyword, cloneNode(node.iterator), node.rightPa renthesis, cloneNode(node.body));
14614 } 14616 }
14615 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, clon e2(loopVariable), node.inKeyword, clone2(node.iterator), node.rightParenthesis, clone2(node.body)); 14617 return new ForEachStatement.con1(node.forKeyword, node.leftParenthesis, clon eNode(loopVariable), node.inKeyword, cloneNode(node.iterator), node.rightParenth esis, cloneNode(node.body));
14616 } 14618 }
14617 14619
14618 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(node.leftParenthesis, clone3(node.parameters), node.leftDeli miter, node.rightDelimiter, node.rightParenthesis); 14620 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(node.leftParenthesis, cloneNodeList(node.parameters), node.l eftDelimiter, node.rightDelimiter, node.rightParenthesis);
14619 14621
14620 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for Keyword, node.leftParenthesis, clone2(node.variables), clone2(node.initializatio n), node.leftSeparator, clone2(node.condition), node.rightSeparator, clone3(node .updaters), node.rightParenthesis, clone2(node.body)); 14622 ForStatement visitForStatement(ForStatement node) => new ForStatement(node.for Keyword, node.leftParenthesis, cloneNode(node.variables), cloneNode(node.initial ization), node.leftSeparator, cloneNode(node.condition), node.rightSeparator, cl oneNodeList(node.updaters), node.rightParenthesis, cloneNode(node.body));
14621 14623
14622 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(clone2(node.documentationComment), clone3(node.metadata), no de.externalKeyword, clone2(node.returnType), node.propertyKeyword, clone2(node.n ame), clone2(node.functionExpression)); 14624 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(cloneNode(node.documentationComment), cloneNodeList(node.met adata), node.externalKeyword, cloneNode(node.returnType), node.propertyKeyword, cloneNode(node.name), cloneNode(node.functionExpression));
14623 14625
14624 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(clone2(node.functionDecl aration)); 14626 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(cloneNode(node.functionD eclaration));
14625 14627
14626 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression(clone2(node.parameters), clone2(node.body)); 14628 FunctionExpression visitFunctionExpression(FunctionExpression node) => new Fun ctionExpression(cloneNode(node.parameters), cloneNode(node.body));
14627 14629
14628 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation(clone2(node.function), c lone2(node.argumentList)); 14630 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) => new FunctionExpressionInvocation(cloneNode(node.function) , cloneNode(node.argumentList));
14629 14631
14630 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(clone2(node.documentationComment), clone3(node.metadata), node.keywo rd, clone2(node.returnType), clone2(node.name), clone2(node.typeParameters), clo ne2(node.parameters), node.semicolon); 14632 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.keyword, cloneNode(node.returnType), cloneNode(node.name), cloneNode(node.t ypeParameters), cloneNode(node.parameters), node.semicolon);
14631 14633
14632 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(clone2(node.documentatio nComment), clone3(node.metadata), clone2(node.returnType), clone2(node.identifie r), clone2(node.parameters)); 14634 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(cloneNode(node.documenta tionComment), cloneNodeList(node.metadata), cloneNode(node.returnType), cloneNod e(node.identifier), cloneNode(node.parameters));
14633 14635
14634 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( node.keyword, clone3(node.hiddenNames)); 14636 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( node.keyword, cloneNodeList(node.hiddenNames));
14635 14637
14636 IfStatement visitIfStatement(IfStatement node) => new IfStatement(node.ifKeywo rd, node.leftParenthesis, clone2(node.condition), node.rightParenthesis, clone2( node.thenStatement), node.elseKeyword, clone2(node.elseStatement)); 14638 IfStatement visitIfStatement(IfStatement node) => new IfStatement(node.ifKeywo rd, node.leftParenthesis, cloneNode(node.condition), node.rightParenthesis, clon eNode(node.thenStatement), node.elseKeyword, cloneNode(node.elseStatement));
14637 14639
14638 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(node.keyword, clone3(node.interfaces)); 14640 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(node.keyword, cloneNodeList(node.interfaces));
14639 14641
14640 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clon e2(node.uri), node.asToken, clone2(node.prefix), clone3(node.combinators), node. semicolon); 14642 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.key word, cloneNode(node.uri), node.asToken, cloneNode(node.prefix), cloneNodeList(n ode.combinators), node.semicolon);
14641 14643
14642 IndexExpression visitIndexExpression(IndexExpression node) { 14644 IndexExpression visitIndexExpression(IndexExpression node) {
14643 Token period = node.period; 14645 Token period = node.period;
14644 if (period == null) { 14646 if (period == null) {
14645 return new IndexExpression.forTarget(clone2(node.target), node.leftBracket , clone2(node.index), node.rightBracket); 14647 return new IndexExpression.forTarget(cloneNode(node.target), node.leftBrac ket, cloneNode(node.index), node.rightBracket);
14646 } else { 14648 } else {
14647 return new IndexExpression.forCascade(period, node.leftBracket, clone2(nod e.index), node.rightBracket); 14649 return new IndexExpression.forCascade(period, node.leftBracket, cloneNode( node.index), node.rightBracket);
14648 } 14650 }
14649 } 14651 }
14650 14652
14651 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression(node.keyword, clone2(node.constr uctorName), clone2(node.argumentList)); 14653 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) => new InstanceCreationExpression(node.keyword, cloneNode(node.con structorName), cloneNode(node.argumentList));
14652 14654
14653 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral( node.literal, node.value); 14655 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => new IntegerLiteral( node.literal, node.value);
14654 14656
14655 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(node.leftBracket, clone2(node.expression), n ode.rightBracket); 14657 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(node.leftBracket, cloneNode(node.expression) , node.rightBracket);
14656 14658
14657 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(node.contents, node.value); 14659 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(node.contents, node.value);
14658 14660
14659 IsExpression visitIsExpression(IsExpression node) => new IsExpression(clone2(n ode.expression), node.isOperator, node.notOperator, clone2(node.type)); 14661 IsExpression visitIsExpression(IsExpression node) => new IsExpression(cloneNod e(node.expression), node.isOperator, node.notOperator, cloneNode(node.type));
14660 14662
14661 Label visitLabel(Label node) => new Label(clone2(node.label), node.colon); 14663 Label visitLabel(Label node) => new Label(cloneNode(node.label), node.colon);
14662 14664
14663 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(clone3(node.labels), clone2(node.statement)); 14665 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(cloneNodeList(node.labels), cloneNode(node.statement));
14664 14666
14665 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(clone2(node.documentationComment), clone3(node.metadata), node.libraryTo ken, clone2(node.name), node.semicolon); 14667 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node .libraryToken, cloneNode(node.name), node.semicolon);
14666 14668
14667 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier(clone3(node.components)); 14669 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => new Librar yIdentifier(cloneNodeList(node.components));
14668 14670
14669 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(node.constKe yword, clone2(node.typeArguments), node.leftBracket, clone3(node.elements), node .rightBracket); 14671 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(node.constKe yword, cloneNode(node.typeArguments), node.leftBracket, cloneNodeList(node.eleme nts), node.rightBracket);
14670 14672
14671 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(node.constKeywor d, clone2(node.typeArguments), node.leftBracket, clone3(node.entries), node.righ tBracket); 14673 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(node.constKeywor d, cloneNode(node.typeArguments), node.leftBracket, cloneNodeList(node.entries), node.rightBracket);
14672 14674
14673 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(clone2(node.key), node.separator, clone2(node.value)); 14675 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(cloneNode(node.key), node.separator, cloneNode(node.value));
14674 14676
14675 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(clone2(node.documentationComment), clone3(node.metadata), node.exter nalKeyword, node.modifierKeyword, clone2(node.returnType), node.propertyKeyword, node.operatorKeyword, clone2(node.name), clone2(node.parameters), clone2(node.b ody)); 14677 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.externalKeyword, node.modifierKeyword, cloneNode(node.returnType), node.pro pertyKeyword, node.operatorKeyword, cloneNode(node.name), cloneNode(node.paramet ers), cloneNode(node.body));
14676 14678
14677 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation(clone2(node.target), node.period, clone2(node.methodName), clone2(node.a rgumentList)); 14679 MethodInvocation visitMethodInvocation(MethodInvocation node) => new MethodInv ocation(cloneNode(node.target), node.period, cloneNode(node.methodName), cloneNo de(node.argumentList));
14678 14680
14679 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion(clone2(node.name), clone2(node.expression)); 14681 NamedExpression visitNamedExpression(NamedExpression node) => new NamedExpress ion(cloneNode(node.name), cloneNode(node.expression));
14680 14682
14681 AstNode visitNativeClause(NativeClause node) => new NativeClause(node.keyword, clone2(node.name)); 14683 AstNode visitNativeClause(NativeClause node) => new NativeClause(node.keyword, cloneNode(node.name));
14682 14684
14683 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(node.nativeToken, clone2(node.stringLiteral), node.semicolon); 14685 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(node.nativeToken, cloneNode(node.stringLiteral), node.semicolon) ;
14684 14686
14685 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral(node.literal ); 14687 NullLiteral visitNullLiteral(NullLiteral node) => new NullLiteral(node.literal );
14686 14688
14687 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression(node.leftParenthesis, clone2(node.expression ), node.rightParenthesis); 14689 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) => new ParenthesizedExpression(node.leftParenthesis, cloneNode(node.express ion), node.rightParenthesis);
14688 14690
14689 PartDirective visitPartDirective(PartDirective node) => new PartDirective(clon e2(node.documentationComment), clone3(node.metadata), node.partToken, clone2(nod e.uri), node.semicolon); 14691 PartDirective visitPartDirective(PartDirective node) => new PartDirective(clon eNode(node.documentationComment), cloneNodeList(node.metadata), node.partToken, cloneNode(node.uri), node.semicolon);
14690 14692
14691 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive(clone2(node.documentationComment), clone3(node.metadata), node.partToken, no de.ofToken, clone2(node.libraryName), node.semicolon); 14693 PartOfDirective visitPartOfDirective(PartOfDirective node) => new PartOfDirect ive(cloneNode(node.documentationComment), cloneNodeList(node.metadata), node.par tToken, node.ofToken, cloneNode(node.libraryName), node.semicolon);
14692 14694
14693 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression(clone2(node.operand), node.operator); 14695 PostfixExpression visitPostfixExpression(PostfixExpression node) => new Postfi xExpression(cloneNode(node.operand), node.operator);
14694 14696
14695 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier(clone2(node.prefix), node.period, clone2(node.identifier)); 14697 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => new Pre fixedIdentifier(cloneNode(node.prefix), node.period, cloneNode(node.identifier)) ;
14696 14698
14697 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression(node.operator, clone2(node.operand)); 14699 PrefixExpression visitPrefixExpression(PrefixExpression node) => new PrefixExp ression(node.operator, cloneNode(node.operand));
14698 14700
14699 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( clone2(node.target), node.operator, clone2(node.propertyName)); 14701 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( cloneNode(node.target), node.operator, cloneNode(node.propertyName));
14700 14702
14701 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation(node.key word, node.period, clone2(node.constructorName), clone2(node.argumentList)); 14703 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) => new RedirectingConstructorInvocation(node.key word, node.period, cloneNode(node.constructorName), cloneNode(node.argumentList) );
14702 14704
14703 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression(node.keyword); 14705 RethrowExpression visitRethrowExpression(RethrowExpression node) => new Rethro wExpression(node.keyword);
14704 14706
14705 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(node.keyword, clone2(node.expression), node.semicolon); 14707 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(node.keyword, cloneNode(node.expression), node.semicolon);
14706 14708
14707 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(node.scriptTag); 14709 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(node.scriptTag);
14708 14710
14709 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( node.keyword, clone3(node.shownNames)); 14711 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( node.keyword, cloneNodeList(node.shownNames));
14710 14712
14711 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(clone2(node.documentationComment), clone3(node.metad ata), node.keyword, clone2(node.type), clone2(node.identifier)); 14713 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(cloneNode(node.documentationComment), cloneNodeList( node.metadata), node.keyword, cloneNode(node.type), cloneNode(node.identifier));
14712 14714
14713 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier(node.token); 14715 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => new SimpleIde ntifier(node.token);
14714 14716
14715 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral(node.literal, node.value); 14717 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => new SimpleStringLiteral(node.literal, node.value);
14716 14718
14717 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation(clone3(node.elements)); 14719 StringInterpolation visitStringInterpolation(StringInterpolation node) => new StringInterpolation(cloneNodeList(node.elements));
14718 14720
14719 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation(node.keyword, node.period, clone 2(node.constructorName), clone2(node.argumentList)); 14721 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) => new SuperConstructorInvocation(node.keyword, node.period, clone Node(node.constructorName), cloneNode(node.argumentList));
14720 14722
14721 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion(node.keyword); 14723 SuperExpression visitSuperExpression(SuperExpression node) => new SuperExpress ion(node.keyword);
14722 14724
14723 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(clone3(node.labe ls), node.keyword, clone2(node.expression), node.colon, clone3(node.statements)) ; 14725 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(cloneNodeList(no de.labels), node.keyword, cloneNode(node.expression), node.colon, cloneNodeList( node.statements));
14724 14726
14725 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon e3(node.labels), node.keyword, node.colon, clone3(node.statements)); 14727 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon eNodeList(node.labels), node.keyword, node.colon, cloneNodeList(node.statements) );
14726 14728
14727 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(node.keyword, node.leftParenthesis, clone2(node.expression), node.rightParen thesis, node.leftBracket, clone3(node.members), node.rightBracket); 14729 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(node.keyword, node.leftParenthesis, cloneNode(node.expression), node.rightPa renthesis, node.leftBracket, cloneNodeList(node.members), node.rightBracket);
14728 14730
14729 AstNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(node.pound Sign, node.components); 14731 AstNode visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(node.pound Sign, node.components);
14730 14732
14731 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression( node.keyword); 14733 ThisExpression visitThisExpression(ThisExpression node) => new ThisExpression( node.keyword);
14732 14734
14733 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion(node.keyword, clone2(node.expression)); 14735 ThrowExpression visitThrowExpression(ThrowExpression node) => new ThrowExpress ion(node.keyword, cloneNode(node.expression));
14734 14736
14735 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(clone2(node.documentationCom ment), clone3(node.metadata), clone2(node.variables), node.semicolon); 14737 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(cloneNode(node.documentation Comment), cloneNodeList(node.metadata), cloneNode(node.variables), node.semicolo n);
14736 14738
14737 TryStatement visitTryStatement(TryStatement node) => new TryStatement(node.try Keyword, clone2(node.body), clone3(node.catchClauses), node.finallyKeyword, clon e2(node.finallyBlock)); 14739 TryStatement visitTryStatement(TryStatement node) => new TryStatement(node.try Keyword, cloneNode(node.body), cloneNodeList(node.catchClauses), node.finallyKey word, cloneNode(node.finallyBlock));
14738 14740
14739 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(node.leftBracket, clone3(node.arguments), node.rightBracket); 14741 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(node.leftBracket, cloneNodeList(node.arguments), node.rightBracket);
14740 14742
14741 TypeName visitTypeName(TypeName node) => new TypeName(clone2(node.name), clone 2(node.typeArguments)); 14743 TypeName visitTypeName(TypeName node) => new TypeName(cloneNode(node.name), cl oneNode(node.typeArguments));
14742 14744
14743 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon e2(node.documentationComment), clone3(node.metadata), clone2(node.name), node.ke yword, clone2(node.bound)); 14745 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon eNode(node.documentationComment), cloneNodeList(node.metadata), cloneNode(node.n ame), node.keyword, cloneNode(node.bound));
14744 14746
14745 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(node.leftBracket, clone3(node.typeParameters), node.rightBracket); 14747 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(node.leftBracket, cloneNodeList(node.typeParameters), node.rightBrac ket);
14746 14748
14747 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, clone3(node.metadata), clone2(node.name), node.equals, clone2(node.initializer)); 14749 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, cloneNodeList(node.metadata), cloneNode(node.name), no de.equals, cloneNode(node.initializer));
14748 14750
14749 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, clone3(node.metadata), node.keyword, c lone2(node.type), clone3(node.variables)); 14751 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, cloneNodeList(node.metadata), node.key word, cloneNode(node.type), cloneNodeList(node.variables));
14750 14752
14751 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(clone2(node.variables), node.semicolon); 14753 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(cloneNode(node.variables ), node.semicolon);
14752 14754
14753 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( node.keyword, node.leftParenthesis, clone2(node.condition), node.rightParenthesi s, clone2(node.body)); 14755 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( node.keyword, node.leftParenthesis, cloneNode(node.condition), node.rightParenth esis, cloneNode(node.body));
14754 14756
14755 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword , clone3(node.mixinTypes)); 14757 WithClause visitWithClause(WithClause node) => new WithClause(node.withKeyword , cloneNodeList(node.mixinTypes));
14756 14758
14757 AstNode clone2(AstNode node) { 14759 AstNode cloneNode(AstNode node) {
14758 if (node == null) { 14760 if (node == null) {
14759 return null; 14761 return null;
14760 } 14762 }
14761 return node.accept(this) as AstNode; 14763 return node.accept(this) as AstNode;
14762 } 14764 }
14763 14765
14764 List clone3(NodeList nodes) { 14766 List cloneNodeList(NodeList nodes) {
14765 int count = nodes.length; 14767 int count = nodes.length;
14766 List clonedNodes = new List(); 14768 List clonedNodes = new List();
14767 for (int i = 0; i < count; i++) { 14769 for (int i = 0; i < count; i++) {
14768 clonedNodes.add((nodes[i]).accept(this) as AstNode); 14770 clonedNodes.add((nodes[i]).accept(this) as AstNode);
14769 } 14771 }
14770 return clonedNodes; 14772 return clonedNodes;
14771 } 14773 }
14772 } 14774 }
14773 14775
14774 /** 14776 /**
14775 * Instances of the class `AstComparator` compare the structure of two ASTNodes to see whether 14777 * Instances of the class `AstComparator` compare the structure of two ASTNodes to see whether
14776 * they are equal. 14778 * they are equal.
14777 */ 14779 */
14778 class AstComparator implements AstVisitor<bool> { 14780 class AstComparator implements AstVisitor<bool> {
14779 /** 14781 /**
14780 * Return `true` if the two AST nodes are equal. 14782 * Return `true` if the two AST nodes are equal.
14781 * 14783 *
14782 * @param first the first node being compared 14784 * @param first the first node being compared
14783 * @param second the second node being compared 14785 * @param second the second node being compared
14784 * @return `true` if the two AST nodes are equal 14786 * @return `true` if the two AST nodes are equal
14785 */ 14787 */
14786 static bool equals4(CompilationUnit first, CompilationUnit second) { 14788 static bool equals4(CompilationUnit first, CompilationUnit second) {
14787 AstComparator comparator = new AstComparator(); 14789 AstComparator comparator = new AstComparator();
14788 return comparator.isEqual(first, second); 14790 return comparator.isEqualNodes(first, second);
14789 } 14791 }
14790 14792
14791 /** 14793 /**
14792 * The AST node with which the node being visited is to be compared. This is o nly valid at the 14794 * The AST node with which the node being visited is to be compared. This is o nly valid at the
14793 * beginning of each visit method (until [isEqual] is invoked). 14795 * beginning of each visit method (until [isEqualNodes] is invoked).
14794 */ 14796 */
14795 AstNode _other; 14797 AstNode _other;
14796 14798
14797 bool visitAdjacentStrings(AdjacentStrings node) { 14799 bool visitAdjacentStrings(AdjacentStrings node) {
14798 AdjacentStrings other = this._other as AdjacentStrings; 14800 AdjacentStrings other = this._other as AdjacentStrings;
14799 return isEqual5(node.strings, other.strings); 14801 return isEqualNodeLists(node.strings, other.strings);
14800 } 14802 }
14801 14803
14802 bool visitAnnotation(Annotation node) { 14804 bool visitAnnotation(Annotation node) {
14803 Annotation other = this._other as Annotation; 14805 Annotation other = this._other as Annotation;
14804 return isEqual6(node.atSign, other.atSign) && isEqual(node.name, other.name) && isEqual6(node.period, other.period) && isEqual(node.constructorName, other.c onstructorName) && isEqual(node.arguments, other.arguments); 14806 return isEqualTokens(node.atSign, other.atSign) && isEqualNodes(node.name, o ther.name) && isEqualTokens(node.period, other.period) && isEqualNodes(node.cons tructorName, other.constructorName) && isEqualNodes(node.arguments, other.argume nts);
14805 } 14807 }
14806 14808
14807 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) { 14809 bool visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
14808 ArgumentDefinitionTest other = this._other as ArgumentDefinitionTest; 14810 ArgumentDefinitionTest other = this._other as ArgumentDefinitionTest;
14809 return isEqual6(node.question, other.question) && isEqual(node.identifier, o ther.identifier); 14811 return isEqualTokens(node.question, other.question) && isEqualNodes(node.ide ntifier, other.identifier);
14810 } 14812 }
14811 14813
14812 bool visitArgumentList(ArgumentList node) { 14814 bool visitArgumentList(ArgumentList node) {
14813 ArgumentList other = this._other as ArgumentList; 14815 ArgumentList other = this._other as ArgumentList;
14814 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.arguments, other.arguments) && isEqual6(node.rightParenthesis, other.rightPare nthesis); 14816 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqual NodeLists(node.arguments, other.arguments) && isEqualTokens(node.rightParenthesi s, other.rightParenthesis);
14815 } 14817 }
14816 14818
14817 bool visitAsExpression(AsExpression node) { 14819 bool visitAsExpression(AsExpression node) {
14818 AsExpression other = this._other as AsExpression; 14820 AsExpression other = this._other as AsExpression;
14819 return isEqual(node.expression, other.expression) && isEqual6(node.asOperato r, other.asOperator) && isEqual(node.type, other.type); 14821 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .asOperator, other.asOperator) && isEqualNodes(node.type, other.type);
14820 } 14822 }
14821 14823
14822 bool visitAssertStatement(AssertStatement node) { 14824 bool visitAssertStatement(AssertStatement node) {
14823 AssertStatement other = this._other as AssertStatement; 14825 AssertStatement other = this._other as AssertStatement;
14824 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semicolon, oth er.semicolon); 14826 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualT okens(node.semicolon, other.semicolon);
14825 } 14827 }
14826 14828
14827 bool visitAssignmentExpression(AssignmentExpression node) { 14829 bool visitAssignmentExpression(AssignmentExpression node) {
14828 AssignmentExpression other = this._other as AssignmentExpression; 14830 AssignmentExpression other = this._other as AssignmentExpression;
14829 return isEqual(node.leftHandSide, other.leftHandSide) && isEqual6(node.opera tor, other.operator) && isEqual(node.rightHandSide, other.rightHandSide); 14831 return isEqualNodes(node.leftHandSide, other.leftHandSide) && isEqualTokens( node.operator, other.operator) && isEqualNodes(node.rightHandSide, other.rightHa ndSide);
14830 } 14832 }
14831 14833
14832 bool visitBinaryExpression(BinaryExpression node) { 14834 bool visitBinaryExpression(BinaryExpression node) {
14833 BinaryExpression other = this._other as BinaryExpression; 14835 BinaryExpression other = this._other as BinaryExpression;
14834 return isEqual(node.leftOperand, other.leftOperand) && isEqual6(node.operato r, other.operator) && isEqual(node.rightOperand, other.rightOperand); 14836 return isEqualNodes(node.leftOperand, other.leftOperand) && isEqualTokens(no de.operator, other.operator) && isEqualNodes(node.rightOperand, other.rightOpera nd);
14835 } 14837 }
14836 14838
14837 bool visitBlock(Block node) { 14839 bool visitBlock(Block node) {
14838 Block other = this._other as Block; 14840 Block other = this._other as Block;
14839 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.statem ents, other.statements) && isEqual6(node.rightBracket, other.rightBracket); 14841 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodeList s(node.statements, other.statements) && isEqualTokens(node.rightBracket, other.r ightBracket);
14840 } 14842 }
14841 14843
14842 bool visitBlockFunctionBody(BlockFunctionBody node) { 14844 bool visitBlockFunctionBody(BlockFunctionBody node) {
14843 BlockFunctionBody other = this._other as BlockFunctionBody; 14845 BlockFunctionBody other = this._other as BlockFunctionBody;
14844 return isEqual(node.block, other.block); 14846 return isEqualNodes(node.block, other.block);
14845 } 14847 }
14846 14848
14847 bool visitBooleanLiteral(BooleanLiteral node) { 14849 bool visitBooleanLiteral(BooleanLiteral node) {
14848 BooleanLiteral other = this._other as BooleanLiteral; 14850 BooleanLiteral other = this._other as BooleanLiteral;
14849 return isEqual6(node.literal, other.literal) && identical(node.value, other. value); 14851 return isEqualTokens(node.literal, other.literal) && identical(node.value, o ther.value);
14850 } 14852 }
14851 14853
14852 bool visitBreakStatement(BreakStatement node) { 14854 bool visitBreakStatement(BreakStatement node) {
14853 BreakStatement other = this._other as BreakStatement; 14855 BreakStatement other = this._other as BreakStatement;
14854 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon); 14856 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon);
14855 } 14857 }
14856 14858
14857 bool visitCascadeExpression(CascadeExpression node) { 14859 bool visitCascadeExpression(CascadeExpression node) {
14858 CascadeExpression other = this._other as CascadeExpression; 14860 CascadeExpression other = this._other as CascadeExpression;
14859 return isEqual(node.target, other.target) && isEqual5(node.cascadeSections, other.cascadeSections); 14861 return isEqualNodes(node.target, other.target) && isEqualNodeLists(node.casc adeSections, other.cascadeSections);
14860 } 14862 }
14861 14863
14862 bool visitCatchClause(CatchClause node) { 14864 bool visitCatchClause(CatchClause node) {
14863 CatchClause other = this._other as CatchClause; 14865 CatchClause other = this._other as CatchClause;
14864 return isEqual6(node.onKeyword, other.onKeyword) && isEqual(node.exceptionTy pe, other.exceptionType) && isEqual6(node.catchKeyword, other.catchKeyword) && i sEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node.exceptionPa rameter, other.exceptionParameter) && isEqual6(node.comma, other.comma) && isEqu al(node.stackTraceParameter, other.stackTraceParameter) && isEqual6(node.rightPa renthesis, other.rightParenthesis) && isEqual(node.body, other.body); 14866 return isEqualTokens(node.onKeyword, other.onKeyword) && isEqualNodes(node.e xceptionType, other.exceptionType) && isEqualTokens(node.catchKeyword, other.cat chKeyword) && isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEq ualNodes(node.exceptionParameter, other.exceptionParameter) && isEqualTokens(nod e.comma, other.comma) && isEqualNodes(node.stackTraceParameter, other.stackTrace Parameter) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && is EqualNodes(node.body, other.body);
14865 } 14867 }
14866 14868
14867 bool visitClassDeclaration(ClassDeclaration node) { 14869 bool visitClassDeclaration(ClassDeclaration node) {
14868 ClassDeclaration other = this._other as ClassDeclaration; 14870 ClassDeclaration other = this._other as ClassDeclaration;
14869 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.abstractKeyword, other.abs tractKeyword) && isEqual6(node.classKeyword, other.classKeyword) && isEqual(node .name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEq ual(node.extendsClause, other.extendsClause) && isEqual(node.withClause, other.w ithClause) && isEqual(node.implementsClause, other.implementsClause) && isEqual6 (node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) & & isEqual6(node.rightBracket, other.rightBracket); 14871 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.abstract Keyword, other.abstractKeyword) && isEqualTokens(node.classKeyword, other.classK eyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.typeParamete rs, other.typeParameters) && isEqualNodes(node.extendsClause, other.extendsClaus e) && isEqualNodes(node.withClause, other.withClause) && isEqualNodes(node.imple mentsClause, other.implementsClause) && isEqualTokens(node.leftBracket, other.le ftBracket) && isEqualNodeLists(node.members, other.members) && isEqualTokens(nod e.rightBracket, other.rightBracket);
14870 } 14872 }
14871 14873
14872 bool visitClassTypeAlias(ClassTypeAlias node) { 14874 bool visitClassTypeAlias(ClassTypeAlias node) {
14873 ClassTypeAlias other = this._other as ClassTypeAlias; 14875 ClassTypeAlias other = this._other as ClassTypeAlias;
14874 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParame ters) && isEqual6(node.equals, other.equals) && isEqual6(node.abstractKeyword, o ther.abstractKeyword) && isEqual(node.superclass, other.superclass) && isEqual(n ode.withClause, other.withClause) && isEqual(node.implementsClause, other.implem entsClause) && isEqual6(node.semicolon, other.semicolon); 14876 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name) && isEqualNodes(node.type Parameters, 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) && isEqualToken s(node.semicolon, other.semicolon);
14875 } 14877 }
14876 14878
14877 bool visitComment(Comment node) { 14879 bool visitComment(Comment node) {
14878 Comment other = this._other as Comment; 14880 Comment other = this._other as Comment;
14879 return isEqual5(node.references, other.references); 14881 return isEqualNodeLists(node.references, other.references);
14880 } 14882 }
14881 14883
14882 bool visitCommentReference(CommentReference node) { 14884 bool visitCommentReference(CommentReference node) {
14883 CommentReference other = this._other as CommentReference; 14885 CommentReference other = this._other as CommentReference;
14884 return isEqual6(node.newKeyword, other.newKeyword) && isEqual(node.identifie r, other.identifier); 14886 return isEqualTokens(node.newKeyword, other.newKeyword) && isEqualNodes(node .identifier, other.identifier);
14885 } 14887 }
14886 14888
14887 bool visitCompilationUnit(CompilationUnit node) { 14889 bool visitCompilationUnit(CompilationUnit node) {
14888 CompilationUnit other = this._other as CompilationUnit; 14890 CompilationUnit other = this._other as CompilationUnit;
14889 return isEqual6(node.beginToken, other.beginToken) && isEqual(node.scriptTag , other.scriptTag) && isEqual5(node.directives, other.directives) && isEqual5(no de.declarations, other.declarations) && isEqual6(node.endToken, other.endToken); 14891 return isEqualTokens(node.beginToken, other.beginToken) && isEqualNodes(node .scriptTag, other.scriptTag) && isEqualNodeLists(node.directives, other.directiv es) && isEqualNodeLists(node.declarations, other.declarations) && isEqualTokens( node.endToken, other.endToken);
14890 } 14892 }
14891 14893
14892 bool visitConditionalExpression(ConditionalExpression node) { 14894 bool visitConditionalExpression(ConditionalExpression node) {
14893 ConditionalExpression other = this._other as ConditionalExpression; 14895 ConditionalExpression other = this._other as ConditionalExpression;
14894 return isEqual(node.condition, other.condition) && isEqual6(node.question, o ther.question) && isEqual(node.thenExpression, other.thenExpression) && isEqual6 (node.colon, other.colon) && isEqual(node.elseExpression, other.elseExpression); 14896 return isEqualNodes(node.condition, other.condition) && isEqualTokens(node.q uestion, other.question) && isEqualNodes(node.thenExpression, other.thenExpressi on) && isEqualTokens(node.colon, other.colon) && isEqualNodes(node.elseExpressio n, other.elseExpression);
14895 } 14897 }
14896 14898
14897 bool visitConstructorDeclaration(ConstructorDeclaration node) { 14899 bool visitConstructorDeclaration(ConstructorDeclaration node) {
14898 ConstructorDeclaration other = this._other as ConstructorDeclaration; 14900 ConstructorDeclaration other = this._other as ConstructorDeclaration;
14899 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.constKeyword, other.constKeyword) && isEqual6(nod e.factoryKeyword, other.factoryKeyword) && isEqual(node.returnType, other.return Type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name) & & isEqual(node.parameters, other.parameters) && isEqual6(node.separator, other.s eparator) && isEqual5(node.initializers, other.initializers) && isEqual(node.red irectedConstructor, other.redirectedConstructor) && isEqual(node.body, other.bod y); 14901 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.external Keyword, other.externalKeyword) && isEqualTokens(node.constKeyword, other.constK eyword) && isEqualTokens(node.factoryKeyword, other.factoryKeyword) && isEqualNo des(node.returnType, other.returnType) && isEqualTokens(node.period, other.perio d) && isEqualNodes(node.name, other.name) && isEqualNodes(node.parameters, other .parameters) && isEqualTokens(node.separator, other.separator) && isEqualNodeLis ts(node.initializers, other.initializers) && isEqualNodes(node.redirectedConstru ctor, other.redirectedConstructor) && isEqualNodes(node.body, other.body);
14900 } 14902 }
14901 14903
14902 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) { 14904 bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
14903 ConstructorFieldInitializer other = this._other as ConstructorFieldInitializ er; 14905 ConstructorFieldInitializer other = this._other as ConstructorFieldInitializ er;
14904 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.fieldName, other.fieldName) && isEqual6(node.equals, oth er.equals) && isEqual(node.expression, other.expression); 14906 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.fieldName, other.fieldName) && isEqualTok ens(node.equals, other.equals) && isEqualNodes(node.expression, other.expression );
14905 } 14907 }
14906 14908
14907 bool visitConstructorName(ConstructorName node) { 14909 bool visitConstructorName(ConstructorName node) {
14908 ConstructorName other = this._other as ConstructorName; 14910 ConstructorName other = this._other as ConstructorName;
14909 return isEqual(node.type, other.type) && isEqual6(node.period, other.period) && isEqual(node.name, other.name); 14911 return isEqualNodes(node.type, other.type) && isEqualTokens(node.period, oth er.period) && isEqualNodes(node.name, other.name);
14910 } 14912 }
14911 14913
14912 bool visitContinueStatement(ContinueStatement node) { 14914 bool visitContinueStatement(ContinueStatement node) {
14913 ContinueStatement other = this._other as ContinueStatement; 14915 ContinueStatement other = this._other as ContinueStatement;
14914 return isEqual6(node.keyword, other.keyword) && isEqual(node.label, other.la bel) && isEqual6(node.semicolon, other.semicolon); 14916 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.label , other.label) && isEqualTokens(node.semicolon, other.semicolon);
14915 } 14917 }
14916 14918
14917 bool visitDeclaredIdentifier(DeclaredIdentifier node) { 14919 bool visitDeclaredIdentifier(DeclaredIdentifier node) {
14918 DeclaredIdentifier other = this._other as DeclaredIdentifier; 14920 DeclaredIdentifier other = this._other as DeclaredIdentifier;
14919 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier); 14921 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.iden tifier, other.identifier);
14920 } 14922 }
14921 14923
14922 bool visitDefaultFormalParameter(DefaultFormalParameter node) { 14924 bool visitDefaultFormalParameter(DefaultFormalParameter node) {
14923 DefaultFormalParameter other = this._other as DefaultFormalParameter; 14925 DefaultFormalParameter other = this._other as DefaultFormalParameter;
14924 return isEqual(node.parameter, other.parameter) && identical(node.kind, othe r.kind) && isEqual6(node.separator, other.separator) && isEqual(node.defaultValu e, other.defaultValue); 14926 return isEqualNodes(node.parameter, other.parameter) && identical(node.kind, other.kind) && isEqualTokens(node.separator, other.separator) && isEqualNodes(n ode.defaultValue, other.defaultValue);
14925 } 14927 }
14926 14928
14927 bool visitDoStatement(DoStatement node) { 14929 bool visitDoStatement(DoStatement node) {
14928 DoStatement other = this._other as DoStatement; 14930 DoStatement other = this._other as DoStatement;
14929 return isEqual6(node.doKeyword, other.doKeyword) && isEqual(node.body, other .body) && isEqual6(node.whileKeyword, other.whileKeyword) && isEqual6(node.leftP arenthesis, other.leftParenthesis) && isEqual(node.condition, other.condition) & & isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.semic olon, other.semicolon); 14931 return isEqualTokens(node.doKeyword, other.doKeyword) && isEqualNodes(node.b ody, other.body) && isEqualTokens(node.whileKeyword, other.whileKeyword) && isEq ualTokens(node.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.cond ition, other.condition) && isEqualTokens(node.rightParenthesis, other.rightParen thesis) && isEqualTokens(node.semicolon, other.semicolon);
14930 } 14932 }
14931 14933
14932 bool visitDoubleLiteral(DoubleLiteral node) { 14934 bool visitDoubleLiteral(DoubleLiteral node) {
14933 DoubleLiteral other = this._other as DoubleLiteral; 14935 DoubleLiteral other = this._other as DoubleLiteral;
14934 return isEqual6(node.literal, other.literal) && node.value == other.value; 14936 return isEqualTokens(node.literal, other.literal) && node.value == other.val ue;
14935 } 14937 }
14936 14938
14937 bool visitEmptyFunctionBody(EmptyFunctionBody node) { 14939 bool visitEmptyFunctionBody(EmptyFunctionBody node) {
14938 EmptyFunctionBody other = this._other as EmptyFunctionBody; 14940 EmptyFunctionBody other = this._other as EmptyFunctionBody;
14939 return isEqual6(node.semicolon, other.semicolon); 14941 return isEqualTokens(node.semicolon, other.semicolon);
14940 } 14942 }
14941 14943
14942 bool visitEmptyStatement(EmptyStatement node) { 14944 bool visitEmptyStatement(EmptyStatement node) {
14943 EmptyStatement other = this._other as EmptyStatement; 14945 EmptyStatement other = this._other as EmptyStatement;
14944 return isEqual6(node.semicolon, other.semicolon); 14946 return isEqualTokens(node.semicolon, other.semicolon);
14945 } 14947 }
14946 14948
14947 bool visitExportDirective(ExportDirective node) { 14949 bool visitExportDirective(ExportDirective node) {
14948 ExportDirective other = this._other as ExportDirective; 14950 ExportDirective other = this._other as ExportDirective;
14949 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual5(node.combinators, other.combinators) & & isEqual6(node.semicolon, other.semicolon); 14951 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualNodeLists(node.co mbinators, other.combinators) && isEqualTokens(node.semicolon, other.semicolon);
14950 } 14952 }
14951 14953
14952 bool visitExpressionFunctionBody(ExpressionFunctionBody node) { 14954 bool visitExpressionFunctionBody(ExpressionFunctionBody node) {
14953 ExpressionFunctionBody other = this._other as ExpressionFunctionBody; 14955 ExpressionFunctionBody other = this._other as ExpressionFunctionBody;
14954 return isEqual6(node.functionDefinition, other.functionDefinition) && isEqua l(node.expression, other.expression) && isEqual6(node.semicolon, other.semicolon ); 14956 return isEqualTokens(node.functionDefinition, other.functionDefinition) && i sEqualNodes(node.expression, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
14955 } 14957 }
14956 14958
14957 bool visitExpressionStatement(ExpressionStatement node) { 14959 bool visitExpressionStatement(ExpressionStatement node) {
14958 ExpressionStatement other = this._other as ExpressionStatement; 14960 ExpressionStatement other = this._other as ExpressionStatement;
14959 return isEqual(node.expression, other.expression) && isEqual6(node.semicolon , other.semicolon); 14961 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .semicolon, other.semicolon);
14960 } 14962 }
14961 14963
14962 bool visitExtendsClause(ExtendsClause node) { 14964 bool visitExtendsClause(ExtendsClause node) {
14963 ExtendsClause other = this._other as ExtendsClause; 14965 ExtendsClause other = this._other as ExtendsClause;
14964 return isEqual6(node.keyword, other.keyword) && isEqual(node.superclass, oth er.superclass); 14966 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.super class, other.superclass);
14965 } 14967 }
14966 14968
14967 bool visitFieldDeclaration(FieldDeclaration node) { 14969 bool visitFieldDeclaration(FieldDeclaration node) {
14968 FieldDeclaration other = this._other as FieldDeclaration; 14970 FieldDeclaration other = this._other as FieldDeclaration;
14969 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.staticKeyword, other.stati cKeyword) && isEqual(node.fields, other.fields) && isEqual6(node.semicolon, othe r.semicolon); 14971 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.staticKe yword, other.staticKeyword) && isEqualNodes(node.fields, other.fields) && isEqua lTokens(node.semicolon, other.semicolon);
14970 } 14972 }
14971 14973
14972 bool visitFieldFormalParameter(FieldFormalParameter node) { 14974 bool visitFieldFormalParameter(FieldFormalParameter node) {
14973 FieldFormalParameter other = this._other as FieldFormalParameter; 14975 FieldFormalParameter other = this._other as FieldFormalParameter;
14974 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual6(node.thisToken, other.thisToken) && isEqual6(node.period, other.period) && isEqual(node.identifier, other.identifier ); 14976 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualTokens(node.thi sToken, other.thisToken) && isEqualTokens(node.period, other.period) && isEqualN odes(node.identifier, other.identifier);
14975 } 14977 }
14976 14978
14977 bool visitForEachStatement(ForEachStatement node) { 14979 bool visitForEachStatement(ForEachStatement node) {
14978 ForEachStatement other = this._other as ForEachStatement; 14980 ForEachStatement other = this._other as ForEachStatement;
14979 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.loopVariable, other.loopVariable ) && isEqual6(node.inKeyword, other.inKeyword) && isEqual(node.iterator, other.i terator) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(n ode.body, other.body); 14981 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.loopVariable, oth er.loopVariable) && isEqualTokens(node.inKeyword, other.inKeyword) && isEqualNod es(node.iterator, other.iterator) && isEqualTokens(node.rightParenthesis, other. rightParenthesis) && isEqualNodes(node.body, other.body);
14980 } 14982 }
14981 14983
14982 bool visitFormalParameterList(FormalParameterList node) { 14984 bool visitFormalParameterList(FormalParameterList node) {
14983 FormalParameterList other = this._other as FormalParameterList; 14985 FormalParameterList other = this._other as FormalParameterList;
14984 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual5(nod e.parameters, other.parameters) && isEqual6(node.leftDelimiter, other.leftDelimi ter) && isEqual6(node.rightDelimiter, other.rightDelimiter) && isEqual6(node.rig htParenthesis, other.rightParenthesis); 14986 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqual NodeLists(node.parameters, other.parameters) && isEqualTokens(node.leftDelimiter , other.leftDelimiter) && isEqualTokens(node.rightDelimiter, other.rightDelimite r) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
14985 } 14987 }
14986 14988
14987 bool visitForStatement(ForStatement node) { 14989 bool visitForStatement(ForStatement node) {
14988 ForStatement other = this._other as ForStatement; 14990 ForStatement other = this._other as ForStatement;
14989 return isEqual6(node.forKeyword, other.forKeyword) && isEqual6(node.leftPare nthesis, other.leftParenthesis) && isEqual(node.variables, other.variables) && i sEqual(node.initialization, other.initialization) && isEqual6(node.leftSeparator , other.leftSeparator) && isEqual(node.condition, other.condition) && isEqual6(n ode.rightSeparator, other.rightSeparator) && isEqual5(node.updaters, other.updat ers) && isEqual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node. body, other.body); 14991 return isEqualTokens(node.forKeyword, other.forKeyword) && isEqualTokens(nod e.leftParenthesis, other.leftParenthesis) && isEqualNodes(node.variables, other. variables) && isEqualNodes(node.initialization, other.initialization) && isEqual Tokens(node.leftSeparator, other.leftSeparator) && isEqualNodes(node.condition, other.condition) && isEqualTokens(node.rightSeparator, other.rightSeparator) && isEqualNodeLists(node.updaters, other.updaters) && isEqualTokens(node.rightParen thesis, other.rightParenthesis) && isEqualNodes(node.body, other.body);
14990 } 14992 }
14991 14993
14992 bool visitFunctionDeclaration(FunctionDeclaration node) { 14994 bool visitFunctionDeclaration(FunctionDeclaration node) {
14993 FunctionDeclaration other = this._other as FunctionDeclaration; 14995 FunctionDeclaration other = this._other as FunctionDeclaration;
14994 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual(node.returnType, other.returnType) && isEqual6(node.pro pertyKeyword, other.propertyKeyword) && isEqual(node.name, other.name) && isEqua l(node.functionExpression, other.functionExpression); 14996 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.external Keyword, other.externalKeyword) && isEqualNodes(node.returnType, other.returnTyp e) && isEqualTokens(node.propertyKeyword, other.propertyKeyword) && isEqualNodes (node.name, other.name) && isEqualNodes(node.functionExpression, other.functionE xpression);
14995 } 14997 }
14996 14998
14997 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 14999 bool visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
14998 FunctionDeclarationStatement other = this._other as FunctionDeclarationState ment; 15000 FunctionDeclarationStatement other = this._other as FunctionDeclarationState ment;
14999 return isEqual(node.functionDeclaration, other.functionDeclaration); 15001 return isEqualNodes(node.functionDeclaration, other.functionDeclaration);
15000 } 15002 }
15001 15003
15002 bool visitFunctionExpression(FunctionExpression node) { 15004 bool visitFunctionExpression(FunctionExpression node) {
15003 FunctionExpression other = this._other as FunctionExpression; 15005 FunctionExpression other = this._other as FunctionExpression;
15004 return isEqual(node.parameters, other.parameters) && isEqual(node.body, othe r.body); 15006 return isEqualNodes(node.parameters, other.parameters) && isEqualNodes(node. body, other.body);
15005 } 15007 }
15006 15008
15007 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 15009 bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
15008 FunctionExpressionInvocation other = this._other as FunctionExpressionInvoca tion; 15010 FunctionExpressionInvocation other = this._other as FunctionExpressionInvoca tion;
15009 return isEqual(node.function, other.function) && isEqual(node.argumentList, other.argumentList); 15011 return isEqualNodes(node.function, other.function) && isEqualNodes(node.argu mentList, other.argumentList);
15010 } 15012 }
15011 15013
15012 bool visitFunctionTypeAlias(FunctionTypeAlias node) { 15014 bool visitFunctionTypeAlias(FunctionTypeAlias node) {
15013 FunctionTypeAlias other = this._other as FunctionTypeAlias; 15015 FunctionTypeAlias other = this._other as FunctionTypeAlias;
15014 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.returnType, other.returnType) && isEqual(node.name, other.name) && isEqual(node.typeParameters, other.typeParameters) && isEqual(node.parameters, other.parameters) && isEqual6(node.semicolon, other.semicolon); 15016 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.returnType, other.returnType) && isEqualNod es(node.name, other.name) && isEqualNodes(node.typeParameters, other.typeParamet ers) && isEqualNodes(node.parameters, other.parameters) && isEqualTokens(node.se micolon, other.semicolon);
15015 } 15017 }
15016 15018
15017 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) { 15019 bool visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
15018 FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParam eter; 15020 FunctionTypedFormalParameter other = this._other as FunctionTypedFormalParam eter;
15019 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.returnType, other.returnTyp e) && isEqual(node.identifier, other.identifier) && isEqual(node.parameters, oth er.parameters); 15021 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.returnTyp e, other.returnType) && isEqualNodes(node.identifier, other.identifier) && isEqu alNodes(node.parameters, other.parameters);
15020 } 15022 }
15021 15023
15022 bool visitHideCombinator(HideCombinator node) { 15024 bool visitHideCombinator(HideCombinator node) {
15023 HideCombinator other = this._other as HideCombinator; 15025 HideCombinator other = this._other as HideCombinator;
15024 return isEqual6(node.keyword, other.keyword) && isEqual5(node.hiddenNames, o ther.hiddenNames); 15026 return isEqualTokens(node.keyword, other.keyword) && isEqualNodeLists(node.h iddenNames, other.hiddenNames);
15025 } 15027 }
15026 15028
15027 bool visitIfStatement(IfStatement node) { 15029 bool visitIfStatement(IfStatement node) {
15028 IfStatement other = this._other as IfStatement; 15030 IfStatement other = this._other as IfStatement;
15029 return isEqual6(node.ifKeyword, other.ifKeyword) && isEqual6(node.leftParent hesis, other.leftParenthesis) && isEqual(node.condition, other.condition) && isE qual6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.thenStateme nt, other.thenStatement) && isEqual6(node.elseKeyword, other.elseKeyword) && isE qual(node.elseStatement, other.elseStatement); 15031 return isEqualTokens(node.ifKeyword, other.ifKeyword) && isEqualTokens(node. leftParenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.co ndition) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEq ualNodes(node.thenStatement, other.thenStatement) && isEqualTokens(node.elseKeyw ord, other.elseKeyword) && isEqualNodes(node.elseStatement, other.elseStatement) ;
15030 } 15032 }
15031 15033
15032 bool visitImplementsClause(ImplementsClause node) { 15034 bool visitImplementsClause(ImplementsClause node) {
15033 ImplementsClause other = this._other as ImplementsClause; 15035 ImplementsClause other = this._other as ImplementsClause;
15034 return isEqual6(node.keyword, other.keyword) && isEqual5(node.interfaces, ot her.interfaces); 15036 return isEqualTokens(node.keyword, other.keyword) && isEqualNodeLists(node.i nterfaces, other.interfaces);
15035 } 15037 }
15036 15038
15037 bool visitImportDirective(ImportDirective node) { 15039 bool visitImportDirective(ImportDirective node) {
15038 ImportDirective other = this._other as ImportDirective; 15040 ImportDirective other = this._other as ImportDirective;
15039 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.uri, other.uri) && isEqual6(node.asToken, other.asToken) && isEqua l(node.prefix, other.prefix) && isEqual5(node.combinators, other.combinators) && isEqual6(node.semicolon, other.semicolon); 15041 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.asTok en, other.asToken) && isEqualNodes(node.prefix, other.prefix) && isEqualNodeList s(node.combinators, other.combinators) && isEqualTokens(node.semicolon, other.se micolon);
15040 } 15042 }
15041 15043
15042 bool visitIndexExpression(IndexExpression node) { 15044 bool visitIndexExpression(IndexExpression node) {
15043 IndexExpression other = this._other as IndexExpression; 15045 IndexExpression other = this._other as IndexExpression;
15044 return isEqual(node.target, other.target) && isEqual6(node.leftBracket, othe r.leftBracket) && isEqual(node.index, other.index) && isEqual6(node.rightBracket , other.rightBracket); 15046 return isEqualNodes(node.target, other.target) && isEqualTokens(node.leftBra cket, other.leftBracket) && isEqualNodes(node.index, other.index) && isEqualToke ns(node.rightBracket, other.rightBracket);
15045 } 15047 }
15046 15048
15047 bool visitInstanceCreationExpression(InstanceCreationExpression node) { 15049 bool visitInstanceCreationExpression(InstanceCreationExpression node) {
15048 InstanceCreationExpression other = this._other as InstanceCreationExpression ; 15050 InstanceCreationExpression other = this._other as InstanceCreationExpression ;
15049 return isEqual6(node.keyword, other.keyword) && isEqual(node.constructorName , other.constructorName) && isEqual(node.argumentList, other.argumentList); 15051 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.const ructorName, other.constructorName) && isEqualNodes(node.argumentList, other.argu mentList);
15050 } 15052 }
15051 15053
15052 bool visitIntegerLiteral(IntegerLiteral node) { 15054 bool visitIntegerLiteral(IntegerLiteral node) {
15053 IntegerLiteral other = this._other as IntegerLiteral; 15055 IntegerLiteral other = this._other as IntegerLiteral;
15054 return isEqual6(node.literal, other.literal) && (node.value == other.value); 15056 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue);
15055 } 15057 }
15056 15058
15057 bool visitInterpolationExpression(InterpolationExpression node) { 15059 bool visitInterpolationExpression(InterpolationExpression node) {
15058 InterpolationExpression other = this._other as InterpolationExpression; 15060 InterpolationExpression other = this._other as InterpolationExpression;
15059 return isEqual6(node.leftBracket, other.leftBracket) && isEqual(node.express ion, other.expression) && isEqual6(node.rightBracket, other.rightBracket); 15061 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodes(no de.expression, other.expression) && isEqualTokens(node.rightBracket, other.right Bracket);
15060 } 15062 }
15061 15063
15062 bool visitInterpolationString(InterpolationString node) { 15064 bool visitInterpolationString(InterpolationString node) {
15063 InterpolationString other = this._other as InterpolationString; 15065 InterpolationString other = this._other as InterpolationString;
15064 return isEqual6(node.contents, other.contents) && node.value == other.value; 15066 return isEqualTokens(node.contents, other.contents) && node.value == other.v alue;
15065 } 15067 }
15066 15068
15067 bool visitIsExpression(IsExpression node) { 15069 bool visitIsExpression(IsExpression node) {
15068 IsExpression other = this._other as IsExpression; 15070 IsExpression other = this._other as IsExpression;
15069 return isEqual(node.expression, other.expression) && isEqual6(node.isOperato r, other.isOperator) && isEqual6(node.notOperator, other.notOperator) && isEqual (node.type, other.type); 15071 return isEqualNodes(node.expression, other.expression) && isEqualTokens(node .isOperator, other.isOperator) && isEqualTokens(node.notOperator, other.notOpera tor) && isEqualNodes(node.type, other.type);
15070 } 15072 }
15071 15073
15072 bool visitLabel(Label node) { 15074 bool visitLabel(Label node) {
15073 Label other = this._other as Label; 15075 Label other = this._other as Label;
15074 return isEqual(node.label, other.label) && isEqual6(node.colon, other.colon) ; 15076 return isEqualNodes(node.label, other.label) && isEqualTokens(node.colon, ot her.colon);
15075 } 15077 }
15076 15078
15077 bool visitLabeledStatement(LabeledStatement node) { 15079 bool visitLabeledStatement(LabeledStatement node) {
15078 LabeledStatement other = this._other as LabeledStatement; 15080 LabeledStatement other = this._other as LabeledStatement;
15079 return isEqual5(node.labels, other.labels) && isEqual(node.statement, other. statement); 15081 return isEqualNodeLists(node.labels, other.labels) && isEqualNodes(node.stat ement, other.statement);
15080 } 15082 }
15081 15083
15082 bool visitLibraryDirective(LibraryDirective node) { 15084 bool visitLibraryDirective(LibraryDirective node) {
15083 LibraryDirective other = this._other as LibraryDirective; 15085 LibraryDirective other = this._other as LibraryDirective;
15084 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.libraryToken, other.librar yToken) && isEqual(node.name, other.name) && isEqual6(node.semicolon, other.semi colon); 15086 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.libraryT oken, other.libraryToken) && isEqualNodes(node.name, other.name) && isEqualToken s(node.semicolon, other.semicolon);
15085 } 15087 }
15086 15088
15087 bool visitLibraryIdentifier(LibraryIdentifier node) { 15089 bool visitLibraryIdentifier(LibraryIdentifier node) {
15088 LibraryIdentifier other = this._other as LibraryIdentifier; 15090 LibraryIdentifier other = this._other as LibraryIdentifier;
15089 return isEqual5(node.components, other.components); 15091 return isEqualNodeLists(node.components, other.components);
15090 } 15092 }
15091 15093
15092 bool visitListLiteral(ListLiteral node) { 15094 bool visitListLiteral(ListLiteral node) {
15093 ListLiteral other = this._other as ListLiteral; 15095 ListLiteral other = this._other as ListLiteral;
15094 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.elements, other.elements) && isEqual6(node.rightBracket, other. rightBracket); 15096 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && isEqualNodeLists(node.elements, other.elements) && isEqualToke ns(node.rightBracket, other.rightBracket);
15095 } 15097 }
15096 15098
15097 bool visitMapLiteral(MapLiteral node) { 15099 bool visitMapLiteral(MapLiteral node) {
15098 MapLiteral other = this._other as MapLiteral; 15100 MapLiteral other = this._other as MapLiteral;
15099 return isEqual6(node.constKeyword, other.constKeyword) && isEqual(node.typeA rguments, other.typeArguments) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.entries, other.entries) && isEqual6(node.rightBracket, other.ri ghtBracket); 15101 return isEqualTokens(node.constKeyword, other.constKeyword) && isEqualNodes( node.typeArguments, other.typeArguments) && isEqualTokens(node.leftBracket, othe r.leftBracket) && isEqualNodeLists(node.entries, other.entries) && isEqualTokens (node.rightBracket, other.rightBracket);
15100 } 15102 }
15101 15103
15102 bool visitMapLiteralEntry(MapLiteralEntry node) { 15104 bool visitMapLiteralEntry(MapLiteralEntry node) {
15103 MapLiteralEntry other = this._other as MapLiteralEntry; 15105 MapLiteralEntry other = this._other as MapLiteralEntry;
15104 return isEqual(node.key, other.key) && isEqual6(node.separator, other.separa tor) && isEqual(node.value, other.value); 15106 return isEqualNodes(node.key, other.key) && isEqualTokens(node.separator, ot her.separator) && isEqualNodes(node.value, other.value);
15105 } 15107 }
15106 15108
15107 bool visitMethodDeclaration(MethodDeclaration node) { 15109 bool visitMethodDeclaration(MethodDeclaration node) {
15108 MethodDeclaration other = this._other as MethodDeclaration; 15110 MethodDeclaration other = this._other as MethodDeclaration;
15109 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.externalKeyword, other.ext ernalKeyword) && isEqual6(node.modifierKeyword, other.modifierKeyword) && isEqua l(node.returnType, other.returnType) && isEqual6(node.propertyKeyword, other.pro pertyKeyword) && isEqual6(node.propertyKeyword, other.propertyKeyword) && isEqua l(node.name, other.name) && isEqual(node.parameters, other.parameters) && isEqua l(node.body, other.body); 15111 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.external Keyword, other.externalKeyword) && isEqualTokens(node.modifierKeyword, other.mod ifierKeyword) && isEqualNodes(node.returnType, other.returnType) && isEqualToken s(node.propertyKeyword, other.propertyKeyword) && isEqualTokens(node.propertyKey word, other.propertyKeyword) && isEqualNodes(node.name, other.name) && isEqualNo des(node.parameters, other.parameters) && isEqualNodes(node.body, other.body);
15110 } 15112 }
15111 15113
15112 bool visitMethodInvocation(MethodInvocation node) { 15114 bool visitMethodInvocation(MethodInvocation node) {
15113 MethodInvocation other = this._other as MethodInvocation; 15115 MethodInvocation other = this._other as MethodInvocation;
15114 return isEqual(node.target, other.target) && isEqual6(node.period, other.per iod) && isEqual(node.methodName, other.methodName) && isEqual(node.argumentList, other.argumentList); 15116 return isEqualNodes(node.target, other.target) && isEqualTokens(node.period, other.period) && isEqualNodes(node.methodName, other.methodName) && isEqualNode s(node.argumentList, other.argumentList);
15115 } 15117 }
15116 15118
15117 bool visitNamedExpression(NamedExpression node) { 15119 bool visitNamedExpression(NamedExpression node) {
15118 NamedExpression other = this._other as NamedExpression; 15120 NamedExpression other = this._other as NamedExpression;
15119 return isEqual(node.name, other.name) && isEqual(node.expression, other.expr ession); 15121 return isEqualNodes(node.name, other.name) && isEqualNodes(node.expression, other.expression);
15120 } 15122 }
15121 15123
15122 bool visitNativeClause(NativeClause node) { 15124 bool visitNativeClause(NativeClause node) {
15123 NativeClause other = this._other as NativeClause; 15125 NativeClause other = this._other as NativeClause;
15124 return isEqual6(node.keyword, other.keyword) && isEqual(node.name, other.nam e); 15126 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.name, other.name);
15125 } 15127 }
15126 15128
15127 bool visitNativeFunctionBody(NativeFunctionBody node) { 15129 bool visitNativeFunctionBody(NativeFunctionBody node) {
15128 NativeFunctionBody other = this._other as NativeFunctionBody; 15130 NativeFunctionBody other = this._other as NativeFunctionBody;
15129 return isEqual6(node.nativeToken, other.nativeToken) && isEqual(node.stringL iteral, other.stringLiteral) && isEqual6(node.semicolon, other.semicolon); 15131 return isEqualTokens(node.nativeToken, other.nativeToken) && isEqualNodes(no de.stringLiteral, other.stringLiteral) && isEqualTokens(node.semicolon, other.se micolon);
15130 } 15132 }
15131 15133
15132 bool visitNullLiteral(NullLiteral node) { 15134 bool visitNullLiteral(NullLiteral node) {
15133 NullLiteral other = this._other as NullLiteral; 15135 NullLiteral other = this._other as NullLiteral;
15134 return isEqual6(node.literal, other.literal); 15136 return isEqualTokens(node.literal, other.literal);
15135 } 15137 }
15136 15138
15137 bool visitParenthesizedExpression(ParenthesizedExpression node) { 15139 bool visitParenthesizedExpression(ParenthesizedExpression node) {
15138 ParenthesizedExpression other = this._other as ParenthesizedExpression; 15140 ParenthesizedExpression other = this._other as ParenthesizedExpression;
15139 return isEqual6(node.leftParenthesis, other.leftParenthesis) && isEqual(node .expression, other.expression) && isEqual6(node.rightParenthesis, other.rightPar enthesis); 15141 return isEqualTokens(node.leftParenthesis, other.leftParenthesis) && isEqual Nodes(node.expression, other.expression) && isEqualTokens(node.rightParenthesis, other.rightParenthesis);
15140 } 15142 }
15141 15143
15142 bool visitPartDirective(PartDirective node) { 15144 bool visitPartDirective(PartDirective node) {
15143 PartDirective other = this._other as PartDirective; 15145 PartDirective other = this._other as PartDirective;
15144 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual(node.uri, other.uri) && isEqual6(node.semicolon, other.semicolon); 15146 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToke n, other.partToken) && isEqualNodes(node.uri, other.uri) && isEqualTokens(node.s emicolon, other.semicolon);
15145 } 15147 }
15146 15148
15147 bool visitPartOfDirective(PartOfDirective node) { 15149 bool visitPartOfDirective(PartOfDirective node) {
15148 PartOfDirective other = this._other as PartOfDirective; 15150 PartOfDirective other = this._other as PartOfDirective;
15149 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.partToken, other.partToken ) && isEqual6(node.ofToken, other.ofToken) && isEqual(node.libraryName, other.li braryName) && isEqual6(node.semicolon, other.semicolon); 15151 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.partToke n, other.partToken) && isEqualTokens(node.ofToken, other.ofToken) && isEqualNode s(node.libraryName, other.libraryName) && isEqualTokens(node.semicolon, other.se micolon);
15150 } 15152 }
15151 15153
15152 bool visitPostfixExpression(PostfixExpression node) { 15154 bool visitPostfixExpression(PostfixExpression node) {
15153 PostfixExpression other = this._other as PostfixExpression; 15155 PostfixExpression other = this._other as PostfixExpression;
15154 return isEqual(node.operand, other.operand) && isEqual6(node.operator, other .operator); 15156 return isEqualNodes(node.operand, other.operand) && isEqualTokens(node.opera tor, other.operator);
15155 } 15157 }
15156 15158
15157 bool visitPrefixedIdentifier(PrefixedIdentifier node) { 15159 bool visitPrefixedIdentifier(PrefixedIdentifier node) {
15158 PrefixedIdentifier other = this._other as PrefixedIdentifier; 15160 PrefixedIdentifier other = this._other as PrefixedIdentifier;
15159 return isEqual(node.prefix, other.prefix) && isEqual6(node.period, other.per iod) && isEqual(node.identifier, other.identifier); 15161 return isEqualNodes(node.prefix, other.prefix) && isEqualTokens(node.period, other.period) && isEqualNodes(node.identifier, other.identifier);
15160 } 15162 }
15161 15163
15162 bool visitPrefixExpression(PrefixExpression node) { 15164 bool visitPrefixExpression(PrefixExpression node) {
15163 PrefixExpression other = this._other as PrefixExpression; 15165 PrefixExpression other = this._other as PrefixExpression;
15164 return isEqual6(node.operator, other.operator) && isEqual(node.operand, othe r.operand); 15166 return isEqualTokens(node.operator, other.operator) && isEqualNodes(node.ope rand, other.operand);
15165 } 15167 }
15166 15168
15167 bool visitPropertyAccess(PropertyAccess node) { 15169 bool visitPropertyAccess(PropertyAccess node) {
15168 PropertyAccess other = this._other as PropertyAccess; 15170 PropertyAccess other = this._other as PropertyAccess;
15169 return isEqual(node.target, other.target) && isEqual6(node.operator, other.o perator) && isEqual(node.propertyName, other.propertyName); 15171 return isEqualNodes(node.target, other.target) && isEqualTokens(node.operato r, other.operator) && isEqualNodes(node.propertyName, other.propertyName);
15170 } 15172 }
15171 15173
15172 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) { 15174 bool visitRedirectingConstructorInvocation(RedirectingConstructorInvocation no de) {
15173 RedirectingConstructorInvocation other = this._other as RedirectingConstruct orInvocation; 15175 RedirectingConstructorInvocation other = this._other as RedirectingConstruct orInvocation;
15174 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList); 15176 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList);
15175 } 15177 }
15176 15178
15177 bool visitRethrowExpression(RethrowExpression node) { 15179 bool visitRethrowExpression(RethrowExpression node) {
15178 RethrowExpression other = this._other as RethrowExpression; 15180 RethrowExpression other = this._other as RethrowExpression;
15179 return isEqual6(node.keyword, other.keyword); 15181 return isEqualTokens(node.keyword, other.keyword);
15180 } 15182 }
15181 15183
15182 bool visitReturnStatement(ReturnStatement node) { 15184 bool visitReturnStatement(ReturnStatement node) {
15183 ReturnStatement other = this._other as ReturnStatement; 15185 ReturnStatement other = this._other as ReturnStatement;
15184 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression) && isEqual6(node.semicolon, other.semicolon); 15186 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression) && isEqualTokens(node.semicolon, other.semicolon);
15185 } 15187 }
15186 15188
15187 bool visitScriptTag(ScriptTag node) { 15189 bool visitScriptTag(ScriptTag node) {
15188 ScriptTag other = this._other as ScriptTag; 15190 ScriptTag other = this._other as ScriptTag;
15189 return isEqual6(node.scriptTag, other.scriptTag); 15191 return isEqualTokens(node.scriptTag, other.scriptTag);
15190 } 15192 }
15191 15193
15192 bool visitShowCombinator(ShowCombinator node) { 15194 bool visitShowCombinator(ShowCombinator node) {
15193 ShowCombinator other = this._other as ShowCombinator; 15195 ShowCombinator other = this._other as ShowCombinator;
15194 return isEqual6(node.keyword, other.keyword) && isEqual5(node.shownNames, ot her.shownNames); 15196 return isEqualTokens(node.keyword, other.keyword) && isEqualNodeLists(node.s hownNames, other.shownNames);
15195 } 15197 }
15196 15198
15197 bool visitSimpleFormalParameter(SimpleFormalParameter node) { 15199 bool visitSimpleFormalParameter(SimpleFormalParameter node) {
15198 SimpleFormalParameter other = this._other as SimpleFormalParameter; 15200 SimpleFormalParameter other = this._other as SimpleFormalParameter;
15199 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual(node.identifier, other.identifier); 15201 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.type, other.type) && isEqualNodes(node.iden tifier, other.identifier);
15200 } 15202 }
15201 15203
15202 bool visitSimpleIdentifier(SimpleIdentifier node) { 15204 bool visitSimpleIdentifier(SimpleIdentifier node) {
15203 SimpleIdentifier other = this._other as SimpleIdentifier; 15205 SimpleIdentifier other = this._other as SimpleIdentifier;
15204 return isEqual6(node.token, other.token); 15206 return isEqualTokens(node.token, other.token);
15205 } 15207 }
15206 15208
15207 bool visitSimpleStringLiteral(SimpleStringLiteral node) { 15209 bool visitSimpleStringLiteral(SimpleStringLiteral node) {
15208 SimpleStringLiteral other = this._other as SimpleStringLiteral; 15210 SimpleStringLiteral other = this._other as SimpleStringLiteral;
15209 return isEqual6(node.literal, other.literal) && (node.value == other.value); 15211 return isEqualTokens(node.literal, other.literal) && (node.value == other.va lue);
15210 } 15212 }
15211 15213
15212 bool visitStringInterpolation(StringInterpolation node) { 15214 bool visitStringInterpolation(StringInterpolation node) {
15213 StringInterpolation other = this._other as StringInterpolation; 15215 StringInterpolation other = this._other as StringInterpolation;
15214 return isEqual5(node.elements, other.elements); 15216 return isEqualNodeLists(node.elements, other.elements);
15215 } 15217 }
15216 15218
15217 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) { 15219 bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
15218 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ; 15220 SuperConstructorInvocation other = this._other as SuperConstructorInvocation ;
15219 return isEqual6(node.keyword, other.keyword) && isEqual6(node.period, other. period) && isEqual(node.constructorName, other.constructorName) && isEqual(node. argumentList, other.argumentList); 15221 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.peri od, other.period) && isEqualNodes(node.constructorName, other.constructorName) & & isEqualNodes(node.argumentList, other.argumentList);
15220 } 15222 }
15221 15223
15222 bool visitSuperExpression(SuperExpression node) { 15224 bool visitSuperExpression(SuperExpression node) {
15223 SuperExpression other = this._other as SuperExpression; 15225 SuperExpression other = this._other as SuperExpression;
15224 return isEqual6(node.keyword, other.keyword); 15226 return isEqualTokens(node.keyword, other.keyword);
15225 } 15227 }
15226 15228
15227 bool visitSwitchCase(SwitchCase node) { 15229 bool visitSwitchCase(SwitchCase node) {
15228 SwitchCase other = this._other as SwitchCase; 15230 SwitchCase other = this._other as SwitchCase;
15229 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual(node.expression, other.expression) && isEqual6(node.colon, ot her.colon) && isEqual5(node.statements, other.statements); 15231 return isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.key word, other.keyword) && isEqualNodes(node.expression, other.expression) && isEqu alTokens(node.colon, other.colon) && isEqualNodeLists(node.statements, other.sta tements);
15230 } 15232 }
15231 15233
15232 bool visitSwitchDefault(SwitchDefault node) { 15234 bool visitSwitchDefault(SwitchDefault node) {
15233 SwitchDefault other = this._other as SwitchDefault; 15235 SwitchDefault other = this._other as SwitchDefault;
15234 return isEqual5(node.labels, other.labels) && isEqual6(node.keyword, other.k eyword) && isEqual6(node.colon, other.colon) && isEqual5(node.statements, other. statements); 15236 return isEqualNodeLists(node.labels, other.labels) && isEqualTokens(node.key word, other.keyword) && isEqualTokens(node.colon, other.colon) && isEqualNodeLis ts(node.statements, other.statements);
15235 } 15237 }
15236 15238
15237 bool visitSwitchStatement(SwitchStatement node) { 15239 bool visitSwitchStatement(SwitchStatement node) {
15238 SwitchStatement other = this._other as SwitchStatement; 15240 SwitchStatement other = this._other as SwitchStatement;
15239 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.expression, other.expression) && isEqu al6(node.rightParenthesis, other.rightParenthesis) && isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.members, other.members) && isEqual6(node.ri ghtBracket, other.rightBracket); 15241 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.expression, other.expre ssion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqua lTokens(node.leftBracket, other.leftBracket) && isEqualNodeLists(node.members, o ther.members) && isEqualTokens(node.rightBracket, other.rightBracket);
15240 } 15242 }
15241 15243
15242 bool visitSymbolLiteral(SymbolLiteral node) { 15244 bool visitSymbolLiteral(SymbolLiteral node) {
15243 SymbolLiteral other = this._other as SymbolLiteral; 15245 SymbolLiteral other = this._other as SymbolLiteral;
15244 return isEqual6(node.poundSign, other.poundSign) && isEqual7(node.components , other.components); 15246 return isEqualTokens(node.poundSign, other.poundSign) && isEqualTokenLists(n ode.components, other.components);
15245 } 15247 }
15246 15248
15247 bool visitThisExpression(ThisExpression node) { 15249 bool visitThisExpression(ThisExpression node) {
15248 ThisExpression other = this._other as ThisExpression; 15250 ThisExpression other = this._other as ThisExpression;
15249 return isEqual6(node.keyword, other.keyword); 15251 return isEqualTokens(node.keyword, other.keyword);
15250 } 15252 }
15251 15253
15252 bool visitThrowExpression(ThrowExpression node) { 15254 bool visitThrowExpression(ThrowExpression node) {
15253 ThrowExpression other = this._other as ThrowExpression; 15255 ThrowExpression other = this._other as ThrowExpression;
15254 return isEqual6(node.keyword, other.keyword) && isEqual(node.expression, oth er.expression); 15256 return isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.expre ssion, other.expression);
15255 } 15257 }
15256 15258
15257 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { 15259 bool visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
15258 TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclarati on; 15260 TopLevelVariableDeclaration other = this._other as TopLevelVariableDeclarati on;
15259 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon); 15261 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.variables , other.variables) && isEqualTokens(node.semicolon, other.semicolon);
15260 } 15262 }
15261 15263
15262 bool visitTryStatement(TryStatement node) { 15264 bool visitTryStatement(TryStatement node) {
15263 TryStatement other = this._other as TryStatement; 15265 TryStatement other = this._other as TryStatement;
15264 return isEqual6(node.tryKeyword, other.tryKeyword) && isEqual(node.body, oth er.body) && isEqual5(node.catchClauses, other.catchClauses) && isEqual6(node.fin allyKeyword, other.finallyKeyword) && isEqual(node.finallyBlock, other.finallyBl ock); 15266 return isEqualTokens(node.tryKeyword, other.tryKeyword) && isEqualNodes(node .body, other.body) && isEqualNodeLists(node.catchClauses, other.catchClauses) && isEqualTokens(node.finallyKeyword, other.finallyKeyword) && isEqualNodes(node.f inallyBlock, other.finallyBlock);
15265 } 15267 }
15266 15268
15267 bool visitTypeArgumentList(TypeArgumentList node) { 15269 bool visitTypeArgumentList(TypeArgumentList node) {
15268 TypeArgumentList other = this._other as TypeArgumentList; 15270 TypeArgumentList other = this._other as TypeArgumentList;
15269 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.argume nts, other.arguments) && isEqual6(node.rightBracket, other.rightBracket); 15271 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodeList s(node.arguments, other.arguments) && isEqualTokens(node.rightBracket, other.rig htBracket);
15270 } 15272 }
15271 15273
15272 bool visitTypeName(TypeName node) { 15274 bool visitTypeName(TypeName node) {
15273 TypeName other = this._other as TypeName; 15275 TypeName other = this._other as TypeName;
15274 return isEqual(node.name, other.name) && isEqual(node.typeArguments, other.t ypeArguments); 15276 return isEqualNodes(node.name, other.name) && isEqualNodes(node.typeArgument s, other.typeArguments);
15275 } 15277 }
15276 15278
15277 bool visitTypeParameter(TypeParameter node) { 15279 bool visitTypeParameter(TypeParameter node) {
15278 TypeParameter other = this._other as TypeParameter; 15280 TypeParameter other = this._other as TypeParameter;
15279 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.keyword, other.keyword) && isEqual(node.bound, other.bound); 15281 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, oth er.name) && isEqualTokens(node.keyword, other.keyword) && isEqualNodes(node.boun d, other.bound);
15280 } 15282 }
15281 15283
15282 bool visitTypeParameterList(TypeParameterList node) { 15284 bool visitTypeParameterList(TypeParameterList node) {
15283 TypeParameterList other = this._other as TypeParameterList; 15285 TypeParameterList other = this._other as TypeParameterList;
15284 return isEqual6(node.leftBracket, other.leftBracket) && isEqual5(node.typePa rameters, other.typeParameters) && isEqual6(node.rightBracket, other.rightBracke t); 15286 return isEqualTokens(node.leftBracket, other.leftBracket) && isEqualNodeList s(node.typeParameters, other.typeParameters) && isEqualTokens(node.rightBracket, other.rightBracket);
15285 } 15287 }
15286 15288
15287 bool visitVariableDeclaration(VariableDeclaration node) { 15289 bool visitVariableDeclaration(VariableDeclaration node) {
15288 VariableDeclaration other = this._other as VariableDeclaration; 15290 VariableDeclaration other = this._other as VariableDeclaration;
15289 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual(node.name, other.name) && isEqua l6(node.equals, other.equals) && isEqual(node.initializer, other.initializer); 15291 return isEqualNodes(node.documentationComment, other.documentationComment) & & isEqualNodeLists(node.metadata, other.metadata) && isEqualNodes(node.name, oth er.name) && isEqualTokens(node.equals, other.equals) && isEqualNodes(node.initia lizer, other.initializer);
15290 } 15292 }
15291 15293
15292 bool visitVariableDeclarationList(VariableDeclarationList node) { 15294 bool visitVariableDeclarationList(VariableDeclarationList node) {
15293 VariableDeclarationList other = this._other as VariableDeclarationList; 15295 VariableDeclarationList other = this._other as VariableDeclarationList;
15294 return isEqual(node.documentationComment, other.documentationComment) && isE qual5(node.metadata, other.metadata) && isEqual6(node.keyword, other.keyword) && isEqual(node.type, other.type) && isEqual5(node.variables, other.variables); 15296 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);
15295 } 15297 }
15296 15298
15297 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { 15299 bool visitVariableDeclarationStatement(VariableDeclarationStatement node) {
15298 VariableDeclarationStatement other = this._other as VariableDeclarationState ment; 15300 VariableDeclarationStatement other = this._other as VariableDeclarationState ment;
15299 return isEqual(node.variables, other.variables) && isEqual6(node.semicolon, other.semicolon); 15301 return isEqualNodes(node.variables, other.variables) && isEqualTokens(node.s emicolon, other.semicolon);
15300 } 15302 }
15301 15303
15302 bool visitWhileStatement(WhileStatement node) { 15304 bool visitWhileStatement(WhileStatement node) {
15303 WhileStatement other = this._other as WhileStatement; 15305 WhileStatement other = this._other as WhileStatement;
15304 return isEqual6(node.keyword, other.keyword) && isEqual6(node.leftParenthesi s, other.leftParenthesis) && isEqual(node.condition, other.condition) && isEqual 6(node.rightParenthesis, other.rightParenthesis) && isEqual(node.body, other.bod y); 15306 return isEqualTokens(node.keyword, other.keyword) && isEqualTokens(node.left Parenthesis, other.leftParenthesis) && isEqualNodes(node.condition, other.condit ion) && isEqualTokens(node.rightParenthesis, other.rightParenthesis) && isEqualN odes(node.body, other.body);
15305 } 15307 }
15306 15308
15307 bool visitWithClause(WithClause node) { 15309 bool visitWithClause(WithClause node) {
15308 WithClause other = this._other as WithClause; 15310 WithClause other = this._other as WithClause;
15309 return isEqual6(node.withKeyword, other.withKeyword) && isEqual5(node.mixinT ypes, other.mixinTypes); 15311 return isEqualTokens(node.withKeyword, other.withKeyword) && isEqualNodeList s(node.mixinTypes, other.mixinTypes);
15310 } 15312 }
15311 15313
15312 /** 15314 /**
15313 * Return `true` if the given AST nodes have the same structure.
15314 *
15315 * @param first the first node being compared
15316 * @param second the second node being compared
15317 * @return `true` if the given AST nodes have the same structure
15318 */
15319 bool isEqual(AstNode first, AstNode second) {
15320 if (first == null) {
15321 return second == null;
15322 } else if (second == null) {
15323 return false;
15324 } else if (first.runtimeType != second.runtimeType) {
15325 return false;
15326 }
15327 _other = second;
15328 return first.accept(this);
15329 }
15330
15331 /**
15332 * Return `true` if the given lists of AST nodes have the same size and corres ponding 15315 * Return `true` if the given lists of AST nodes have the same size and corres ponding
15333 * elements are equal. 15316 * elements are equal.
15334 * 15317 *
15335 * @param first the first node being compared 15318 * @param first the first node being compared
15336 * @param second the second node being compared 15319 * @param second the second node being compared
15337 * @return `true` if the given AST nodes have the same size and corresponding elements are 15320 * @return `true` if the given AST nodes have the same size and corresponding elements are
15338 * equal 15321 * equal
15339 */ 15322 */
15340 bool isEqual5(NodeList first, NodeList second) { 15323 bool isEqualNodeLists(NodeList first, NodeList second) {
15341 if (first == null) { 15324 if (first == null) {
15342 return second == null; 15325 return second == null;
15343 } else if (second == null) { 15326 } else if (second == null) {
15344 return false; 15327 return false;
15345 } 15328 }
15346 int size = first.length; 15329 int size = first.length;
15347 if (second.length != size) { 15330 if (second.length != size) {
15348 return false; 15331 return false;
15349 } 15332 }
15350 for (int i = 0; i < size; i++) { 15333 for (int i = 0; i < size; i++) {
15351 if (!isEqual(first[i], second[i])) { 15334 if (!isEqualNodes(first[i], second[i])) {
15352 return false; 15335 return false;
15353 } 15336 }
15354 } 15337 }
15355 return true; 15338 return true;
15356 } 15339 }
15357 15340
15358 /** 15341 /**
15359 * Return `true` if the given tokens have the same structure. 15342 * Return `true` if the given AST nodes have the same structure.
15360 * 15343 *
15361 * @param first the first node being compared 15344 * @param first the first node being compared
15362 * @param second the second node being compared 15345 * @param second the second node being compared
15363 * @return `true` if the given tokens have the same structure 15346 * @return `true` if the given AST nodes have the same structure
15364 */ 15347 */
15365 bool isEqual6(Token first, Token second) { 15348 bool isEqualNodes(AstNode first, AstNode second) {
15366 if (first == null) { 15349 if (first == null) {
15367 return second == null; 15350 return second == null;
15368 } else if (second == null) { 15351 } else if (second == null) {
15369 return false; 15352 return false;
15353 } else if (first.runtimeType != second.runtimeType) {
15354 return false;
15370 } 15355 }
15371 return first.offset == second.offset && first.length == second.length && fir st.lexeme == second.lexeme; 15356 _other = second;
15357 return first.accept(this);
15372 } 15358 }
15373 15359
15374 /** 15360 /**
15375 * Return `true` if the given arrays of tokens have the same length and corres ponding 15361 * Return `true` if the given arrays of tokens have the same length and corres ponding
15376 * elements are equal. 15362 * elements are equal.
15377 * 15363 *
15378 * @param first the first node being compared 15364 * @param first the first node being compared
15379 * @param second the second node being compared 15365 * @param second the second node being compared
15380 * @return `true` if the given arrays of tokens have the same length and corre sponding 15366 * @return `true` if the given arrays of tokens have the same length and corre sponding
15381 * elements are equal 15367 * elements are equal
15382 */ 15368 */
15383 bool isEqual7(List<Token> first, List<Token> second) { 15369 bool isEqualTokenLists(List<Token> first, List<Token> second) {
15384 int length = first.length; 15370 int length = first.length;
15385 if (second.length != length) { 15371 if (second.length != length) {
15386 return false; 15372 return false;
15387 } 15373 }
15388 for (int i = 0; i < length; i++) { 15374 for (int i = 0; i < length; i++) {
15389 if (isEqual6(first[i], second[i])) { 15375 if (isEqualTokens(first[i], second[i])) {
15390 return false; 15376 return false;
15391 } 15377 }
15392 } 15378 }
15393 return true; 15379 return true;
15394 } 15380 }
15381
15382 /**
15383 * Return `true` if the given tokens have the same structure.
15384 *
15385 * @param first the first node being compared
15386 * @param second the second node being compared
15387 * @return `true` if the given tokens have the same structure
15388 */
15389 bool isEqualTokens(Token first, Token second) {
15390 if (first == null) {
15391 return second == null;
15392 } else if (second == null) {
15393 return false;
15394 }
15395 return first.offset == second.offset && first.length == second.length && fir st.lexeme == second.lexeme;
15396 }
15395 } 15397 }
15396 15398
15397 /** 15399 /**
15398 * Instances of the class `IncrementalAstCloner` implement an object that will c lone any AST 15400 * Instances of the class `IncrementalAstCloner` implement an object that will c lone any AST
15399 * structure that it visits. The cloner will clone the structure, replacing the specified ASTNode 15401 * structure that it visits. The cloner will clone the structure, replacing the specified ASTNode
15400 * with a new ASTNode, mapping the old token stream to a new token stream, and p reserving resolution 15402 * with a new ASTNode, mapping the old token stream to a new token stream, and p reserving resolution
15401 * results. 15403 * results.
15402 */ 15404 */
15403 class IncrementalAstCloner implements AstVisitor<AstNode> { 15405 class IncrementalAstCloner implements AstVisitor<AstNode> {
15404 /** 15406 /**
(...skipping 18 matching lines...) Expand all
15423 * @param oldNode the node to be replaced 15425 * @param oldNode the node to be replaced
15424 * @param newNode the replacement node 15426 * @param newNode the replacement node
15425 * @param tokenMap a mapping of old tokens to new tokens (not `null`) 15427 * @param tokenMap a mapping of old tokens to new tokens (not `null`)
15426 */ 15428 */
15427 IncrementalAstCloner(AstNode oldNode, AstNode newNode, TokenMap tokenMap) { 15429 IncrementalAstCloner(AstNode oldNode, AstNode newNode, TokenMap tokenMap) {
15428 this._oldNode = oldNode; 15430 this._oldNode = oldNode;
15429 this._newNode = newNode; 15431 this._newNode = newNode;
15430 this._tokenMap = tokenMap; 15432 this._tokenMap = tokenMap;
15431 } 15433 }
15432 15434
15433 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(clone5(node.strings)); 15435 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => new AdjacentStri ngs(cloneNodeList(node.strings));
15434 15436
15435 Annotation visitAnnotation(Annotation node) { 15437 Annotation visitAnnotation(Annotation node) {
15436 Annotation copy = new Annotation(map(node.atSign), clone4(node.name), map(no de.period), clone4(node.constructorName), clone4(node.arguments)); 15438 Annotation copy = new Annotation(mapToken(node.atSign), cloneNode(node.name) , mapToken(node.period), cloneNode(node.constructorName), cloneNode(node.argumen ts));
15437 copy.element = node.element; 15439 copy.element = node.element;
15438 return copy; 15440 return copy;
15439 } 15441 }
15440 15442
15441 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) { 15443 ArgumentDefinitionTest visitArgumentDefinitionTest(ArgumentDefinitionTest node ) {
15442 ArgumentDefinitionTest copy = new ArgumentDefinitionTest(map(node.question), clone4(node.identifier)); 15444 ArgumentDefinitionTest copy = new ArgumentDefinitionTest(mapToken(node.quest ion), cloneNode(node.identifier));
15443 copy.propagatedType = node.propagatedType; 15445 copy.propagatedType = node.propagatedType;
15444 copy.staticType = node.staticType; 15446 copy.staticType = node.staticType;
15445 return copy; 15447 return copy;
15446 } 15448 }
15447 15449
15448 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(map(node .leftParenthesis), clone5(node.arguments), map(node.rightParenthesis)); 15450 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(mapToken (node.leftParenthesis), cloneNodeList(node.arguments), mapToken(node.rightParent hesis));
15449 15451
15450 AsExpression visitAsExpression(AsExpression node) { 15452 AsExpression visitAsExpression(AsExpression node) {
15451 AsExpression copy = new AsExpression(clone4(node.expression), map(node.asOpe rator), clone4(node.type)); 15453 AsExpression copy = new AsExpression(cloneNode(node.expression), mapToken(no de.asOperator), cloneNode(node.type));
15452 copy.propagatedType = node.propagatedType; 15454 copy.propagatedType = node.propagatedType;
15453 copy.staticType = node.staticType; 15455 copy.staticType = node.staticType;
15454 return copy; 15456 return copy;
15455 } 15457 }
15456 15458
15457 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(map( node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node.right Parenthesis), map(node.semicolon)); 15459 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(mapT oken(node.keyword), mapToken(node.leftParenthesis), cloneNode(node.condition), m apToken(node.rightParenthesis), mapToken(node.semicolon));
15458 15460
15459 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 15461 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
15460 AssignmentExpression copy = new AssignmentExpression(clone4(node.leftHandSid e), map(node.operator), clone4(node.rightHandSide)); 15462 AssignmentExpression copy = new AssignmentExpression(cloneNode(node.leftHand Side), mapToken(node.operator), cloneNode(node.rightHandSide));
15461 copy.propagatedElement = node.propagatedElement; 15463 copy.propagatedElement = node.propagatedElement;
15462 copy.propagatedType = node.propagatedType; 15464 copy.propagatedType = node.propagatedType;
15463 copy.staticElement = node.staticElement; 15465 copy.staticElement = node.staticElement;
15464 copy.staticType = node.staticType; 15466 copy.staticType = node.staticType;
15465 return copy; 15467 return copy;
15466 } 15468 }
15467 15469
15468 BinaryExpression visitBinaryExpression(BinaryExpression node) { 15470 BinaryExpression visitBinaryExpression(BinaryExpression node) {
15469 BinaryExpression copy = new BinaryExpression(clone4(node.leftOperand), map(n ode.operator), clone4(node.rightOperand)); 15471 BinaryExpression copy = new BinaryExpression(cloneNode(node.leftOperand), ma pToken(node.operator), cloneNode(node.rightOperand));
15470 copy.propagatedElement = node.propagatedElement; 15472 copy.propagatedElement = node.propagatedElement;
15471 copy.propagatedType = node.propagatedType; 15473 copy.propagatedType = node.propagatedType;
15472 copy.staticElement = node.staticElement; 15474 copy.staticElement = node.staticElement;
15473 copy.staticType = node.staticType; 15475 copy.staticType = node.staticType;
15474 return copy; 15476 return copy;
15475 } 15477 }
15476 15478
15477 Block visitBlock(Block node) => new Block(map(node.leftBracket), clone5(node.s tatements), map(node.rightBracket)); 15479 Block visitBlock(Block node) => new Block(mapToken(node.leftBracket), cloneNod eList(node.statements), mapToken(node.rightBracket));
15478 15480
15479 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(clone4(node.block)); 15481 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => new BlockF unctionBody(cloneNode(node.block));
15480 15482
15481 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 15483 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
15482 BooleanLiteral copy = new BooleanLiteral(map(node.literal), node.value); 15484 BooleanLiteral copy = new BooleanLiteral(mapToken(node.literal), node.value) ;
15483 copy.propagatedType = node.propagatedType; 15485 copy.propagatedType = node.propagatedType;
15484 copy.staticType = node.staticType; 15486 copy.staticType = node.staticType;
15485 return copy; 15487 return copy;
15486 } 15488 }
15487 15489
15488 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( map(node.keyword), clone4(node.label), map(node.semicolon)); 15490 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( mapToken(node.keyword), cloneNode(node.label), mapToken(node.semicolon));
15489 15491
15490 CascadeExpression visitCascadeExpression(CascadeExpression node) { 15492 CascadeExpression visitCascadeExpression(CascadeExpression node) {
15491 CascadeExpression copy = new CascadeExpression(clone4(node.target), clone5(n ode.cascadeSections)); 15493 CascadeExpression copy = new CascadeExpression(cloneNode(node.target), clone NodeList(node.cascadeSections));
15492 copy.propagatedType = node.propagatedType; 15494 copy.propagatedType = node.propagatedType;
15493 copy.staticType = node.staticType; 15495 copy.staticType = node.staticType;
15494 return copy; 15496 return copy;
15495 } 15497 }
15496 15498
15497 CatchClause visitCatchClause(CatchClause node) => new CatchClause(map(node.onK eyword), clone4(node.exceptionType), map(node.catchKeyword), map(node.leftParent hesis), clone4(node.exceptionParameter), map(node.comma), clone4(node.stackTrace Parameter), map(node.rightParenthesis), clone4(node.body)); 15499 CatchClause visitCatchClause(CatchClause node) => new CatchClause(mapToken(nod e.onKeyword), cloneNode(node.exceptionType), mapToken(node.catchKeyword), mapTok en(node.leftParenthesis), cloneNode(node.exceptionParameter), mapToken(node.comm a), cloneNode(node.stackTraceParameter), mapToken(node.rightParenthesis), cloneN ode(node.body));
15498 15500
15499 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 15501 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
15500 ClassDeclaration copy = new ClassDeclaration(clone4(node.documentationCommen t), clone5(node.metadata), map(node.abstractKeyword), map(node.classKeyword), cl one4(node.name), clone4(node.typeParameters), clone4(node.extendsClause), clone4 (node.withClause), clone4(node.implementsClause), map(node.leftBracket), clone5( node.members), map(node.rightBracket)); 15502 ClassDeclaration copy = new ClassDeclaration(cloneNode(node.documentationCom ment), cloneNodeList(node.metadata), mapToken(node.abstractKeyword), mapToken(no de.classKeyword), cloneNode(node.name), cloneNode(node.typeParameters), cloneNod e(node.extendsClause), cloneNode(node.withClause), cloneNode(node.implementsClau se), mapToken(node.leftBracket), cloneNodeList(node.members), mapToken(node.righ tBracket));
15501 copy.nativeClause = clone4(node.nativeClause); 15503 copy.nativeClause = cloneNode(node.nativeClause);
15502 return copy; 15504 return copy;
15503 } 15505 }
15504 15506
15505 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( clone4(node.documentationComment), clone5(node.metadata), map(node.keyword), clo ne4(node.name), clone4(node.typeParameters), map(node.equals), map(node.abstract Keyword), clone4(node.superclass), clone4(node.withClause), clone4(node.implemen tsClause), map(node.semicolon)); 15507 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapToken(nod e.keyword), cloneNode(node.name), cloneNode(node.typeParameters), mapToken(node. equals), mapToken(node.abstractKeyword), cloneNode(node.superclass), cloneNode(n ode.withClause), cloneNode(node.implementsClause), mapToken(node.semicolon));
15506 15508
15507 Comment visitComment(Comment node) { 15509 Comment visitComment(Comment node) {
15508 if (node.isDocumentation) { 15510 if (node.isDocumentation) {
15509 return Comment.createDocumentationComment2(map2(node.tokens), clone5(node. references)); 15511 return Comment.createDocumentationComment2(mapTokens(node.tokens), cloneNo deList(node.references));
15510 } else if (node.isBlock) { 15512 } else if (node.isBlock) {
15511 return Comment.createBlockComment(map2(node.tokens)); 15513 return Comment.createBlockComment(mapTokens(node.tokens));
15512 } 15514 }
15513 return Comment.createEndOfLineComment(map2(node.tokens)); 15515 return Comment.createEndOfLineComment(mapTokens(node.tokens));
15514 } 15516 }
15515 15517
15516 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(map(node.newKeyword), clone4(node.identifier)); 15518 CommentReference visitCommentReference(CommentReference node) => new CommentRe ference(mapToken(node.newKeyword), cloneNode(node.identifier));
15517 15519
15518 CompilationUnit visitCompilationUnit(CompilationUnit node) { 15520 CompilationUnit visitCompilationUnit(CompilationUnit node) {
15519 CompilationUnit copy = new CompilationUnit(map(node.beginToken), clone4(node .scriptTag), clone5(node.directives), clone5(node.declarations), map(node.endTok en)); 15521 CompilationUnit copy = new CompilationUnit(mapToken(node.beginToken), cloneN ode(node.scriptTag), cloneNodeList(node.directives), cloneNodeList(node.declarat ions), mapToken(node.endToken));
15520 copy.lineInfo = node.lineInfo; 15522 copy.lineInfo = node.lineInfo;
15521 copy.element = node.element; 15523 copy.element = node.element;
15522 return copy; 15524 return copy;
15523 } 15525 }
15524 15526
15525 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 15527 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
15526 ConditionalExpression copy = new ConditionalExpression(clone4(node.condition ), map(node.question), clone4(node.thenExpression), map(node.colon), clone4(node .elseExpression)); 15528 ConditionalExpression copy = new ConditionalExpression(cloneNode(node.condit ion), mapToken(node.question), cloneNode(node.thenExpression), mapToken(node.col on), cloneNode(node.elseExpression));
15527 copy.propagatedType = node.propagatedType; 15529 copy.propagatedType = node.propagatedType;
15528 copy.staticType = node.staticType; 15530 copy.staticType = node.staticType;
15529 return copy; 15531 return copy;
15530 } 15532 }
15531 15533
15532 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) { 15534 ConstructorDeclaration visitConstructorDeclaration(ConstructorDeclaration node ) {
15533 ConstructorDeclaration copy = new ConstructorDeclaration(clone4(node.documen tationComment), clone5(node.metadata), map(node.externalKeyword), map(node.const Keyword), map(node.factoryKeyword), clone4(node.returnType), map(node.period), c lone4(node.name), clone4(node.parameters), map(node.separator), clone5(node.init ializers), clone4(node.redirectedConstructor), clone4(node.body)); 15535 ConstructorDeclaration copy = new ConstructorDeclaration(cloneNode(node.docu mentationComment), cloneNodeList(node.metadata), mapToken(node.externalKeyword), mapToken(node.constKeyword), mapToken(node.factoryKeyword), cloneNode(node.retu rnType), mapToken(node.period), cloneNode(node.name), cloneNode(node.parameters) , mapToken(node.separator), cloneNodeList(node.initializers), cloneNode(node.red irectedConstructor), cloneNode(node.body));
15534 copy.element = node.element; 15536 copy.element = node.element;
15535 return copy; 15537 return copy;
15536 } 15538 }
15537 15539
15538 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(map(node.keyword), map(node. period), clone4(node.fieldName), map(node.equals), clone4(node.expression)); 15540 ConstructorFieldInitializer visitConstructorFieldInitializer(ConstructorFieldI nitializer node) => new ConstructorFieldInitializer(mapToken(node.keyword), mapT oken(node.period), cloneNode(node.fieldName), mapToken(node.equals), cloneNode(n ode.expression));
15539 15541
15540 ConstructorName visitConstructorName(ConstructorName node) { 15542 ConstructorName visitConstructorName(ConstructorName node) {
15541 ConstructorName copy = new ConstructorName(clone4(node.type), map(node.perio d), clone4(node.name)); 15543 ConstructorName copy = new ConstructorName(cloneNode(node.type), mapToken(no de.period), cloneNode(node.name));
15542 copy.staticElement = node.staticElement; 15544 copy.staticElement = node.staticElement;
15543 return copy; 15545 return copy;
15544 } 15546 }
15545 15547
15546 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(map(node.keyword), clone4(node.label), map(node.semicolon)); 15548 ContinueStatement visitContinueStatement(ContinueStatement node) => new Contin ueStatement(mapToken(node.keyword), cloneNode(node.label), mapToken(node.semicol on));
15547 15549
15548 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(clone4(node.documentationComment), clone5(node.metadata), map(no de.keyword), clone4(node.type), clone4(node.identifier)); 15550 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => new Dec laredIdentifier(cloneNode(node.documentationComment), cloneNodeList(node.metadat a), mapToken(node.keyword), cloneNode(node.type), cloneNode(node.identifier));
15549 15551
15550 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(clone4(node.parameter), node.kind, map(node.sepa rator), clone4(node.defaultValue)); 15552 DefaultFormalParameter visitDefaultFormalParameter(DefaultFormalParameter node ) => new DefaultFormalParameter(cloneNode(node.parameter), node.kind, mapToken(n ode.separator), cloneNode(node.defaultValue));
15551 15553
15552 DoStatement visitDoStatement(DoStatement node) => new DoStatement(map(node.doK eyword), clone4(node.body), map(node.whileKeyword), map(node.leftParenthesis), c lone4(node.condition), map(node.rightParenthesis), map(node.semicolon)); 15554 DoStatement visitDoStatement(DoStatement node) => new DoStatement(mapToken(nod e.doKeyword), cloneNode(node.body), mapToken(node.whileKeyword), mapToken(node.l eftParenthesis), cloneNode(node.condition), mapToken(node.rightParenthesis), map Token(node.semicolon));
15553 15555
15554 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 15556 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
15555 DoubleLiteral copy = new DoubleLiteral(map(node.literal), node.value); 15557 DoubleLiteral copy = new DoubleLiteral(mapToken(node.literal), node.value);
15556 copy.propagatedType = node.propagatedType; 15558 copy.propagatedType = node.propagatedType;
15557 copy.staticType = node.staticType; 15559 copy.staticType = node.staticType;
15558 return copy; 15560 return copy;
15559 } 15561 }
15560 15562
15561 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(map(node.semicolon)); 15563 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => new EmptyF unctionBody(mapToken(node.semicolon));
15562 15564
15563 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( map(node.semicolon)); 15565 EmptyStatement visitEmptyStatement(EmptyStatement node) => new EmptyStatement( mapToken(node.semicolon));
15564 15566
15565 ExportDirective visitExportDirective(ExportDirective node) { 15567 ExportDirective visitExportDirective(ExportDirective node) {
15566 ExportDirective copy = new ExportDirective(clone4(node.documentationComment) , clone5(node.metadata), map(node.keyword), clone4(node.uri), clone5(node.combin ators), map(node.semicolon)); 15568 ExportDirective copy = new ExportDirective(cloneNode(node.documentationComme nt), cloneNodeList(node.metadata), mapToken(node.keyword), cloneNode(node.uri), cloneNodeList(node.combinators), mapToken(node.semicolon));
15567 copy.element = node.element; 15569 copy.element = node.element;
15568 return copy; 15570 return copy;
15569 } 15571 }
15570 15572
15571 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(map(node.functionDefinition), clone4(node.expres sion), map(node.semicolon)); 15573 ExpressionFunctionBody visitExpressionFunctionBody(ExpressionFunctionBody node ) => new ExpressionFunctionBody(mapToken(node.functionDefinition), cloneNode(nod e.expression), mapToken(node.semicolon));
15572 15574
15573 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(clone4(node.expression), map(node.semicolon)); 15575 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => new ExpressionStatement(cloneNode(node.expression), mapToken(node.semicolon));
15574 15576
15575 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(map( node.keyword), clone4(node.superclass)); 15577 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(mapT oken(node.keyword), cloneNode(node.superclass));
15576 15578
15577 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(clone4(node.documentationComment), clone5(node.metadata), map(node.stati cKeyword), clone4(node.fields), map(node.semicolon)); 15579 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => new FieldDecl aration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapT oken(node.staticKeyword), cloneNode(node.fields), mapToken(node.semicolon));
15578 15580
15579 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(clone4(node.documentationComment), clone5(node.metadata) , map(node.keyword), clone4(node.type), map(node.thisToken), map(node.period), c lone4(node.identifier), clone4(node.parameters)); 15581 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => n ew FieldFormalParameter(cloneNode(node.documentationComment), cloneNodeList(node .metadata), mapToken(node.keyword), cloneNode(node.type), mapToken(node.thisToke n), mapToken(node.period), cloneNode(node.identifier), cloneNode(node.parameters ));
15580 15582
15581 ForEachStatement visitForEachStatement(ForEachStatement node) { 15583 ForEachStatement visitForEachStatement(ForEachStatement node) {
15582 DeclaredIdentifier loopVariable = node.loopVariable; 15584 DeclaredIdentifier loopVariable = node.loopVariable;
15583 if (loopVariable == null) { 15585 if (loopVariable == null) {
15584 return new ForEachStatement.con2(map(node.forKeyword), map(node.leftParent hesis), clone4(node.identifier), map(node.inKeyword), clone4(node.iterator), map (node.rightParenthesis), clone4(node.body)); 15586 return new ForEachStatement.con2(mapToken(node.forKeyword), mapToken(node. leftParenthesis), cloneNode(node.identifier), mapToken(node.inKeyword), cloneNod e(node.iterator), mapToken(node.rightParenthesis), cloneNode(node.body));
15585 } 15587 }
15586 return new ForEachStatement.con1(map(node.forKeyword), map(node.leftParenthe sis), clone4(loopVariable), map(node.inKeyword), clone4(node.iterator), map(node .rightParenthesis), clone4(node.body)); 15588 return new ForEachStatement.con1(mapToken(node.forKeyword), mapToken(node.le ftParenthesis), cloneNode(loopVariable), mapToken(node.inKeyword), cloneNode(nod e.iterator), mapToken(node.rightParenthesis), cloneNode(node.body));
15587 } 15589 }
15588 15590
15589 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(map(node.leftParenthesis), clone5(node.parameters), map(node .leftDelimiter), map(node.rightDelimiter), map(node.rightParenthesis)); 15591 FormalParameterList visitFormalParameterList(FormalParameterList node) => new FormalParameterList(mapToken(node.leftParenthesis), cloneNodeList(node.parameter s), mapToken(node.leftDelimiter), mapToken(node.rightDelimiter), mapToken(node.r ightParenthesis));
15590 15592
15591 ForStatement visitForStatement(ForStatement node) => new ForStatement(map(node .forKeyword), map(node.leftParenthesis), clone4(node.variables), clone4(node.ini tialization), map(node.leftSeparator), clone4(node.condition), map(node.rightSep arator), clone5(node.updaters), map(node.rightParenthesis), clone4(node.body)); 15593 ForStatement visitForStatement(ForStatement node) => new ForStatement(mapToken (node.forKeyword), mapToken(node.leftParenthesis), cloneNode(node.variables), cl oneNode(node.initialization), mapToken(node.leftSeparator), cloneNode(node.condi tion), mapToken(node.rightSeparator), cloneNodeList(node.updaters), mapToken(nod e.rightParenthesis), cloneNode(node.body));
15592 15594
15593 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(clone4(node.documentationComment), clone5(node.metadata), ma p(node.externalKeyword), clone4(node.returnType), map(node.propertyKeyword), clo ne4(node.name), clone4(node.functionExpression)); 15595 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => new FunctionDeclaration(cloneNode(node.documentationComment), cloneNodeList(node.met adata), mapToken(node.externalKeyword), cloneNode(node.returnType), mapToken(nod e.propertyKeyword), cloneNode(node.name), cloneNode(node.functionExpression));
15594 15596
15595 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(clone4(node.functionDecl aration)); 15597 FunctionDeclarationStatement visitFunctionDeclarationStatement(FunctionDeclara tionStatement node) => new FunctionDeclarationStatement(cloneNode(node.functionD eclaration));
15596 15598
15597 FunctionExpression visitFunctionExpression(FunctionExpression node) { 15599 FunctionExpression visitFunctionExpression(FunctionExpression node) {
15598 FunctionExpression copy = new FunctionExpression(clone4(node.parameters), cl one4(node.body)); 15600 FunctionExpression copy = new FunctionExpression(cloneNode(node.parameters), cloneNode(node.body));
15599 copy.element = node.element; 15601 copy.element = node.element;
15600 copy.propagatedType = node.propagatedType; 15602 copy.propagatedType = node.propagatedType;
15601 copy.staticType = node.staticType; 15603 copy.staticType = node.staticType;
15602 return copy; 15604 return copy;
15603 } 15605 }
15604 15606
15605 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) { 15607 FunctionExpressionInvocation visitFunctionExpressionInvocation(FunctionExpress ionInvocation node) {
15606 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(clone4( node.function), clone4(node.argumentList)); 15608 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(cloneNo de(node.function), cloneNode(node.argumentList));
15607 copy.propagatedElement = node.propagatedElement; 15609 copy.propagatedElement = node.propagatedElement;
15608 copy.propagatedType = node.propagatedType; 15610 copy.propagatedType = node.propagatedType;
15609 copy.staticElement = node.staticElement; 15611 copy.staticElement = node.staticElement;
15610 copy.staticType = node.staticType; 15612 copy.staticType = node.staticType;
15611 return copy; 15613 return copy;
15612 } 15614 }
15613 15615
15614 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(clone4(node.documentationComment), clone5(node.metadata), map(node.k eyword), clone4(node.returnType), clone4(node.name), clone4(node.typeParameters) , clone4(node.parameters), map(node.semicolon)); 15616 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => new Functi onTypeAlias(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapToken(node.keyword), cloneNode(node.returnType), cloneNode(node.name), cloneN ode(node.typeParameters), cloneNode(node.parameters), mapToken(node.semicolon));
15615 15617
15616 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(clone4(node.documentatio nComment), clone5(node.metadata), clone4(node.returnType), clone4(node.identifie r), clone4(node.parameters)); 15618 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(FunctionTypedFo rmalParameter node) => new FunctionTypedFormalParameter(cloneNode(node.documenta tionComment), cloneNodeList(node.metadata), cloneNode(node.returnType), cloneNod e(node.identifier), cloneNode(node.parameters));
15617 15619
15618 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( map(node.keyword), clone5(node.hiddenNames)); 15620 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( mapToken(node.keyword), cloneNodeList(node.hiddenNames));
15619 15621
15620 IfStatement visitIfStatement(IfStatement node) => new IfStatement(map(node.ifK eyword), map(node.leftParenthesis), clone4(node.condition), map(node.rightParent hesis), clone4(node.thenStatement), map(node.elseKeyword), clone4(node.elseState ment)); 15622 IfStatement visitIfStatement(IfStatement node) => new IfStatement(mapToken(nod e.ifKeyword), mapToken(node.leftParenthesis), cloneNode(node.condition), mapToke n(node.rightParenthesis), cloneNode(node.thenStatement), mapToken(node.elseKeywo rd), cloneNode(node.elseStatement));
15621 15623
15622 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(map(node.keyword), clone5(node.interfaces)); 15624 ImplementsClause visitImplementsClause(ImplementsClause node) => new Implement sClause(mapToken(node.keyword), cloneNodeList(node.interfaces));
15623 15625
15624 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(clone4(node.documentationComment), clone5(node.metadata), map(node.keyword), clone4(node.uri), map(node.asToken), clone4(node.prefix), clone5(node.combinato rs), map(node.semicolon)); 15626 ImportDirective visitImportDirective(ImportDirective node) => new ImportDirect ive(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapToken (node.keyword), cloneNode(node.uri), mapToken(node.asToken), cloneNode(node.pref ix), cloneNodeList(node.combinators), mapToken(node.semicolon));
15625 15627
15626 IndexExpression visitIndexExpression(IndexExpression node) { 15628 IndexExpression visitIndexExpression(IndexExpression node) {
15627 Token period = map(node.period); 15629 Token period = mapToken(node.period);
15628 IndexExpression copy; 15630 IndexExpression copy;
15629 if (period == null) { 15631 if (period == null) {
15630 copy = new IndexExpression.forTarget(clone4(node.target), map(node.leftBra cket), clone4(node.index), map(node.rightBracket)); 15632 copy = new IndexExpression.forTarget(cloneNode(node.target), mapToken(node .leftBracket), cloneNode(node.index), mapToken(node.rightBracket));
15631 } else { 15633 } else {
15632 copy = new IndexExpression.forCascade(period, map(node.leftBracket), clone 4(node.index), map(node.rightBracket)); 15634 copy = new IndexExpression.forCascade(period, mapToken(node.leftBracket), cloneNode(node.index), mapToken(node.rightBracket));
15633 } 15635 }
15634 copy.auxiliaryElements = node.auxiliaryElements; 15636 copy.auxiliaryElements = node.auxiliaryElements;
15635 copy.propagatedElement = node.propagatedElement; 15637 copy.propagatedElement = node.propagatedElement;
15636 copy.propagatedType = node.propagatedType; 15638 copy.propagatedType = node.propagatedType;
15637 copy.staticElement = node.staticElement; 15639 copy.staticElement = node.staticElement;
15638 copy.staticType = node.staticType; 15640 copy.staticType = node.staticType;
15639 return copy; 15641 return copy;
15640 } 15642 }
15641 15643
15642 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) { 15644 InstanceCreationExpression visitInstanceCreationExpression(InstanceCreationExp ression node) {
15643 InstanceCreationExpression copy = new InstanceCreationExpression(map(node.ke yword), clone4(node.constructorName), clone4(node.argumentList)); 15645 InstanceCreationExpression copy = new InstanceCreationExpression(mapToken(no de.keyword), cloneNode(node.constructorName), cloneNode(node.argumentList));
15644 copy.propagatedType = node.propagatedType; 15646 copy.propagatedType = node.propagatedType;
15645 copy.staticElement = node.staticElement; 15647 copy.staticElement = node.staticElement;
15646 copy.staticType = node.staticType; 15648 copy.staticType = node.staticType;
15647 return copy; 15649 return copy;
15648 } 15650 }
15649 15651
15650 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 15652 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
15651 IntegerLiteral copy = new IntegerLiteral(map(node.literal), node.value); 15653 IntegerLiteral copy = new IntegerLiteral(mapToken(node.literal), node.value) ;
15652 copy.propagatedType = node.propagatedType; 15654 copy.propagatedType = node.propagatedType;
15653 copy.staticType = node.staticType; 15655 copy.staticType = node.staticType;
15654 return copy; 15656 return copy;
15655 } 15657 }
15656 15658
15657 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(map(node.leftBracket), clone4(node.expressio n), map(node.rightBracket)); 15659 InterpolationExpression visitInterpolationExpression(InterpolationExpression n ode) => new InterpolationExpression(mapToken(node.leftBracket), cloneNode(node.e xpression), mapToken(node.rightBracket));
15658 15660
15659 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(map(node.contents), node.value); 15661 InterpolationString visitInterpolationString(InterpolationString node) => new InterpolationString(mapToken(node.contents), node.value);
15660 15662
15661 IsExpression visitIsExpression(IsExpression node) { 15663 IsExpression visitIsExpression(IsExpression node) {
15662 IsExpression copy = new IsExpression(clone4(node.expression), map(node.isOpe rator), map(node.notOperator), clone4(node.type)); 15664 IsExpression copy = new IsExpression(cloneNode(node.expression), mapToken(no de.isOperator), mapToken(node.notOperator), cloneNode(node.type));
15663 copy.propagatedType = node.propagatedType; 15665 copy.propagatedType = node.propagatedType;
15664 copy.staticType = node.staticType; 15666 copy.staticType = node.staticType;
15665 return copy; 15667 return copy;
15666 } 15668 }
15667 15669
15668 Label visitLabel(Label node) => new Label(clone4(node.label), map(node.colon)) ; 15670 Label visitLabel(Label node) => new Label(cloneNode(node.label), mapToken(node .colon));
15669 15671
15670 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(clone5(node.labels), clone4(node.statement)); 15672 LabeledStatement visitLabeledStatement(LabeledStatement node) => new LabeledSt atement(cloneNodeList(node.labels), cloneNode(node.statement));
15671 15673
15672 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(clone4(node.documentationComment), clone5(node.metadata), map(node.libra ryToken), clone4(node.name), map(node.semicolon)); 15674 LibraryDirective visitLibraryDirective(LibraryDirective node) => new LibraryDi rective(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapT oken(node.libraryToken), cloneNode(node.name), mapToken(node.semicolon));
15673 15675
15674 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 15676 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
15675 LibraryIdentifier copy = new LibraryIdentifier(clone5(node.components)); 15677 LibraryIdentifier copy = new LibraryIdentifier(cloneNodeList(node.components ));
15676 copy.propagatedType = node.propagatedType; 15678 copy.propagatedType = node.propagatedType;
15677 copy.staticType = node.staticType; 15679 copy.staticType = node.staticType;
15678 return copy; 15680 return copy;
15679 } 15681 }
15680 15682
15681 ListLiteral visitListLiteral(ListLiteral node) { 15683 ListLiteral visitListLiteral(ListLiteral node) {
15682 ListLiteral copy = new ListLiteral(map(node.constKeyword), clone4(node.typeA rguments), map(node.leftBracket), clone5(node.elements), map(node.rightBracket)) ; 15684 ListLiteral copy = new ListLiteral(mapToken(node.constKeyword), cloneNode(no de.typeArguments), mapToken(node.leftBracket), cloneNodeList(node.elements), map Token(node.rightBracket));
15683 copy.propagatedType = node.propagatedType; 15685 copy.propagatedType = node.propagatedType;
15684 copy.staticType = node.staticType; 15686 copy.staticType = node.staticType;
15685 return copy; 15687 return copy;
15686 } 15688 }
15687 15689
15688 MapLiteral visitMapLiteral(MapLiteral node) { 15690 MapLiteral visitMapLiteral(MapLiteral node) {
15689 MapLiteral copy = new MapLiteral(map(node.constKeyword), clone4(node.typeArg uments), map(node.leftBracket), clone5(node.entries), map(node.rightBracket)); 15691 MapLiteral copy = new MapLiteral(mapToken(node.constKeyword), cloneNode(node .typeArguments), mapToken(node.leftBracket), cloneNodeList(node.entries), mapTok en(node.rightBracket));
15690 copy.propagatedType = node.propagatedType; 15692 copy.propagatedType = node.propagatedType;
15691 copy.staticType = node.staticType; 15693 copy.staticType = node.staticType;
15692 return copy; 15694 return copy;
15693 } 15695 }
15694 15696
15695 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(clone4(node.key), map(node.separator), clone4(node.value)); 15697 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => new MapLiteralEn try(cloneNode(node.key), mapToken(node.separator), cloneNode(node.value));
15696 15698
15697 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(clone4(node.documentationComment), clone5(node.metadata), map(node.e xternalKeyword), map(node.modifierKeyword), clone4(node.returnType), map(node.pr opertyKeyword), map(node.operatorKeyword), clone4(node.name), clone4(node.parame ters), clone4(node.body)); 15699 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => new Method Declaration(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapToken(node.externalKeyword), mapToken(node.modifierKeyword), cloneNode(node.r eturnType), mapToken(node.propertyKeyword), mapToken(node.operatorKeyword), clon eNode(node.name), cloneNode(node.parameters), cloneNode(node.body));
15698 15700
15699 MethodInvocation visitMethodInvocation(MethodInvocation node) { 15701 MethodInvocation visitMethodInvocation(MethodInvocation node) {
15700 MethodInvocation copy = new MethodInvocation(clone4(node.target), map(node.p eriod), clone4(node.methodName), clone4(node.argumentList)); 15702 MethodInvocation copy = new MethodInvocation(cloneNode(node.target), mapToke n(node.period), cloneNode(node.methodName), cloneNode(node.argumentList));
15701 copy.propagatedType = node.propagatedType; 15703 copy.propagatedType = node.propagatedType;
15702 copy.staticType = node.staticType; 15704 copy.staticType = node.staticType;
15703 return copy; 15705 return copy;
15704 } 15706 }
15705 15707
15706 NamedExpression visitNamedExpression(NamedExpression node) { 15708 NamedExpression visitNamedExpression(NamedExpression node) {
15707 NamedExpression copy = new NamedExpression(clone4(node.name), clone4(node.ex pression)); 15709 NamedExpression copy = new NamedExpression(cloneNode(node.name), cloneNode(n ode.expression));
15708 copy.propagatedType = node.propagatedType; 15710 copy.propagatedType = node.propagatedType;
15709 copy.staticType = node.staticType; 15711 copy.staticType = node.staticType;
15710 return copy; 15712 return copy;
15711 } 15713 }
15712 15714
15713 AstNode visitNativeClause(NativeClause node) => new NativeClause(map(node.keyw ord), clone4(node.name)); 15715 AstNode visitNativeClause(NativeClause node) => new NativeClause(mapToken(node .keyword), cloneNode(node.name));
15714 15716
15715 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(map(node.nativeToken), clone4(node.stringLiteral), map(node.semi colon)); 15717 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => new Nat iveFunctionBody(mapToken(node.nativeToken), cloneNode(node.stringLiteral), mapTo ken(node.semicolon));
15716 15718
15717 NullLiteral visitNullLiteral(NullLiteral node) { 15719 NullLiteral visitNullLiteral(NullLiteral node) {
15718 NullLiteral copy = new NullLiteral(map(node.literal)); 15720 NullLiteral copy = new NullLiteral(mapToken(node.literal));
15719 copy.propagatedType = node.propagatedType; 15721 copy.propagatedType = node.propagatedType;
15720 copy.staticType = node.staticType; 15722 copy.staticType = node.staticType;
15721 return copy; 15723 return copy;
15722 } 15724 }
15723 15725
15724 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) { 15726 ParenthesizedExpression visitParenthesizedExpression(ParenthesizedExpression n ode) {
15725 ParenthesizedExpression copy = new ParenthesizedExpression(map(node.leftPare nthesis), clone4(node.expression), map(node.rightParenthesis)); 15727 ParenthesizedExpression copy = new ParenthesizedExpression(mapToken(node.lef tParenthesis), cloneNode(node.expression), mapToken(node.rightParenthesis));
15726 copy.propagatedType = node.propagatedType; 15728 copy.propagatedType = node.propagatedType;
15727 copy.staticType = node.staticType; 15729 copy.staticType = node.staticType;
15728 return copy; 15730 return copy;
15729 } 15731 }
15730 15732
15731 PartDirective visitPartDirective(PartDirective node) { 15733 PartDirective visitPartDirective(PartDirective node) {
15732 PartDirective copy = new PartDirective(clone4(node.documentationComment), cl one5(node.metadata), map(node.partToken), clone4(node.uri), map(node.semicolon)) ; 15734 PartDirective copy = new PartDirective(cloneNode(node.documentationComment), cloneNodeList(node.metadata), mapToken(node.partToken), cloneNode(node.uri), ma pToken(node.semicolon));
15733 copy.element = node.element; 15735 copy.element = node.element;
15734 return copy; 15736 return copy;
15735 } 15737 }
15736 15738
15737 PartOfDirective visitPartOfDirective(PartOfDirective node) { 15739 PartOfDirective visitPartOfDirective(PartOfDirective node) {
15738 PartOfDirective copy = new PartOfDirective(clone4(node.documentationComment) , clone5(node.metadata), map(node.partToken), map(node.ofToken), clone4(node.lib raryName), map(node.semicolon)); 15740 PartOfDirective copy = new PartOfDirective(cloneNode(node.documentationComme nt), cloneNodeList(node.metadata), mapToken(node.partToken), mapToken(node.ofTok en), cloneNode(node.libraryName), mapToken(node.semicolon));
15739 copy.element = node.element; 15741 copy.element = node.element;
15740 return copy; 15742 return copy;
15741 } 15743 }
15742 15744
15743 PostfixExpression visitPostfixExpression(PostfixExpression node) { 15745 PostfixExpression visitPostfixExpression(PostfixExpression node) {
15744 PostfixExpression copy = new PostfixExpression(clone4(node.operand), map(nod e.operator)); 15746 PostfixExpression copy = new PostfixExpression(cloneNode(node.operand), mapT oken(node.operator));
15745 copy.propagatedElement = node.propagatedElement; 15747 copy.propagatedElement = node.propagatedElement;
15746 copy.propagatedType = node.propagatedType; 15748 copy.propagatedType = node.propagatedType;
15747 copy.staticElement = node.staticElement; 15749 copy.staticElement = node.staticElement;
15748 copy.staticType = node.staticType; 15750 copy.staticType = node.staticType;
15749 return copy; 15751 return copy;
15750 } 15752 }
15751 15753
15752 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { 15754 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) {
15753 PrefixedIdentifier copy = new PrefixedIdentifier(clone4(node.prefix), map(no de.period), clone4(node.identifier)); 15755 PrefixedIdentifier copy = new PrefixedIdentifier(cloneNode(node.prefix), map Token(node.period), cloneNode(node.identifier));
15754 copy.propagatedType = node.propagatedType; 15756 copy.propagatedType = node.propagatedType;
15755 copy.staticType = node.staticType; 15757 copy.staticType = node.staticType;
15756 return copy; 15758 return copy;
15757 } 15759 }
15758 15760
15759 PrefixExpression visitPrefixExpression(PrefixExpression node) { 15761 PrefixExpression visitPrefixExpression(PrefixExpression node) {
15760 PrefixExpression copy = new PrefixExpression(map(node.operator), clone4(node .operand)); 15762 PrefixExpression copy = new PrefixExpression(mapToken(node.operator), cloneN ode(node.operand));
15761 copy.propagatedElement = node.propagatedElement; 15763 copy.propagatedElement = node.propagatedElement;
15762 copy.propagatedType = node.propagatedType; 15764 copy.propagatedType = node.propagatedType;
15763 copy.staticElement = node.staticElement; 15765 copy.staticElement = node.staticElement;
15764 copy.staticType = node.staticType; 15766 copy.staticType = node.staticType;
15765 return copy; 15767 return copy;
15766 } 15768 }
15767 15769
15768 PropertyAccess visitPropertyAccess(PropertyAccess node) { 15770 PropertyAccess visitPropertyAccess(PropertyAccess node) {
15769 PropertyAccess copy = new PropertyAccess(clone4(node.target), map(node.opera tor), clone4(node.propertyName)); 15771 PropertyAccess copy = new PropertyAccess(cloneNode(node.target), mapToken(no de.operator), cloneNode(node.propertyName));
15770 copy.propagatedType = node.propagatedType; 15772 copy.propagatedType = node.propagatedType;
15771 copy.staticType = node.staticType; 15773 copy.staticType = node.staticType;
15772 return copy; 15774 return copy;
15773 } 15775 }
15774 15776
15775 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) { 15777 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(Redirec tingConstructorInvocation node) {
15776 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation (map(node.keyword), map(node.period), clone4(node.constructorName), clone4(node. argumentList)); 15778 RedirectingConstructorInvocation copy = new RedirectingConstructorInvocation (mapToken(node.keyword), mapToken(node.period), cloneNode(node.constructorName), cloneNode(node.argumentList));
15777 copy.staticElement = node.staticElement; 15779 copy.staticElement = node.staticElement;
15778 return copy; 15780 return copy;
15779 } 15781 }
15780 15782
15781 RethrowExpression visitRethrowExpression(RethrowExpression node) { 15783 RethrowExpression visitRethrowExpression(RethrowExpression node) {
15782 RethrowExpression copy = new RethrowExpression(map(node.keyword)); 15784 RethrowExpression copy = new RethrowExpression(mapToken(node.keyword));
15783 copy.propagatedType = node.propagatedType; 15785 copy.propagatedType = node.propagatedType;
15784 copy.staticType = node.staticType; 15786 copy.staticType = node.staticType;
15785 return copy; 15787 return copy;
15786 } 15788 }
15787 15789
15788 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(map(node.keyword), clone4(node.expression), map(node.semicolon)); 15790 ReturnStatement visitReturnStatement(ReturnStatement node) => new ReturnStatem ent(mapToken(node.keyword), cloneNode(node.expression), mapToken(node.semicolon) );
15789 15791
15790 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(map(node.scriptTag)) ; 15792 ScriptTag visitScriptTag(ScriptTag node) => new ScriptTag(mapToken(node.script Tag));
15791 15793
15792 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( map(node.keyword), clone5(node.shownNames)); 15794 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( mapToken(node.keyword), cloneNodeList(node.shownNames));
15793 15795
15794 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(clone4(node.documentationComment), clone5(node.metad ata), map(node.keyword), clone4(node.type), clone4(node.identifier)); 15796 SimpleFormalParameter visitSimpleFormalParameter(SimpleFormalParameter node) = > new SimpleFormalParameter(cloneNode(node.documentationComment), cloneNodeList( node.metadata), mapToken(node.keyword), cloneNode(node.type), cloneNode(node.ide ntifier));
15795 15797
15796 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 15798 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
15797 Token mappedToken = map(node.token); 15799 Token mappedToken = mapToken(node.token);
15798 if (mappedToken == null) { 15800 if (mappedToken == null) {
15799 // This only happens for SimpleIdentifiers created by the parser as part o f scanning 15801 // This only happens for SimpleIdentifiers created by the parser as part o f scanning
15800 // documentation comments (the tokens for those identifiers are not in the original token 15802 // documentation comments (the tokens for those identifiers are not in the original token
15801 // stream and hence do not get copied). This extra check can be removed if the scanner is 15803 // stream and hence do not get copied). This extra check can be removed if the scanner is
15802 // changed to scan documentation comments for the parser. 15804 // changed to scan documentation comments for the parser.
15803 mappedToken = node.token; 15805 mappedToken = node.token;
15804 } 15806 }
15805 SimpleIdentifier copy = new SimpleIdentifier(mappedToken); 15807 SimpleIdentifier copy = new SimpleIdentifier(mappedToken);
15806 copy.auxiliaryElements = node.auxiliaryElements; 15808 copy.auxiliaryElements = node.auxiliaryElements;
15807 copy.propagatedElement = node.propagatedElement; 15809 copy.propagatedElement = node.propagatedElement;
15808 copy.propagatedType = node.propagatedType; 15810 copy.propagatedType = node.propagatedType;
15809 copy.staticElement = node.staticElement; 15811 copy.staticElement = node.staticElement;
15810 copy.staticType = node.staticType; 15812 copy.staticType = node.staticType;
15811 return copy; 15813 return copy;
15812 } 15814 }
15813 15815
15814 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { 15816 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) {
15815 SimpleStringLiteral copy = new SimpleStringLiteral(map(node.literal), node.v alue); 15817 SimpleStringLiteral copy = new SimpleStringLiteral(mapToken(node.literal), n ode.value);
15816 copy.propagatedType = node.propagatedType; 15818 copy.propagatedType = node.propagatedType;
15817 copy.staticType = node.staticType; 15819 copy.staticType = node.staticType;
15818 return copy; 15820 return copy;
15819 } 15821 }
15820 15822
15821 StringInterpolation visitStringInterpolation(StringInterpolation node) { 15823 StringInterpolation visitStringInterpolation(StringInterpolation node) {
15822 StringInterpolation copy = new StringInterpolation(clone5(node.elements)); 15824 StringInterpolation copy = new StringInterpolation(cloneNodeList(node.elemen ts));
15823 copy.propagatedType = node.propagatedType; 15825 copy.propagatedType = node.propagatedType;
15824 copy.staticType = node.staticType; 15826 copy.staticType = node.staticType;
15825 return copy; 15827 return copy;
15826 } 15828 }
15827 15829
15828 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) { 15830 SuperConstructorInvocation visitSuperConstructorInvocation(SuperConstructorInv ocation node) {
15829 SuperConstructorInvocation copy = new SuperConstructorInvocation(map(node.ke yword), map(node.period), clone4(node.constructorName), clone4(node.argumentList )); 15831 SuperConstructorInvocation copy = new SuperConstructorInvocation(mapToken(no de.keyword), mapToken(node.period), cloneNode(node.constructorName), cloneNode(n ode.argumentList));
15830 copy.staticElement = node.staticElement; 15832 copy.staticElement = node.staticElement;
15831 return copy; 15833 return copy;
15832 } 15834 }
15833 15835
15834 SuperExpression visitSuperExpression(SuperExpression node) { 15836 SuperExpression visitSuperExpression(SuperExpression node) {
15835 SuperExpression copy = new SuperExpression(map(node.keyword)); 15837 SuperExpression copy = new SuperExpression(mapToken(node.keyword));
15836 copy.propagatedType = node.propagatedType; 15838 copy.propagatedType = node.propagatedType;
15837 copy.staticType = node.staticType; 15839 copy.staticType = node.staticType;
15838 return copy; 15840 return copy;
15839 } 15841 }
15840 15842
15841 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(clone5(node.labe ls), map(node.keyword), clone4(node.expression), map(node.colon), clone5(node.st atements)); 15843 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(cloneNodeList(no de.labels), mapToken(node.keyword), cloneNode(node.expression), mapToken(node.co lon), cloneNodeList(node.statements));
15842 15844
15843 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon e5(node.labels), map(node.keyword), map(node.colon), clone5(node.statements)); 15845 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(clon eNodeList(node.labels), mapToken(node.keyword), mapToken(node.colon), cloneNodeL ist(node.statements));
15844 15846
15845 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(map(node.keyword), map(node.leftParenthesis), clone4(node.expression), map(n ode.rightParenthesis), map(node.leftBracket), clone5(node.members), map(node.rig htBracket)); 15847 SwitchStatement visitSwitchStatement(SwitchStatement node) => new SwitchStatem ent(mapToken(node.keyword), mapToken(node.leftParenthesis), cloneNode(node.expre ssion), mapToken(node.rightParenthesis), mapToken(node.leftBracket), cloneNodeLi st(node.members), mapToken(node.rightBracket));
15846 15848
15847 AstNode visitSymbolLiteral(SymbolLiteral node) { 15849 AstNode visitSymbolLiteral(SymbolLiteral node) {
15848 SymbolLiteral copy = new SymbolLiteral(map(node.poundSign), map2(node.compon ents)); 15850 SymbolLiteral copy = new SymbolLiteral(mapToken(node.poundSign), mapTokens(n ode.components));
15849 copy.propagatedType = node.propagatedType; 15851 copy.propagatedType = node.propagatedType;
15850 copy.staticType = node.staticType; 15852 copy.staticType = node.staticType;
15851 return copy; 15853 return copy;
15852 } 15854 }
15853 15855
15854 ThisExpression visitThisExpression(ThisExpression node) { 15856 ThisExpression visitThisExpression(ThisExpression node) {
15855 ThisExpression copy = new ThisExpression(map(node.keyword)); 15857 ThisExpression copy = new ThisExpression(mapToken(node.keyword));
15856 copy.propagatedType = node.propagatedType; 15858 copy.propagatedType = node.propagatedType;
15857 copy.staticType = node.staticType; 15859 copy.staticType = node.staticType;
15858 return copy; 15860 return copy;
15859 } 15861 }
15860 15862
15861 ThrowExpression visitThrowExpression(ThrowExpression node) { 15863 ThrowExpression visitThrowExpression(ThrowExpression node) {
15862 ThrowExpression copy = new ThrowExpression(map(node.keyword), clone4(node.ex pression)); 15864 ThrowExpression copy = new ThrowExpression(mapToken(node.keyword), cloneNode (node.expression));
15863 copy.propagatedType = node.propagatedType; 15865 copy.propagatedType = node.propagatedType;
15864 copy.staticType = node.staticType; 15866 copy.staticType = node.staticType;
15865 return copy; 15867 return copy;
15866 } 15868 }
15867 15869
15868 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(clone4(node.documentationCom ment), clone5(node.metadata), clone4(node.variables), map(node.semicolon)); 15870 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(TopLevelVariableD eclaration node) => new TopLevelVariableDeclaration(cloneNode(node.documentation Comment), cloneNodeList(node.metadata), cloneNode(node.variables), mapToken(node .semicolon));
15869 15871
15870 TryStatement visitTryStatement(TryStatement node) => new TryStatement(map(node .tryKeyword), clone4(node.body), clone5(node.catchClauses), map(node.finallyKeyw ord), clone4(node.finallyBlock)); 15872 TryStatement visitTryStatement(TryStatement node) => new TryStatement(mapToken (node.tryKeyword), cloneNode(node.body), cloneNodeList(node.catchClauses), mapTo ken(node.finallyKeyword), cloneNode(node.finallyBlock));
15871 15873
15872 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(map(node.leftBracket), clone5(node.arguments), map(node.rightBracket)); 15874 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => new TypeArgum entList(mapToken(node.leftBracket), cloneNodeList(node.arguments), mapToken(node .rightBracket));
15873 15875
15874 TypeName visitTypeName(TypeName node) { 15876 TypeName visitTypeName(TypeName node) {
15875 TypeName copy = new TypeName(clone4(node.name), clone4(node.typeArguments)); 15877 TypeName copy = new TypeName(cloneNode(node.name), cloneNode(node.typeArgume nts));
15876 copy.type = node.type; 15878 copy.type = node.type;
15877 return copy; 15879 return copy;
15878 } 15880 }
15879 15881
15880 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon e4(node.documentationComment), clone5(node.metadata), clone4(node.name), map(nod e.keyword), clone4(node.bound)); 15882 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(clon eNode(node.documentationComment), cloneNodeList(node.metadata), cloneNode(node.n ame), mapToken(node.keyword), cloneNode(node.bound));
15881 15883
15882 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(map(node.leftBracket), clone5(node.typeParameters), map(node.rightBr acket)); 15884 TypeParameterList visitTypeParameterList(TypeParameterList node) => new TypePa rameterList(mapToken(node.leftBracket), cloneNodeList(node.typeParameters), mapT oken(node.rightBracket));
15883 15885
15884 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, clone5(node.metadata), clone4(node.name), map(node.equ als), clone4(node.initializer)); 15886 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => new VariableDeclaration(null, cloneNodeList(node.metadata), cloneNode(node.name), ma pToken(node.equals), cloneNode(node.initializer));
15885 15887
15886 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, clone5(node.metadata), map(node.keywor d), clone4(node.type), clone5(node.variables)); 15888 VariableDeclarationList visitVariableDeclarationList(VariableDeclarationList n ode) => new VariableDeclarationList(null, cloneNodeList(node.metadata), mapToken (node.keyword), cloneNode(node.type), cloneNodeList(node.variables));
15887 15889
15888 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(clone4(node.variables), map(node.semicolon)); 15890 VariableDeclarationStatement visitVariableDeclarationStatement(VariableDeclara tionStatement node) => new VariableDeclarationStatement(cloneNode(node.variables ), mapToken(node.semicolon));
15889 15891
15890 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( map(node.keyword), map(node.leftParenthesis), clone4(node.condition), map(node.r ightParenthesis), clone4(node.body)); 15892 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( mapToken(node.keyword), mapToken(node.leftParenthesis), cloneNode(node.condition ), mapToken(node.rightParenthesis), cloneNode(node.body));
15891 15893
15892 WithClause visitWithClause(WithClause node) => new WithClause(map(node.withKey word), clone5(node.mixinTypes)); 15894 WithClause visitWithClause(WithClause node) => new WithClause(mapToken(node.wi thKeyword), cloneNodeList(node.mixinTypes));
15893 15895
15894 AstNode clone4(AstNode node) { 15896 AstNode cloneNode(AstNode node) {
15895 if (node == null) { 15897 if (node == null) {
15896 return null; 15898 return null;
15897 } 15899 }
15898 if (identical(node, _oldNode)) { 15900 if (identical(node, _oldNode)) {
15899 return _newNode; 15901 return _newNode;
15900 } 15902 }
15901 return node.accept(this) as AstNode; 15903 return node.accept(this) as AstNode;
15902 } 15904 }
15903 15905
15904 List clone5(NodeList nodes) { 15906 List cloneNodeList(NodeList nodes) {
15905 List clonedNodes = new List(); 15907 List clonedNodes = new List();
15906 for (AstNode node in nodes) { 15908 for (AstNode node in nodes) {
15907 clonedNodes.add(clone4(node)); 15909 clonedNodes.add(cloneNode(node));
15908 } 15910 }
15909 return clonedNodes; 15911 return clonedNodes;
15910 } 15912 }
15911 15913
15912 Token map(Token oldToken) { 15914 Token mapToken(Token oldToken) {
15913 if (oldToken == null) { 15915 if (oldToken == null) {
15914 return null; 15916 return null;
15915 } 15917 }
15916 return _tokenMap.get(oldToken); 15918 return _tokenMap.get(oldToken);
15917 } 15919 }
15918 15920
15919 List<Token> map2(List<Token> oldTokens) { 15921 List<Token> mapTokens(List<Token> oldTokens) {
15920 List<Token> newTokens = new List<Token>(oldTokens.length); 15922 List<Token> newTokens = new List<Token>(oldTokens.length);
15921 for (int index = 0; index < newTokens.length; index++) { 15923 for (int index = 0; index < newTokens.length; index++) {
15922 newTokens[index] = map(oldTokens[index]); 15924 newTokens[index] = mapToken(oldTokens[index]);
15923 } 15925 }
15924 return newTokens; 15926 return newTokens;
15925 } 15927 }
15926 } 15928 }
15927 15929
15928 /** 15930 /**
15929 * Traverse the AST from initial child node to successive parents, building a co llection of local 15931 * Traverse the AST from initial child node to successive parents, building a co llection of local
15930 * variable and parameter names visible to the initial child node. In case of na me shadowing, the 15932 * variable and parameter names visible to the initial child node. In case of na me shadowing, the
15931 * first name seen is the most specific one so names are not redefined. 15933 * first name seen is the most specific one so names are not redefined.
15932 * 15934 *
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
16208 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); 16210 throw new RangeError("Index: ${index}, Size: ${_elements.length}");
16209 } 16211 }
16210 owner.becomeParentOf(node); 16212 owner.becomeParentOf(node);
16211 _elements[index] = node; 16213 _elements[index] = node;
16212 } 16214 }
16213 int get length => _elements.length; 16215 int get length => _elements.length;
16214 void set length(int value) { 16216 void set length(int value) {
16215 throw new UnsupportedError("Cannot resize NodeList."); 16217 throw new UnsupportedError("Cannot resize NodeList.");
16216 } 16218 }
16217 } 16219 }
OLDNEW
« no previous file with comments | « pkg/analyzer/bin/analyzer.dart ('k') | pkg/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698