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

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

Issue 1309543011: Add support for assert statements with messages to the analyzer. Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
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 library engine.ast; 5 library engine.ast;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'element.dart'; 9 import 'element.dart';
10 import 'engine.dart' show AnalysisEngine; 10 import 'engine.dart' show AnalysisEngine;
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 * The left parenthesis. 651 * The left parenthesis.
652 */ 652 */
653 Token leftParenthesis; 653 Token leftParenthesis;
654 654
655 /** 655 /**
656 * The condition that is being asserted to be `true`. 656 * The condition that is being asserted to be `true`.
657 */ 657 */
658 Expression _condition; 658 Expression _condition;
659 659
660 /** 660 /**
661 * The comma, if a message expression was supplied. Otherwise `null`.
662 */
663 Token comma;
664
665 /**
666 * The message to report if the assertion fails. `null` if no message was
667 * supplied.
668 */
669 Expression _message;
670
671 /**
661 * The right parenthesis. 672 * The right parenthesis.
662 */ 673 */
663 Token rightParenthesis; 674 Token rightParenthesis;
664 675
665 /** 676 /**
666 * The semicolon terminating the statement. 677 * The semicolon terminating the statement.
667 */ 678 */
668 Token semicolon; 679 Token semicolon;
669 680
670 /** 681 /**
671 * Initialize a newly created assert statement. 682 * Initialize a newly created assert statement.
672 */ 683 */
673 AssertStatement(this.assertKeyword, this.leftParenthesis, 684 AssertStatement(this.assertKeyword, this.leftParenthesis,
674 Expression condition, this.rightParenthesis, this.semicolon) { 685 Expression condition, this.rightParenthesis, this.semicolon,
686 {this.comma, Expression message}) {
Brian Wilkerson 2015/09/02 15:49:15 None of the other AST node constructors take optio
Paul Berry 2015/09/02 17:20:03 If I do so, will this constitute a breaking change
Brian Wilkerson 2015/09/02 17:35:26 I wish I could answer that question definitively,
Paul Berry 2015/09/07 19:44:29 Thinking back to our discussions with the Seattle
675 _condition = _becomeParentOf(condition); 687 _condition = _becomeParentOf(condition);
688 _message = _becomeParentOf(message);
676 } 689 }
677 690
678 @override 691 @override
679 Token get beginToken => assertKeyword; 692 Token get beginToken => assertKeyword;
680 693
681 @override 694 @override
682 Iterable get childEntities => new ChildEntities() 695 Iterable get childEntities => new ChildEntities()
683 ..add(assertKeyword) 696 ..add(assertKeyword)
684 ..add(leftParenthesis) 697 ..add(leftParenthesis)
685 ..add(_condition) 698 ..add(_condition)
699 ..add(comma)
700 ..add(_message)
686 ..add(rightParenthesis) 701 ..add(rightParenthesis)
687 ..add(semicolon); 702 ..add(semicolon);
688 703
689 /** 704 /**
690 * Return the condition that is being asserted to be `true`. 705 * Return the condition that is being asserted to be `true`.
691 */ 706 */
692 Expression get condition => _condition; 707 Expression get condition => _condition;
693 708
694 /** 709 /**
695 * Set the condition that is being asserted to be `true` to the given 710 * Set the condition that is being asserted to be `true` to the given
(...skipping 13 matching lines...) Expand all
709 Token get keyword => assertKeyword; 724 Token get keyword => assertKeyword;
710 725
711 /** 726 /**
712 * Set the token representing the 'assert' keyword to the given [token]. 727 * Set the token representing the 'assert' keyword to the given [token].
713 */ 728 */
714 @deprecated // Use "this.assertKeyword" 729 @deprecated // Use "this.assertKeyword"
715 set keyword(Token token) { 730 set keyword(Token token) {
716 assertKeyword = token; 731 assertKeyword = token;
717 } 732 }
718 733
734 /**
735 * Return the messasge to report if the assertion fails.
736 */
737 Expression get message => _message;
738
719 @override 739 @override
720 accept(AstVisitor visitor) => visitor.visitAssertStatement(this); 740 accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
721 741
722 @override 742 @override
723 void visitChildren(AstVisitor visitor) { 743 void visitChildren(AstVisitor visitor) {
724 _safelyVisitChild(_condition, visitor); 744 _safelyVisitChild(_condition, visitor);
745 _safelyVisitChild(message, visitor);
725 } 746 }
726 } 747 }
727 748
728 /** 749 /**
729 * An assignment expression. 750 * An assignment expression.
730 * 751 *
731 * > assignmentExpression ::= 752 * > assignmentExpression ::=
732 * > [Expression] operator [Expression] 753 * > [Expression] operator [Expression]
733 */ 754 */
734 class AssignmentExpression extends Expression { 755 class AssignmentExpression extends Expression {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 * A flag indicating whether tokens should be cloned while cloning an AST 977 * A flag indicating whether tokens should be cloned while cloning an AST
957 * structure. 978 * structure.
958 */ 979 */
959 final bool cloneTokens; 980 final bool cloneTokens;
960 981
961 /** 982 /**
962 * Initialize a newly created AST cloner to optionally clone tokens while 983 * Initialize a newly created AST cloner to optionally clone tokens while
963 * cloning AST nodes if [cloneTokens] is `true`. 984 * cloning AST nodes if [cloneTokens] is `true`.
964 */ 985 */
965 AstCloner( 986 AstCloner(
966 [this.cloneTokens = false]); // TODO(brianwilkerson) Change this to be a n amed parameter. 987 [this.cloneTokens =
988 false]); // TODO(brianwilkerson) Change this to be a named parameter.
967 989
968 /** 990 /**
969 * Return a clone of the given [node]. 991 * Return a clone of the given [node].
970 */ 992 */
971 AstNode cloneNode(AstNode node) { 993 AstNode cloneNode(AstNode node) {
972 if (node == null) { 994 if (node == null) {
973 return null; 995 return null;
974 } 996 }
975 return node.accept(this) as AstNode; 997 return node.accept(this) as AstNode;
976 } 998 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 } 1030 }
1009 return tokens; 1031 return tokens;
1010 } 1032 }
1011 1033
1012 @override 1034 @override
1013 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 1035 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
1014 new AdjacentStrings(cloneNodeList(node.strings)); 1036 new AdjacentStrings(cloneNodeList(node.strings));
1015 1037
1016 @override 1038 @override
1017 Annotation visitAnnotation(Annotation node) => new Annotation( 1039 Annotation visitAnnotation(Annotation node) => new Annotation(
1018 cloneToken(node.atSign), cloneNode(node.name), cloneToken(node.period), 1040 cloneToken(node.atSign),
1019 cloneNode(node.constructorName), cloneNode(node.arguments)); 1041 cloneNode(node.name),
1042 cloneToken(node.period),
1043 cloneNode(node.constructorName),
1044 cloneNode(node.arguments));
1020 1045
1021 @override 1046 @override
1022 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 1047 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
1023 cloneToken(node.leftParenthesis), cloneNodeList(node.arguments), 1048 cloneToken(node.leftParenthesis),
1049 cloneNodeList(node.arguments),
1024 cloneToken(node.rightParenthesis)); 1050 cloneToken(node.rightParenthesis));
1025 1051
1026 @override 1052 @override
1027 AsExpression visitAsExpression(AsExpression node) => new AsExpression( 1053 AsExpression visitAsExpression(AsExpression node) => new AsExpression(
1028 cloneNode(node.expression), cloneToken(node.asOperator), 1054 cloneNode(node.expression),
1055 cloneToken(node.asOperator),
1029 cloneNode(node.type)); 1056 cloneNode(node.type));
1030 1057
1031 @override 1058 @override
1032 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 1059 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
Brian Wilkerson 2015/09/02 15:49:15 This needs to be updated to clone the new children
Paul Berry 2015/09/07 19:44:29 Done.
1033 cloneToken(node.assertKeyword), cloneToken(node.leftParenthesis), 1060 cloneToken(node.assertKeyword),
1034 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1061 cloneToken(node.leftParenthesis),
1062 cloneNode(node.condition),
1063 cloneToken(node.rightParenthesis),
1035 cloneToken(node.semicolon)); 1064 cloneToken(node.semicolon));
1036 1065
1037 @override 1066 @override
1038 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => 1067 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) =>
1039 new AssignmentExpression(cloneNode(node.leftHandSide), 1068 new AssignmentExpression(cloneNode(node.leftHandSide),
1040 cloneToken(node.operator), cloneNode(node.rightHandSide)); 1069 cloneToken(node.operator), cloneNode(node.rightHandSide));
1041 1070
1042 @override 1071 @override
1043 AwaitExpression visitAwaitExpression(AwaitExpression node) => 1072 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
1044 new AwaitExpression( 1073 new AwaitExpression(
1045 cloneToken(node.awaitKeyword), cloneNode(node.expression)); 1074 cloneToken(node.awaitKeyword), cloneNode(node.expression));
1046 1075
1047 @override 1076 @override
1048 BinaryExpression visitBinaryExpression(BinaryExpression node) => 1077 BinaryExpression visitBinaryExpression(BinaryExpression node) =>
1049 new BinaryExpression(cloneNode(node.leftOperand), 1078 new BinaryExpression(cloneNode(node.leftOperand),
1050 cloneToken(node.operator), cloneNode(node.rightOperand)); 1079 cloneToken(node.operator), cloneNode(node.rightOperand));
1051 1080
1052 @override 1081 @override
1053 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket), 1082 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket),
1054 cloneNodeList(node.statements), cloneToken(node.rightBracket)); 1083 cloneNodeList(node.statements), cloneToken(node.rightBracket));
1055 1084
1056 @override 1085 @override
1057 BlockFunctionBody visitBlockFunctionBody( 1086 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
1058 BlockFunctionBody node) => new BlockFunctionBody( 1087 new BlockFunctionBody(cloneToken(node.keyword), cloneToken(node.star),
1059 cloneToken(node.keyword), cloneToken(node.star), cloneNode(node.block)); 1088 cloneNode(node.block));
1060 1089
1061 @override 1090 @override
1062 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => 1091 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
1063 new BooleanLiteral(cloneToken(node.literal), node.value); 1092 new BooleanLiteral(cloneToken(node.literal), node.value);
1064 1093
1065 @override 1094 @override
1066 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 1095 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
1067 cloneToken(node.breakKeyword), cloneNode(node.label), 1096 cloneToken(node.breakKeyword),
1097 cloneNode(node.label),
1068 cloneToken(node.semicolon)); 1098 cloneToken(node.semicolon));
1069 1099
1070 @override 1100 @override
1071 CascadeExpression visitCascadeExpression(CascadeExpression node) => 1101 CascadeExpression visitCascadeExpression(CascadeExpression node) =>
1072 new CascadeExpression( 1102 new CascadeExpression(
1073 cloneNode(node.target), cloneNodeList(node.cascadeSections)); 1103 cloneNode(node.target), cloneNodeList(node.cascadeSections));
1074 1104
1075 @override 1105 @override
1076 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 1106 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
1077 cloneToken(node.onKeyword), cloneNode(node.exceptionType), 1107 cloneToken(node.onKeyword),
1078 cloneToken(node.catchKeyword), cloneToken(node.leftParenthesis), 1108 cloneNode(node.exceptionType),
1079 cloneNode(node.exceptionParameter), cloneToken(node.comma), 1109 cloneToken(node.catchKeyword),
1080 cloneNode(node.stackTraceParameter), cloneToken(node.rightParenthesis), 1110 cloneToken(node.leftParenthesis),
1111 cloneNode(node.exceptionParameter),
1112 cloneToken(node.comma),
1113 cloneNode(node.stackTraceParameter),
1114 cloneToken(node.rightParenthesis),
1081 cloneNode(node.body)); 1115 cloneNode(node.body));
1082 1116
1083 @override 1117 @override
1084 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 1118 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
1085 ClassDeclaration copy = new ClassDeclaration( 1119 ClassDeclaration copy = new ClassDeclaration(
1086 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1120 cloneNode(node.documentationComment),
1087 cloneToken(node.abstractKeyword), cloneToken(node.classKeyword), 1121 cloneNodeList(node.metadata),
1088 cloneNode(node.name), cloneNode(node.typeParameters), 1122 cloneToken(node.abstractKeyword),
1089 cloneNode(node.extendsClause), cloneNode(node.withClause), 1123 cloneToken(node.classKeyword),
1090 cloneNode(node.implementsClause), cloneToken(node.leftBracket), 1124 cloneNode(node.name),
1091 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1125 cloneNode(node.typeParameters),
1126 cloneNode(node.extendsClause),
1127 cloneNode(node.withClause),
1128 cloneNode(node.implementsClause),
1129 cloneToken(node.leftBracket),
1130 cloneNodeList(node.members),
1131 cloneToken(node.rightBracket));
1092 copy.nativeClause = cloneNode(node.nativeClause); 1132 copy.nativeClause = cloneNode(node.nativeClause);
1093 return copy; 1133 return copy;
1094 } 1134 }
1095 1135
1096 @override 1136 @override
1097 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 1137 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
1098 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1138 cloneNode(node.documentationComment),
1099 cloneToken(node.typedefKeyword), cloneNode(node.name), 1139 cloneNodeList(node.metadata),
1100 cloneNode(node.typeParameters), cloneToken(node.equals), 1140 cloneToken(node.typedefKeyword),
1101 cloneToken(node.abstractKeyword), cloneNode(node.superclass), 1141 cloneNode(node.name),
1102 cloneNode(node.withClause), cloneNode(node.implementsClause), 1142 cloneNode(node.typeParameters),
1143 cloneToken(node.equals),
1144 cloneToken(node.abstractKeyword),
1145 cloneNode(node.superclass),
1146 cloneNode(node.withClause),
1147 cloneNode(node.implementsClause),
1103 cloneToken(node.semicolon)); 1148 cloneToken(node.semicolon));
1104 1149
1105 @override 1150 @override
1106 Comment visitComment(Comment node) { 1151 Comment visitComment(Comment node) {
1107 if (node.isDocumentation) { 1152 if (node.isDocumentation) {
1108 return Comment.createDocumentationCommentWithReferences( 1153 return Comment.createDocumentationCommentWithReferences(
1109 cloneTokenList(node.tokens), cloneNodeList(node.references)); 1154 cloneTokenList(node.tokens), cloneNodeList(node.references));
1110 } else if (node.isBlock) { 1155 } else if (node.isBlock) {
1111 return Comment.createBlockComment(cloneTokenList(node.tokens)); 1156 return Comment.createBlockComment(cloneTokenList(node.tokens));
1112 } 1157 }
1113 return Comment.createEndOfLineComment(cloneTokenList(node.tokens)); 1158 return Comment.createEndOfLineComment(cloneTokenList(node.tokens));
1114 } 1159 }
1115 1160
1116 @override 1161 @override
1117 CommentReference visitCommentReference(CommentReference node) => 1162 CommentReference visitCommentReference(CommentReference node) =>
1118 new CommentReference( 1163 new CommentReference(
1119 cloneToken(node.newKeyword), cloneNode(node.identifier)); 1164 cloneToken(node.newKeyword), cloneNode(node.identifier));
1120 1165
1121 @override 1166 @override
1122 CompilationUnit visitCompilationUnit(CompilationUnit node) { 1167 CompilationUnit visitCompilationUnit(CompilationUnit node) {
1123 CompilationUnit clone = new CompilationUnit(cloneToken(node.beginToken), 1168 CompilationUnit clone = new CompilationUnit(
1124 cloneNode(node.scriptTag), cloneNodeList(node.directives), 1169 cloneToken(node.beginToken),
1125 cloneNodeList(node.declarations), cloneToken(node.endToken)); 1170 cloneNode(node.scriptTag),
1171 cloneNodeList(node.directives),
1172 cloneNodeList(node.declarations),
1173 cloneToken(node.endToken));
1126 clone.lineInfo = node.lineInfo; 1174 clone.lineInfo = node.lineInfo;
1127 return clone; 1175 return clone;
1128 } 1176 }
1129 1177
1130 @override 1178 @override
1131 ConditionalExpression visitConditionalExpression( 1179 ConditionalExpression visitConditionalExpression(
1132 ConditionalExpression node) => new ConditionalExpression( 1180 ConditionalExpression node) =>
1133 cloneNode(node.condition), cloneToken(node.question), 1181 new ConditionalExpression(
1134 cloneNode(node.thenExpression), cloneToken(node.colon), 1182 cloneNode(node.condition),
1135 cloneNode(node.elseExpression)); 1183 cloneToken(node.question),
1184 cloneNode(node.thenExpression),
1185 cloneToken(node.colon),
1186 cloneNode(node.elseExpression));
1136 1187
1137 @override 1188 @override
1138 ConstructorDeclaration visitConstructorDeclaration( 1189 ConstructorDeclaration visitConstructorDeclaration(
1139 ConstructorDeclaration node) => new ConstructorDeclaration( 1190 ConstructorDeclaration node) =>
1140 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1191 new ConstructorDeclaration(
1141 cloneToken(node.externalKeyword), cloneToken(node.constKeyword), 1192 cloneNode(node.documentationComment),
1142 cloneToken(node.factoryKeyword), cloneNode(node.returnType), 1193 cloneNodeList(node.metadata),
1143 cloneToken(node.period), cloneNode(node.name), cloneNode(node.parameters), 1194 cloneToken(node.externalKeyword),
1144 cloneToken(node.separator), cloneNodeList(node.initializers), 1195 cloneToken(node.constKeyword),
1145 cloneNode(node.redirectedConstructor), cloneNode(node.body)); 1196 cloneToken(node.factoryKeyword),
1197 cloneNode(node.returnType),
1198 cloneToken(node.period),
1199 cloneNode(node.name),
1200 cloneNode(node.parameters),
1201 cloneToken(node.separator),
1202 cloneNodeList(node.initializers),
1203 cloneNode(node.redirectedConstructor),
1204 cloneNode(node.body));
1146 1205
1147 @override 1206 @override
1148 ConstructorFieldInitializer visitConstructorFieldInitializer( 1207 ConstructorFieldInitializer visitConstructorFieldInitializer(
1149 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 1208 ConstructorFieldInitializer node) =>
1150 cloneToken(node.thisKeyword), cloneToken(node.period), 1209 new ConstructorFieldInitializer(
1151 cloneNode(node.fieldName), cloneToken(node.equals), 1210 cloneToken(node.thisKeyword),
1152 cloneNode(node.expression)); 1211 cloneToken(node.period),
1212 cloneNode(node.fieldName),
1213 cloneToken(node.equals),
1214 cloneNode(node.expression));
1153 1215
1154 @override 1216 @override
1155 ConstructorName visitConstructorName(ConstructorName node) => 1217 ConstructorName visitConstructorName(ConstructorName node) =>
1156 new ConstructorName( 1218 new ConstructorName(
1157 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name)); 1219 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name));
1158 1220
1159 @override 1221 @override
1160 ContinueStatement visitContinueStatement(ContinueStatement node) => 1222 ContinueStatement visitContinueStatement(ContinueStatement node) =>
1161 new ContinueStatement(cloneToken(node.continueKeyword), 1223 new ContinueStatement(cloneToken(node.continueKeyword),
1162 cloneNode(node.label), cloneToken(node.semicolon)); 1224 cloneNode(node.label), cloneToken(node.semicolon));
1163 1225
1164 @override 1226 @override
1165 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 1227 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
1166 new DeclaredIdentifier(cloneNode(node.documentationComment), 1228 new DeclaredIdentifier(
1167 cloneNodeList(node.metadata), cloneToken(node.keyword), 1229 cloneNode(node.documentationComment),
1168 cloneNode(node.type), cloneNode(node.identifier)); 1230 cloneNodeList(node.metadata),
1231 cloneToken(node.keyword),
1232 cloneNode(node.type),
1233 cloneNode(node.identifier));
1169 1234
1170 @override 1235 @override
1171 DefaultFormalParameter visitDefaultFormalParameter( 1236 DefaultFormalParameter visitDefaultFormalParameter(
1172 DefaultFormalParameter node) => new DefaultFormalParameter( 1237 DefaultFormalParameter node) =>
1173 cloneNode(node.parameter), node.kind, cloneToken(node.separator), 1238 new DefaultFormalParameter(cloneNode(node.parameter), node.kind,
1174 cloneNode(node.defaultValue)); 1239 cloneToken(node.separator), cloneNode(node.defaultValue));
1175 1240
1176 @override 1241 @override
1177 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 1242 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
1178 cloneToken(node.doKeyword), cloneNode(node.body), 1243 cloneToken(node.doKeyword),
1179 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1244 cloneNode(node.body),
1180 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1245 cloneToken(node.whileKeyword),
1246 cloneToken(node.leftParenthesis),
1247 cloneNode(node.condition),
1248 cloneToken(node.rightParenthesis),
1181 cloneToken(node.semicolon)); 1249 cloneToken(node.semicolon));
1182 1250
1183 @override 1251 @override
1184 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => 1252 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) =>
1185 new DoubleLiteral(cloneToken(node.literal), node.value); 1253 new DoubleLiteral(cloneToken(node.literal), node.value);
1186 1254
1187 @override 1255 @override
1188 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 1256 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
1189 new EmptyFunctionBody(cloneToken(node.semicolon)); 1257 new EmptyFunctionBody(cloneToken(node.semicolon));
1190 1258
1191 @override 1259 @override
1192 EmptyStatement visitEmptyStatement(EmptyStatement node) => 1260 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
1193 new EmptyStatement(cloneToken(node.semicolon)); 1261 new EmptyStatement(cloneToken(node.semicolon));
1194 1262
1195 @override 1263 @override
1196 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 1264 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
1197 new EnumConstantDeclaration(cloneNode(node.documentationComment), 1265 new EnumConstantDeclaration(cloneNode(node.documentationComment),
1198 cloneNodeList(node.metadata), cloneNode(node.name)); 1266 cloneNodeList(node.metadata), cloneNode(node.name));
1199 1267
1200 @override 1268 @override
1201 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) => 1269 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
1202 new EnumDeclaration(cloneNode(node.documentationComment), 1270 new EnumDeclaration(
1203 cloneNodeList(node.metadata), cloneToken(node.enumKeyword), 1271 cloneNode(node.documentationComment),
1204 cloneNode(node.name), cloneToken(node.leftBracket), 1272 cloneNodeList(node.metadata),
1205 cloneNodeList(node.constants), cloneToken(node.rightBracket)); 1273 cloneToken(node.enumKeyword),
1274 cloneNode(node.name),
1275 cloneToken(node.leftBracket),
1276 cloneNodeList(node.constants),
1277 cloneToken(node.rightBracket));
1206 1278
1207 @override 1279 @override
1208 ExportDirective visitExportDirective(ExportDirective node) { 1280 ExportDirective visitExportDirective(ExportDirective node) {
1209 ExportDirective directive = new ExportDirective( 1281 ExportDirective directive = new ExportDirective(
1210 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1282 cloneNode(node.documentationComment),
1211 cloneToken(node.keyword), cloneNode(node.uri), 1283 cloneNodeList(node.metadata),
1212 cloneNodeList(node.combinators), cloneToken(node.semicolon)); 1284 cloneToken(node.keyword),
1285 cloneNode(node.uri),
1286 cloneNodeList(node.combinators),
1287 cloneToken(node.semicolon));
1213 directive.source = node.source; 1288 directive.source = node.source;
1214 directive.uriContent = node.uriContent; 1289 directive.uriContent = node.uriContent;
1215 return directive; 1290 return directive;
1216 } 1291 }
1217 1292
1218 @override 1293 @override
1219 ExpressionFunctionBody visitExpressionFunctionBody( 1294 ExpressionFunctionBody visitExpressionFunctionBody(
1220 ExpressionFunctionBody node) => new ExpressionFunctionBody( 1295 ExpressionFunctionBody node) =>
1221 cloneToken(node.keyword), cloneToken(node.functionDefinition), 1296 new ExpressionFunctionBody(
1222 cloneNode(node.expression), cloneToken(node.semicolon)); 1297 cloneToken(node.keyword),
1298 cloneToken(node.functionDefinition),
1299 cloneNode(node.expression),
1300 cloneToken(node.semicolon));
1223 1301
1224 @override 1302 @override
1225 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 1303 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
1226 new ExpressionStatement( 1304 new ExpressionStatement(
1227 cloneNode(node.expression), cloneToken(node.semicolon)); 1305 cloneNode(node.expression), cloneToken(node.semicolon));
1228 1306
1229 @override 1307 @override
1230 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 1308 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
1231 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); 1309 cloneToken(node.extendsKeyword), cloneNode(node.superclass));
1232 1310
1233 @override 1311 @override
1234 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 1312 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
1235 new FieldDeclaration(cloneNode(node.documentationComment), 1313 new FieldDeclaration(
1236 cloneNodeList(node.metadata), cloneToken(node.staticKeyword), 1314 cloneNode(node.documentationComment),
1237 cloneNode(node.fields), cloneToken(node.semicolon)); 1315 cloneNodeList(node.metadata),
1316 cloneToken(node.staticKeyword),
1317 cloneNode(node.fields),
1318 cloneToken(node.semicolon));
1238 1319
1239 @override 1320 @override
1240 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 1321 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
1241 new FieldFormalParameter(cloneNode(node.documentationComment), 1322 new FieldFormalParameter(
1242 cloneNodeList(node.metadata), cloneToken(node.keyword), 1323 cloneNode(node.documentationComment),
1243 cloneNode(node.type), cloneToken(node.thisKeyword), 1324 cloneNodeList(node.metadata),
1244 cloneToken(node.period), cloneNode(node.identifier), 1325 cloneToken(node.keyword),
1245 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1326 cloneNode(node.type),
1327 cloneToken(node.thisKeyword),
1328 cloneToken(node.period),
1329 cloneNode(node.identifier),
1330 cloneNode(node.typeParameters),
1331 cloneNode(node.parameters));
1246 1332
1247 @override 1333 @override
1248 ForEachStatement visitForEachStatement(ForEachStatement node) { 1334 ForEachStatement visitForEachStatement(ForEachStatement node) {
1249 DeclaredIdentifier loopVariable = node.loopVariable; 1335 DeclaredIdentifier loopVariable = node.loopVariable;
1250 if (loopVariable == null) { 1336 if (loopVariable == null) {
1251 return new ForEachStatement.withReference(cloneToken(node.awaitKeyword), 1337 return new ForEachStatement.withReference(
1252 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1338 cloneToken(node.awaitKeyword),
1253 cloneNode(node.identifier), cloneToken(node.inKeyword), 1339 cloneToken(node.forKeyword),
1254 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1340 cloneToken(node.leftParenthesis),
1341 cloneNode(node.identifier),
1342 cloneToken(node.inKeyword),
1343 cloneNode(node.iterable),
1344 cloneToken(node.rightParenthesis),
1255 cloneNode(node.body)); 1345 cloneNode(node.body));
1256 } 1346 }
1257 return new ForEachStatement.withDeclaration(cloneToken(node.awaitKeyword), 1347 return new ForEachStatement.withDeclaration(
1258 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1348 cloneToken(node.awaitKeyword),
1259 cloneNode(loopVariable), cloneToken(node.inKeyword), 1349 cloneToken(node.forKeyword),
1260 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1350 cloneToken(node.leftParenthesis),
1351 cloneNode(loopVariable),
1352 cloneToken(node.inKeyword),
1353 cloneNode(node.iterable),
1354 cloneToken(node.rightParenthesis),
1261 cloneNode(node.body)); 1355 cloneNode(node.body));
1262 } 1356 }
1263 1357
1264 @override 1358 @override
1265 FormalParameterList visitFormalParameterList(FormalParameterList node) => 1359 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
1266 new FormalParameterList(cloneToken(node.leftParenthesis), 1360 new FormalParameterList(
1267 cloneNodeList(node.parameters), cloneToken(node.leftDelimiter), 1361 cloneToken(node.leftParenthesis),
1268 cloneToken(node.rightDelimiter), cloneToken(node.rightParenthesis)); 1362 cloneNodeList(node.parameters),
1363 cloneToken(node.leftDelimiter),
1364 cloneToken(node.rightDelimiter),
1365 cloneToken(node.rightParenthesis));
1269 1366
1270 @override 1367 @override
1271 ForStatement visitForStatement(ForStatement node) => new ForStatement( 1368 ForStatement visitForStatement(ForStatement node) => new ForStatement(
1272 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1369 cloneToken(node.forKeyword),
1273 cloneNode(node.variables), cloneNode(node.initialization), 1370 cloneToken(node.leftParenthesis),
1274 cloneToken(node.leftSeparator), cloneNode(node.condition), 1371 cloneNode(node.variables),
1275 cloneToken(node.rightSeparator), cloneNodeList(node.updaters), 1372 cloneNode(node.initialization),
1276 cloneToken(node.rightParenthesis), cloneNode(node.body)); 1373 cloneToken(node.leftSeparator),
1374 cloneNode(node.condition),
1375 cloneToken(node.rightSeparator),
1376 cloneNodeList(node.updaters),
1377 cloneToken(node.rightParenthesis),
1378 cloneNode(node.body));
1277 1379
1278 @override 1380 @override
1279 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 1381 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
1280 new FunctionDeclaration(cloneNode(node.documentationComment), 1382 new FunctionDeclaration(
1281 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1383 cloneNode(node.documentationComment),
1282 cloneNode(node.returnType), cloneToken(node.propertyKeyword), 1384 cloneNodeList(node.metadata),
1283 cloneNode(node.name), cloneNode(node.functionExpression)); 1385 cloneToken(node.externalKeyword),
1386 cloneNode(node.returnType),
1387 cloneToken(node.propertyKeyword),
1388 cloneNode(node.name),
1389 cloneNode(node.functionExpression));
1284 1390
1285 @override 1391 @override
1286 FunctionDeclarationStatement visitFunctionDeclarationStatement( 1392 FunctionDeclarationStatement visitFunctionDeclarationStatement(
1287 FunctionDeclarationStatement node) => 1393 FunctionDeclarationStatement node) =>
1288 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration)); 1394 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
1289 1395
1290 @override 1396 @override
1291 FunctionExpression visitFunctionExpression(FunctionExpression node) => 1397 FunctionExpression visitFunctionExpression(FunctionExpression node) =>
1292 new FunctionExpression(cloneNode(node.typeParameters), 1398 new FunctionExpression(cloneNode(node.typeParameters),
1293 cloneNode(node.parameters), cloneNode(node.body)); 1399 cloneNode(node.parameters), cloneNode(node.body));
1294 1400
1295 @override 1401 @override
1296 FunctionExpressionInvocation visitFunctionExpressionInvocation( 1402 FunctionExpressionInvocation visitFunctionExpressionInvocation(
1297 FunctionExpressionInvocation node) => new FunctionExpressionInvocation( 1403 FunctionExpressionInvocation node) =>
1298 cloneNode(node.function), cloneNode(node.typeArguments), 1404 new FunctionExpressionInvocation(cloneNode(node.function),
1299 cloneNode(node.argumentList)); 1405 cloneNode(node.typeArguments), cloneNode(node.argumentList));
1300 1406
1301 @override 1407 @override
1302 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 1408 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
1303 new FunctionTypeAlias(cloneNode(node.documentationComment), 1409 new FunctionTypeAlias(
1304 cloneNodeList(node.metadata), cloneToken(node.typedefKeyword), 1410 cloneNode(node.documentationComment),
1305 cloneNode(node.returnType), cloneNode(node.name), 1411 cloneNodeList(node.metadata),
1306 cloneNode(node.typeParameters), cloneNode(node.parameters), 1412 cloneToken(node.typedefKeyword),
1413 cloneNode(node.returnType),
1414 cloneNode(node.name),
1415 cloneNode(node.typeParameters),
1416 cloneNode(node.parameters),
1307 cloneToken(node.semicolon)); 1417 cloneToken(node.semicolon));
1308 1418
1309 @override 1419 @override
1310 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 1420 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
1311 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 1421 FunctionTypedFormalParameter node) =>
1312 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1422 new FunctionTypedFormalParameter(
1313 cloneNode(node.returnType), cloneNode(node.identifier), 1423 cloneNode(node.documentationComment),
1314 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1424 cloneNodeList(node.metadata),
1425 cloneNode(node.returnType),
1426 cloneNode(node.identifier),
1427 cloneNode(node.typeParameters),
1428 cloneNode(node.parameters));
1315 1429
1316 @override 1430 @override
1317 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 1431 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
1318 cloneToken(node.keyword), cloneNodeList(node.hiddenNames)); 1432 cloneToken(node.keyword), cloneNodeList(node.hiddenNames));
1319 1433
1320 @override 1434 @override
1321 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 1435 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
1322 cloneToken(node.ifKeyword), cloneToken(node.leftParenthesis), 1436 cloneToken(node.ifKeyword),
1323 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1437 cloneToken(node.leftParenthesis),
1324 cloneNode(node.thenStatement), cloneToken(node.elseKeyword), 1438 cloneNode(node.condition),
1439 cloneToken(node.rightParenthesis),
1440 cloneNode(node.thenStatement),
1441 cloneToken(node.elseKeyword),
1325 cloneNode(node.elseStatement)); 1442 cloneNode(node.elseStatement));
1326 1443
1327 @override 1444 @override
1328 ImplementsClause visitImplementsClause(ImplementsClause node) => 1445 ImplementsClause visitImplementsClause(ImplementsClause node) =>
1329 new ImplementsClause( 1446 new ImplementsClause(
1330 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); 1447 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces));
1331 1448
1332 @override 1449 @override
1333 ImportDirective visitImportDirective(ImportDirective node) { 1450 ImportDirective visitImportDirective(ImportDirective node) {
1334 ImportDirective directive = new ImportDirective( 1451 ImportDirective directive = new ImportDirective(
1335 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1452 cloneNode(node.documentationComment),
1336 cloneToken(node.keyword), cloneNode(node.uri), 1453 cloneNodeList(node.metadata),
1337 cloneToken(node.deferredKeyword), cloneToken(node.asKeyword), 1454 cloneToken(node.keyword),
1338 cloneNode(node.prefix), cloneNodeList(node.combinators), 1455 cloneNode(node.uri),
1456 cloneToken(node.deferredKeyword),
1457 cloneToken(node.asKeyword),
1458 cloneNode(node.prefix),
1459 cloneNodeList(node.combinators),
1339 cloneToken(node.semicolon)); 1460 cloneToken(node.semicolon));
1340 directive.source = node.source; 1461 directive.source = node.source;
1341 directive.uriContent = node.uriContent; 1462 directive.uriContent = node.uriContent;
1342 return directive; 1463 return directive;
1343 } 1464 }
1344 1465
1345 @override 1466 @override
1346 IndexExpression visitIndexExpression(IndexExpression node) { 1467 IndexExpression visitIndexExpression(IndexExpression node) {
1347 Token period = node.period; 1468 Token period = node.period;
1348 if (period == null) { 1469 if (period == null) {
1349 return new IndexExpression.forTarget(cloneNode(node.target), 1470 return new IndexExpression.forTarget(
1350 cloneToken(node.leftBracket), cloneNode(node.index), 1471 cloneNode(node.target),
1472 cloneToken(node.leftBracket),
1473 cloneNode(node.index),
1351 cloneToken(node.rightBracket)); 1474 cloneToken(node.rightBracket));
1352 } else { 1475 } else {
1353 return new IndexExpression.forCascade(cloneToken(period), 1476 return new IndexExpression.forCascade(
1354 cloneToken(node.leftBracket), cloneNode(node.index), 1477 cloneToken(period),
1478 cloneToken(node.leftBracket),
1479 cloneNode(node.index),
1355 cloneToken(node.rightBracket)); 1480 cloneToken(node.rightBracket));
1356 } 1481 }
1357 } 1482 }
1358 1483
1359 @override 1484 @override
1360 InstanceCreationExpression visitInstanceCreationExpression( 1485 InstanceCreationExpression visitInstanceCreationExpression(
1361 InstanceCreationExpression node) => new InstanceCreationExpression( 1486 InstanceCreationExpression node) =>
1362 cloneToken(node.keyword), cloneNode(node.constructorName), 1487 new InstanceCreationExpression(cloneToken(node.keyword),
1363 cloneNode(node.argumentList)); 1488 cloneNode(node.constructorName), cloneNode(node.argumentList));
1364 1489
1365 @override 1490 @override
1366 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => 1491 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
1367 new IntegerLiteral(cloneToken(node.literal), node.value); 1492 new IntegerLiteral(cloneToken(node.literal), node.value);
1368 1493
1369 @override 1494 @override
1370 InterpolationExpression visitInterpolationExpression( 1495 InterpolationExpression visitInterpolationExpression(
1371 InterpolationExpression node) => new InterpolationExpression( 1496 InterpolationExpression node) =>
1372 cloneToken(node.leftBracket), cloneNode(node.expression), 1497 new InterpolationExpression(cloneToken(node.leftBracket),
1373 cloneToken(node.rightBracket)); 1498 cloneNode(node.expression), cloneToken(node.rightBracket));
1374 1499
1375 @override 1500 @override
1376 InterpolationString visitInterpolationString(InterpolationString node) => 1501 InterpolationString visitInterpolationString(InterpolationString node) =>
1377 new InterpolationString(cloneToken(node.contents), node.value); 1502 new InterpolationString(cloneToken(node.contents), node.value);
1378 1503
1379 @override 1504 @override
1380 IsExpression visitIsExpression(IsExpression node) => new IsExpression( 1505 IsExpression visitIsExpression(IsExpression node) => new IsExpression(
1381 cloneNode(node.expression), cloneToken(node.isOperator), 1506 cloneNode(node.expression),
1382 cloneToken(node.notOperator), cloneNode(node.type)); 1507 cloneToken(node.isOperator),
1508 cloneToken(node.notOperator),
1509 cloneNode(node.type));
1383 1510
1384 @override 1511 @override
1385 Label visitLabel(Label node) => 1512 Label visitLabel(Label node) =>
1386 new Label(cloneNode(node.label), cloneToken(node.colon)); 1513 new Label(cloneNode(node.label), cloneToken(node.colon));
1387 1514
1388 @override 1515 @override
1389 LabeledStatement visitLabeledStatement(LabeledStatement node) => 1516 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
1390 new LabeledStatement( 1517 new LabeledStatement(
1391 cloneNodeList(node.labels), cloneNode(node.statement)); 1518 cloneNodeList(node.labels), cloneNode(node.statement));
1392 1519
1393 @override 1520 @override
1394 LibraryDirective visitLibraryDirective(LibraryDirective node) => 1521 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
1395 new LibraryDirective(cloneNode(node.documentationComment), 1522 new LibraryDirective(
1396 cloneNodeList(node.metadata), cloneToken(node.libraryKeyword), 1523 cloneNode(node.documentationComment),
1397 cloneNode(node.name), cloneToken(node.semicolon)); 1524 cloneNodeList(node.metadata),
1525 cloneToken(node.libraryKeyword),
1526 cloneNode(node.name),
1527 cloneToken(node.semicolon));
1398 1528
1399 @override 1529 @override
1400 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => 1530 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
1401 new LibraryIdentifier(cloneNodeList(node.components)); 1531 new LibraryIdentifier(cloneNodeList(node.components));
1402 1532
1403 @override 1533 @override
1404 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral( 1534 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(
1405 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1535 cloneToken(node.constKeyword),
1406 cloneToken(node.leftBracket), cloneNodeList(node.elements), 1536 cloneNode(node.typeArguments),
1537 cloneToken(node.leftBracket),
1538 cloneNodeList(node.elements),
1407 cloneToken(node.rightBracket)); 1539 cloneToken(node.rightBracket));
1408 1540
1409 @override 1541 @override
1410 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral( 1542 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(
1411 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1543 cloneToken(node.constKeyword),
1412 cloneToken(node.leftBracket), cloneNodeList(node.entries), 1544 cloneNode(node.typeArguments),
1545 cloneToken(node.leftBracket),
1546 cloneNodeList(node.entries),
1413 cloneToken(node.rightBracket)); 1547 cloneToken(node.rightBracket));
1414 1548
1415 @override 1549 @override
1416 MapLiteralEntry visitMapLiteralEntry( 1550 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
1417 MapLiteralEntry node) => new MapLiteralEntry( 1551 new MapLiteralEntry(cloneNode(node.key), cloneToken(node.separator),
1418 cloneNode(node.key), cloneToken(node.separator), cloneNode(node.value)); 1552 cloneNode(node.value));
1419 1553
1420 @override 1554 @override
1421 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 1555 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
1422 new MethodDeclaration(cloneNode(node.documentationComment), 1556 new MethodDeclaration(
1423 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1557 cloneNode(node.documentationComment),
1424 cloneToken(node.modifierKeyword), cloneNode(node.returnType), 1558 cloneNodeList(node.metadata),
1425 cloneToken(node.propertyKeyword), cloneToken(node.operatorKeyword), 1559 cloneToken(node.externalKeyword),
1426 cloneNode(node.name), cloneNode(node.typeParameters), 1560 cloneToken(node.modifierKeyword),
1427 cloneNode(node.parameters), cloneNode(node.body)); 1561 cloneNode(node.returnType),
1562 cloneToken(node.propertyKeyword),
1563 cloneToken(node.operatorKeyword),
1564 cloneNode(node.name),
1565 cloneNode(node.typeParameters),
1566 cloneNode(node.parameters),
1567 cloneNode(node.body));
1428 1568
1429 @override 1569 @override
1430 MethodInvocation visitMethodInvocation(MethodInvocation node) => 1570 MethodInvocation visitMethodInvocation(MethodInvocation node) =>
1431 new MethodInvocation(cloneNode(node.target), cloneToken(node.operator), 1571 new MethodInvocation(
1432 cloneNode(node.methodName), cloneNode(node.typeArguments), 1572 cloneNode(node.target),
1573 cloneToken(node.operator),
1574 cloneNode(node.methodName),
1575 cloneNode(node.typeArguments),
1433 cloneNode(node.argumentList)); 1576 cloneNode(node.argumentList));
1434 1577
1435 @override 1578 @override
1436 NamedExpression visitNamedExpression(NamedExpression node) => 1579 NamedExpression visitNamedExpression(NamedExpression node) =>
1437 new NamedExpression(cloneNode(node.name), cloneNode(node.expression)); 1580 new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
1438 1581
1439 @override 1582 @override
1440 AstNode visitNativeClause(NativeClause node) => 1583 AstNode visitNativeClause(NativeClause node) =>
1441 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name)); 1584 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name));
1442 1585
1443 @override 1586 @override
1444 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => 1587 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
1445 new NativeFunctionBody(cloneToken(node.nativeKeyword), 1588 new NativeFunctionBody(cloneToken(node.nativeKeyword),
1446 cloneNode(node.stringLiteral), cloneToken(node.semicolon)); 1589 cloneNode(node.stringLiteral), cloneToken(node.semicolon));
1447 1590
1448 @override 1591 @override
1449 NullLiteral visitNullLiteral(NullLiteral node) => 1592 NullLiteral visitNullLiteral(NullLiteral node) =>
1450 new NullLiteral(cloneToken(node.literal)); 1593 new NullLiteral(cloneToken(node.literal));
1451 1594
1452 @override 1595 @override
1453 ParenthesizedExpression visitParenthesizedExpression( 1596 ParenthesizedExpression visitParenthesizedExpression(
1454 ParenthesizedExpression node) => new ParenthesizedExpression( 1597 ParenthesizedExpression node) =>
1455 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1598 new ParenthesizedExpression(cloneToken(node.leftParenthesis),
1456 cloneToken(node.rightParenthesis)); 1599 cloneNode(node.expression), cloneToken(node.rightParenthesis));
1457 1600
1458 @override 1601 @override
1459 PartDirective visitPartDirective(PartDirective node) { 1602 PartDirective visitPartDirective(PartDirective node) {
1460 PartDirective directive = new PartDirective( 1603 PartDirective directive = new PartDirective(
1461 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1604 cloneNode(node.documentationComment),
1462 cloneToken(node.partKeyword), cloneNode(node.uri), 1605 cloneNodeList(node.metadata),
1606 cloneToken(node.partKeyword),
1607 cloneNode(node.uri),
1463 cloneToken(node.semicolon)); 1608 cloneToken(node.semicolon));
1464 directive.source = node.source; 1609 directive.source = node.source;
1465 directive.uriContent = node.uriContent; 1610 directive.uriContent = node.uriContent;
1466 return directive; 1611 return directive;
1467 } 1612 }
1468 1613
1469 @override 1614 @override
1470 PartOfDirective visitPartOfDirective(PartOfDirective node) => 1615 PartOfDirective visitPartOfDirective(PartOfDirective node) =>
1471 new PartOfDirective(cloneNode(node.documentationComment), 1616 new PartOfDirective(
1472 cloneNodeList(node.metadata), cloneToken(node.partKeyword), 1617 cloneNode(node.documentationComment),
1473 cloneToken(node.ofKeyword), cloneNode(node.libraryName), 1618 cloneNodeList(node.metadata),
1619 cloneToken(node.partKeyword),
1620 cloneToken(node.ofKeyword),
1621 cloneNode(node.libraryName),
1474 cloneToken(node.semicolon)); 1622 cloneToken(node.semicolon));
1475 1623
1476 @override 1624 @override
1477 PostfixExpression visitPostfixExpression(PostfixExpression node) => 1625 PostfixExpression visitPostfixExpression(PostfixExpression node) =>
1478 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator)); 1626 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator));
1479 1627
1480 @override 1628 @override
1481 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => 1629 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) =>
1482 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period), 1630 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period),
1483 cloneNode(node.identifier)); 1631 cloneNode(node.identifier));
1484 1632
1485 @override 1633 @override
1486 PrefixExpression visitPrefixExpression(PrefixExpression node) => 1634 PrefixExpression visitPrefixExpression(PrefixExpression node) =>
1487 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand)); 1635 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand));
1488 1636
1489 @override 1637 @override
1490 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( 1638 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
1491 cloneNode(node.target), cloneToken(node.operator), 1639 cloneNode(node.target),
1640 cloneToken(node.operator),
1492 cloneNode(node.propertyName)); 1641 cloneNode(node.propertyName));
1493 1642
1494 @override 1643 @override
1495 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 1644 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
1496 RedirectingConstructorInvocation node) => 1645 RedirectingConstructorInvocation node) =>
1497 new RedirectingConstructorInvocation(cloneToken(node.thisKeyword), 1646 new RedirectingConstructorInvocation(
1498 cloneToken(node.period), cloneNode(node.constructorName), 1647 cloneToken(node.thisKeyword),
1648 cloneToken(node.period),
1649 cloneNode(node.constructorName),
1499 cloneNode(node.argumentList)); 1650 cloneNode(node.argumentList));
1500 1651
1501 @override 1652 @override
1502 RethrowExpression visitRethrowExpression(RethrowExpression node) => 1653 RethrowExpression visitRethrowExpression(RethrowExpression node) =>
1503 new RethrowExpression(cloneToken(node.rethrowKeyword)); 1654 new RethrowExpression(cloneToken(node.rethrowKeyword));
1504 1655
1505 @override 1656 @override
1506 ReturnStatement visitReturnStatement(ReturnStatement node) => 1657 ReturnStatement visitReturnStatement(ReturnStatement node) =>
1507 new ReturnStatement(cloneToken(node.returnKeyword), 1658 new ReturnStatement(cloneToken(node.returnKeyword),
1508 cloneNode(node.expression), cloneToken(node.semicolon)); 1659 cloneNode(node.expression), cloneToken(node.semicolon));
1509 1660
1510 @override 1661 @override
1511 ScriptTag visitScriptTag(ScriptTag node) => 1662 ScriptTag visitScriptTag(ScriptTag node) =>
1512 new ScriptTag(cloneToken(node.scriptTag)); 1663 new ScriptTag(cloneToken(node.scriptTag));
1513 1664
1514 @override 1665 @override
1515 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 1666 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
1516 cloneToken(node.keyword), cloneNodeList(node.shownNames)); 1667 cloneToken(node.keyword), cloneNodeList(node.shownNames));
1517 1668
1518 @override 1669 @override
1519 SimpleFormalParameter visitSimpleFormalParameter( 1670 SimpleFormalParameter visitSimpleFormalParameter(
1520 SimpleFormalParameter node) => new SimpleFormalParameter( 1671 SimpleFormalParameter node) =>
1521 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1672 new SimpleFormalParameter(
1522 cloneToken(node.keyword), cloneNode(node.type), 1673 cloneNode(node.documentationComment),
1523 cloneNode(node.identifier)); 1674 cloneNodeList(node.metadata),
1675 cloneToken(node.keyword),
1676 cloneNode(node.type),
1677 cloneNode(node.identifier));
1524 1678
1525 @override 1679 @override
1526 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => 1680 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
1527 new SimpleIdentifier(cloneToken(node.token)); 1681 new SimpleIdentifier(cloneToken(node.token));
1528 1682
1529 @override 1683 @override
1530 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => 1684 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) =>
1531 new SimpleStringLiteral(cloneToken(node.literal), node.value); 1685 new SimpleStringLiteral(cloneToken(node.literal), node.value);
1532 1686
1533 @override 1687 @override
1534 StringInterpolation visitStringInterpolation(StringInterpolation node) => 1688 StringInterpolation visitStringInterpolation(StringInterpolation node) =>
1535 new StringInterpolation(cloneNodeList(node.elements)); 1689 new StringInterpolation(cloneNodeList(node.elements));
1536 1690
1537 @override 1691 @override
1538 SuperConstructorInvocation visitSuperConstructorInvocation( 1692 SuperConstructorInvocation visitSuperConstructorInvocation(
1539 SuperConstructorInvocation node) => new SuperConstructorInvocation( 1693 SuperConstructorInvocation node) =>
1540 cloneToken(node.superKeyword), cloneToken(node.period), 1694 new SuperConstructorInvocation(
1541 cloneNode(node.constructorName), cloneNode(node.argumentList)); 1695 cloneToken(node.superKeyword),
1696 cloneToken(node.period),
1697 cloneNode(node.constructorName),
1698 cloneNode(node.argumentList));
1542 1699
1543 @override 1700 @override
1544 SuperExpression visitSuperExpression(SuperExpression node) => 1701 SuperExpression visitSuperExpression(SuperExpression node) =>
1545 new SuperExpression(cloneToken(node.superKeyword)); 1702 new SuperExpression(cloneToken(node.superKeyword));
1546 1703
1547 @override 1704 @override
1548 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 1705 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
1549 cloneNodeList(node.labels), cloneToken(node.keyword), 1706 cloneNodeList(node.labels),
1550 cloneNode(node.expression), cloneToken(node.colon), 1707 cloneToken(node.keyword),
1708 cloneNode(node.expression),
1709 cloneToken(node.colon),
1551 cloneNodeList(node.statements)); 1710 cloneNodeList(node.statements));
1552 1711
1553 @override 1712 @override
1554 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 1713 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
1555 cloneNodeList(node.labels), cloneToken(node.keyword), 1714 cloneNodeList(node.labels),
1556 cloneToken(node.colon), cloneNodeList(node.statements)); 1715 cloneToken(node.keyword),
1716 cloneToken(node.colon),
1717 cloneNodeList(node.statements));
1557 1718
1558 @override 1719 @override
1559 SwitchStatement visitSwitchStatement(SwitchStatement node) => 1720 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
1560 new SwitchStatement(cloneToken(node.switchKeyword), 1721 new SwitchStatement(
1561 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1722 cloneToken(node.switchKeyword),
1562 cloneToken(node.rightParenthesis), cloneToken(node.leftBracket), 1723 cloneToken(node.leftParenthesis),
1563 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1724 cloneNode(node.expression),
1725 cloneToken(node.rightParenthesis),
1726 cloneToken(node.leftBracket),
1727 cloneNodeList(node.members),
1728 cloneToken(node.rightBracket));
1564 1729
1565 @override 1730 @override
1566 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral( 1731 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(
1567 cloneToken(node.poundSign), cloneTokenList(node.components)); 1732 cloneToken(node.poundSign), cloneTokenList(node.components));
1568 1733
1569 @override 1734 @override
1570 ThisExpression visitThisExpression(ThisExpression node) => 1735 ThisExpression visitThisExpression(ThisExpression node) =>
1571 new ThisExpression(cloneToken(node.thisKeyword)); 1736 new ThisExpression(cloneToken(node.thisKeyword));
1572 1737
1573 @override 1738 @override
1574 ThrowExpression visitThrowExpression(ThrowExpression node) => 1739 ThrowExpression visitThrowExpression(ThrowExpression node) =>
1575 new ThrowExpression( 1740 new ThrowExpression(
1576 cloneToken(node.throwKeyword), cloneNode(node.expression)); 1741 cloneToken(node.throwKeyword), cloneNode(node.expression));
1577 1742
1578 @override 1743 @override
1579 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 1744 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
1580 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 1745 TopLevelVariableDeclaration node) =>
1581 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1746 new TopLevelVariableDeclaration(
1582 cloneNode(node.variables), cloneToken(node.semicolon)); 1747 cloneNode(node.documentationComment),
1748 cloneNodeList(node.metadata),
1749 cloneNode(node.variables),
1750 cloneToken(node.semicolon));
1583 1751
1584 @override 1752 @override
1585 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 1753 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
1586 cloneToken(node.tryKeyword), cloneNode(node.body), 1754 cloneToken(node.tryKeyword),
1587 cloneNodeList(node.catchClauses), cloneToken(node.finallyKeyword), 1755 cloneNode(node.body),
1756 cloneNodeList(node.catchClauses),
1757 cloneToken(node.finallyKeyword),
1588 cloneNode(node.finallyBlock)); 1758 cloneNode(node.finallyBlock));
1589 1759
1590 @override 1760 @override
1591 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 1761 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
1592 new TypeArgumentList(cloneToken(node.leftBracket), 1762 new TypeArgumentList(cloneToken(node.leftBracket),
1593 cloneNodeList(node.arguments), cloneToken(node.rightBracket)); 1763 cloneNodeList(node.arguments), cloneToken(node.rightBracket));
1594 1764
1595 @override 1765 @override
1596 TypeName visitTypeName(TypeName node) => 1766 TypeName visitTypeName(TypeName node) =>
1597 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments)); 1767 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
1598 1768
1599 @override 1769 @override
1600 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 1770 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
1601 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1771 cloneNode(node.documentationComment),
1602 cloneNode(node.name), cloneToken(node.extendsKeyword), 1772 cloneNodeList(node.metadata),
1773 cloneNode(node.name),
1774 cloneToken(node.extendsKeyword),
1603 cloneNode(node.bound)); 1775 cloneNode(node.bound));
1604 1776
1605 @override 1777 @override
1606 TypeParameterList visitTypeParameterList(TypeParameterList node) => 1778 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
1607 new TypeParameterList(cloneToken(node.leftBracket), 1779 new TypeParameterList(cloneToken(node.leftBracket),
1608 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); 1780 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket));
1609 1781
1610 @override 1782 @override
1611 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 1783 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
1612 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals), 1784 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals),
1613 cloneNode(node.initializer)); 1785 cloneNode(node.initializer));
1614 1786
1615 @override 1787 @override
1616 VariableDeclarationList visitVariableDeclarationList( 1788 VariableDeclarationList visitVariableDeclarationList(
1617 VariableDeclarationList node) => new VariableDeclarationList( 1789 VariableDeclarationList node) =>
1618 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1790 new VariableDeclarationList(
1619 cloneToken(node.keyword), cloneNode(node.type), 1791 cloneNode(node.documentationComment),
1620 cloneNodeList(node.variables)); 1792 cloneNodeList(node.metadata),
1793 cloneToken(node.keyword),
1794 cloneNode(node.type),
1795 cloneNodeList(node.variables));
1621 1796
1622 @override 1797 @override
1623 VariableDeclarationStatement visitVariableDeclarationStatement( 1798 VariableDeclarationStatement visitVariableDeclarationStatement(
1624 VariableDeclarationStatement node) => new VariableDeclarationStatement( 1799 VariableDeclarationStatement node) =>
1625 cloneNode(node.variables), cloneToken(node.semicolon)); 1800 new VariableDeclarationStatement(
1801 cloneNode(node.variables), cloneToken(node.semicolon));
1626 1802
1627 @override 1803 @override
1628 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 1804 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
1629 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1805 cloneToken(node.whileKeyword),
1630 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1806 cloneToken(node.leftParenthesis),
1807 cloneNode(node.condition),
1808 cloneToken(node.rightParenthesis),
1631 cloneNode(node.body)); 1809 cloneNode(node.body));
1632 1810
1633 @override 1811 @override
1634 WithClause visitWithClause(WithClause node) => new WithClause( 1812 WithClause visitWithClause(WithClause node) => new WithClause(
1635 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes)); 1813 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes));
1636 1814
1637 @override 1815 @override
1638 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 1816 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
1639 cloneToken(node.yieldKeyword), cloneToken(node.star), 1817 cloneToken(node.yieldKeyword),
1640 cloneNode(node.expression), cloneToken(node.semicolon)); 1818 cloneToken(node.star),
1819 cloneNode(node.expression),
1820 cloneToken(node.semicolon));
1641 1821
1642 /** 1822 /**
1643 * Return a clone of the given [node]. 1823 * Return a clone of the given [node].
1644 */ 1824 */
1645 static AstNode clone(AstNode node) { 1825 static AstNode clone(AstNode node) {
1646 return node.accept(new AstCloner()); 1826 return node.accept(new AstCloner());
1647 } 1827 }
1648 } 1828 }
1649 1829
1650 /** 1830 /**
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 1904
1725 @override 1905 @override
1726 bool visitAsExpression(AsExpression node) { 1906 bool visitAsExpression(AsExpression node) {
1727 AsExpression other = _other as AsExpression; 1907 AsExpression other = _other as AsExpression;
1728 return isEqualNodes(node.expression, other.expression) && 1908 return isEqualNodes(node.expression, other.expression) &&
1729 isEqualTokens(node.asOperator, other.asOperator) && 1909 isEqualTokens(node.asOperator, other.asOperator) &&
1730 isEqualNodes(node.type, other.type); 1910 isEqualNodes(node.type, other.type);
1731 } 1911 }
1732 1912
1733 @override 1913 @override
1734 bool visitAssertStatement(AssertStatement node) { 1914 bool visitAssertStatement(AssertStatement node) {
Brian Wilkerson 2015/09/02 15:49:15 This needs to be updated to compare the new childr
Paul Berry 2015/09/07 19:44:29 Done.
1735 AssertStatement other = _other as AssertStatement; 1915 AssertStatement other = _other as AssertStatement;
1736 return isEqualTokens(node.assertKeyword, other.assertKeyword) && 1916 return isEqualTokens(node.assertKeyword, other.assertKeyword) &&
1737 isEqualTokens(node.leftParenthesis, other.leftParenthesis) && 1917 isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
1738 isEqualNodes(node.condition, other.condition) && 1918 isEqualNodes(node.condition, other.condition) &&
1739 isEqualTokens(node.rightParenthesis, other.rightParenthesis) && 1919 isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
1740 isEqualTokens(node.semicolon, other.semicolon); 1920 isEqualTokens(node.semicolon, other.semicolon);
1741 } 1921 }
1742 1922
1743 @override 1923 @override
1744 bool visitAssignmentExpression(AssignmentExpression node) { 1924 bool visitAssignmentExpression(AssignmentExpression node) {
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
2719 */ 2899 */
2720 static const List<AstNode> EMPTY_LIST = const <AstNode>[]; 2900 static const List<AstNode> EMPTY_LIST = const <AstNode>[];
2721 2901
2722 /** 2902 /**
2723 * A comparator that can be used to sort AST nodes in lexical order. In other 2903 * A comparator that can be used to sort AST nodes in lexical order. In other
2724 * words, `compare` will return a negative value if the offset of the first 2904 * words, `compare` will return a negative value if the offset of the first
2725 * node is less than the offset of the second node, zero (0) if the nodes have 2905 * node is less than the offset of the second node, zero (0) if the nodes have
2726 * the same offset, and a positive value if the offset of the first node is 2906 * the same offset, and a positive value if the offset of the first node is
2727 * greater than the offset of the second node. 2907 * greater than the offset of the second node.
2728 */ 2908 */
2729 static Comparator<AstNode> LEXICAL_ORDER = 2909 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) =>
2730 (AstNode first, AstNode second) => first.offset - second.offset; 2910 first.offset - second.offset;
2731 2911
2732 /** 2912 /**
2733 * The parent of the node, or `null` if the node is the root of an AST 2913 * The parent of the node, or `null` if the node is the root of an AST
2734 * structure. 2914 * structure.
2735 */ 2915 */
2736 AstNode _parent; 2916 AstNode _parent;
2737 2917
2738 /** 2918 /**
2739 * A table mapping the names of properties to their values, or `null` if this 2919 * A table mapping the names of properties to their values, or `null` if this
2740 * node does not have any properties associated with it. 2920 * node does not have any properties associated with it.
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
3839 * The body of the catch block. 4019 * The body of the catch block.
3840 */ 4020 */
3841 Block _body; 4021 Block _body;
3842 4022
3843 /** 4023 /**
3844 * Initialize a newly created catch clause. The [onKeyword] and 4024 * Initialize a newly created catch clause. The [onKeyword] and
3845 * [exceptionType] can be `null` if the clause will catch all exceptions. The 4025 * [exceptionType] can be `null` if the clause will catch all exceptions. The
3846 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not 4026 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not
3847 * referencable within the body. 4027 * referencable within the body.
3848 */ 4028 */
3849 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, 4029 CatchClause(
3850 this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, 4030 this.onKeyword,
3851 SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) { 4031 TypeName exceptionType,
4032 this.catchKeyword,
4033 this.leftParenthesis,
4034 SimpleIdentifier exceptionParameter,
4035 this.comma,
4036 SimpleIdentifier stackTraceParameter,
4037 this.rightParenthesis,
4038 Block body) {
3852 _exceptionType = _becomeParentOf(exceptionType); 4039 _exceptionType = _becomeParentOf(exceptionType);
3853 _exceptionParameter = _becomeParentOf(exceptionParameter); 4040 _exceptionParameter = _becomeParentOf(exceptionParameter);
3854 _stackTraceParameter = _becomeParentOf(stackTraceParameter); 4041 _stackTraceParameter = _becomeParentOf(stackTraceParameter);
3855 _body = _becomeParentOf(body); 4042 _body = _becomeParentOf(body);
3856 } 4043 }
3857 4044
3858 @override 4045 @override
3859 Token get beginToken { 4046 Token get beginToken {
3860 if (onKeyword != null) { 4047 if (onKeyword != null) {
3861 return onKeyword; 4048 return onKeyword;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 /** 4231 /**
4045 * Initialize a newly created class declaration. Either or both of the 4232 * Initialize a newly created class declaration. Either or both of the
4046 * [comment] and [metadata] can be `null` if the class does not have the 4233 * [comment] and [metadata] can be `null` if the class does not have the
4047 * corresponding attribute. The [abstractKeyword] can be `null` if the class 4234 * corresponding attribute. The [abstractKeyword] can be `null` if the class
4048 * is not abstract. The [typeParameters] can be `null` if the class does not 4235 * is not abstract. The [typeParameters] can be `null` if the class does not
4049 * have any type parameters. Any or all of the [extendsClause], [withClause], 4236 * have any type parameters. Any or all of the [extendsClause], [withClause],
4050 * and [implementsClause] can be `null` if the class does not have the 4237 * and [implementsClause] can be `null` if the class does not have the
4051 * corresponding clause. The list of [members] can be `null` if the class does 4238 * corresponding clause. The list of [members] can be `null` if the class does
4052 * not have any members. 4239 * not have any members.
4053 */ 4240 */
4054 ClassDeclaration(Comment comment, List<Annotation> metadata, 4241 ClassDeclaration(
4055 this.abstractKeyword, this.classKeyword, SimpleIdentifier name, 4242 Comment comment,
4056 TypeParameterList typeParameters, ExtendsClause extendsClause, 4243 List<Annotation> metadata,
4057 WithClause withClause, ImplementsClause implementsClause, 4244 this.abstractKeyword,
4058 this.leftBracket, List<ClassMember> members, this.rightBracket) 4245 this.classKeyword,
4246 SimpleIdentifier name,
4247 TypeParameterList typeParameters,
4248 ExtendsClause extendsClause,
4249 WithClause withClause,
4250 ImplementsClause implementsClause,
4251 this.leftBracket,
4252 List<ClassMember> members,
4253 this.rightBracket)
4059 : super(comment, metadata, name) { 4254 : super(comment, metadata, name) {
4060 _typeParameters = _becomeParentOf(typeParameters); 4255 _typeParameters = _becomeParentOf(typeParameters);
4061 _extendsClause = _becomeParentOf(extendsClause); 4256 _extendsClause = _becomeParentOf(extendsClause);
4062 _withClause = _becomeParentOf(withClause); 4257 _withClause = _becomeParentOf(withClause);
4063 _implementsClause = _becomeParentOf(implementsClause); 4258 _implementsClause = _becomeParentOf(implementsClause);
4064 _members = new NodeList<ClassMember>(this, members); 4259 _members = new NodeList<ClassMember>(this, members);
4065 } 4260 }
4066 4261
4067 @override 4262 @override
4068 Iterable get childEntities => super._childEntities 4263 Iterable get childEntities => super._childEntities
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
4300 ImplementsClause _implementsClause; 4495 ImplementsClause _implementsClause;
4301 4496
4302 /** 4497 /**
4303 * Initialize a newly created class type alias. Either or both of the 4498 * Initialize a newly created class type alias. Either or both of the
4304 * [comment] and [metadata] can be `null` if the class type alias does not 4499 * [comment] and [metadata] can be `null` if the class type alias does not
4305 * have the corresponding attribute. The [typeParameters] can be `null` if the 4500 * have the corresponding attribute. The [typeParameters] can be `null` if the
4306 * class does not have any type parameters. The [abstractKeyword] can be 4501 * class does not have any type parameters. The [abstractKeyword] can be
4307 * `null` if the class is not abstract. The [implementsClause] can be `null` 4502 * `null` if the class is not abstract. The [implementsClause] can be `null`
4308 * if the class does not implement any interfaces. 4503 * if the class does not implement any interfaces.
4309 */ 4504 */
4310 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 4505 ClassTypeAlias(
4311 SimpleIdentifier name, TypeParameterList typeParameters, this.equals, 4506 Comment comment,
4312 this.abstractKeyword, TypeName superclass, WithClause withClause, 4507 List<Annotation> metadata,
4313 ImplementsClause implementsClause, Token semicolon) 4508 Token keyword,
4509 SimpleIdentifier name,
4510 TypeParameterList typeParameters,
4511 this.equals,
4512 this.abstractKeyword,
4513 TypeName superclass,
4514 WithClause withClause,
4515 ImplementsClause implementsClause,
4516 Token semicolon)
4314 : super(comment, metadata, keyword, name, semicolon) { 4517 : super(comment, metadata, keyword, name, semicolon) {
4315 _typeParameters = _becomeParentOf(typeParameters); 4518 _typeParameters = _becomeParentOf(typeParameters);
4316 _superclass = _becomeParentOf(superclass); 4519 _superclass = _becomeParentOf(superclass);
4317 _withClause = _becomeParentOf(withClause); 4520 _withClause = _becomeParentOf(withClause);
4318 _implementsClause = _becomeParentOf(implementsClause); 4521 _implementsClause = _becomeParentOf(implementsClause);
4319 } 4522 }
4320 4523
4321 @override 4524 @override
4322 Iterable get childEntities => super._childEntities 4525 Iterable get childEntities => super._childEntities
4323 ..add(typedefKeyword) 4526 ..add(typedefKeyword)
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
4690 */ 4893 */
4691 LineInfo lineInfo; 4894 LineInfo lineInfo;
4692 4895
4693 /** 4896 /**
4694 * Initialize a newly created compilation unit to have the given directives 4897 * Initialize a newly created compilation unit to have the given directives
4695 * and declarations. The [scriptTag] can be `null` if there is no script tag 4898 * and declarations. The [scriptTag] can be `null` if there is no script tag
4696 * in the compilation unit. The list of [directives] can be `null` if there 4899 * in the compilation unit. The list of [directives] can be `null` if there
4697 * are no directives in the compilation unit. The list of [declarations] can 4900 * are no directives in the compilation unit. The list of [declarations] can
4698 * be `null` if there are no declarations in the compilation unit. 4901 * be `null` if there are no declarations in the compilation unit.
4699 */ 4902 */
4700 CompilationUnit(this.beginToken, ScriptTag scriptTag, 4903 CompilationUnit(
4701 List<Directive> directives, List<CompilationUnitMember> declarations, 4904 this.beginToken,
4905 ScriptTag scriptTag,
4906 List<Directive> directives,
4907 List<CompilationUnitMember> declarations,
4702 this.endToken) { 4908 this.endToken) {
4703 _scriptTag = _becomeParentOf(scriptTag); 4909 _scriptTag = _becomeParentOf(scriptTag);
4704 _directives = new NodeList<Directive>(this, directives); 4910 _directives = new NodeList<Directive>(this, directives);
4705 _declarations = new NodeList<CompilationUnitMember>(this, declarations); 4911 _declarations = new NodeList<CompilationUnitMember>(this, declarations);
4706 } 4912 }
4707 4913
4708 @override 4914 @override
4709 Iterable get childEntities { 4915 Iterable get childEntities {
4710 ChildEntities result = new ChildEntities()..add(_scriptTag); 4916 ChildEntities result = new ChildEntities()..add(_scriptTag);
4711 if (_directivesAreBeforeDeclarations) { 4917 if (_directivesAreBeforeDeclarations) {
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
5362 * constructor cannot be used to create a constant. The [factoryKeyword] can 5568 * constructor cannot be used to create a constant. The [factoryKeyword] can
5363 * be `null` if the constructor is not a factory. The [period] and [name] can 5569 * be `null` if the constructor is not a factory. The [period] and [name] can
5364 * both be `null` if the constructor is not a named constructor. The 5570 * both be `null` if the constructor is not a named constructor. The
5365 * [separator] can be `null` if the constructor does not have any initializers 5571 * [separator] can be `null` if the constructor does not have any initializers
5366 * and does not redirect to a different constructor. The list of 5572 * and does not redirect to a different constructor. The list of
5367 * [initializers] can be `null` if the constructor does not have any 5573 * [initializers] can be `null` if the constructor does not have any
5368 * initializers. The [redirectedConstructor] can be `null` if the constructor 5574 * initializers. The [redirectedConstructor] can be `null` if the constructor
5369 * does not redirect to a different constructor. The [body] can be `null` if 5575 * does not redirect to a different constructor. The [body] can be `null` if
5370 * the constructor does not have a body. 5576 * the constructor does not have a body.
5371 */ 5577 */
5372 ConstructorDeclaration(Comment comment, List<Annotation> metadata, 5578 ConstructorDeclaration(
5373 this.externalKeyword, this.constKeyword, this.factoryKeyword, 5579 Comment comment,
5374 Identifier returnType, this.period, SimpleIdentifier name, 5580 List<Annotation> metadata,
5375 FormalParameterList parameters, this.separator, 5581 this.externalKeyword,
5582 this.constKeyword,
5583 this.factoryKeyword,
5584 Identifier returnType,
5585 this.period,
5586 SimpleIdentifier name,
5587 FormalParameterList parameters,
5588 this.separator,
5376 List<ConstructorInitializer> initializers, 5589 List<ConstructorInitializer> initializers,
5377 ConstructorName redirectedConstructor, FunctionBody body) 5590 ConstructorName redirectedConstructor,
5591 FunctionBody body)
5378 : super(comment, metadata) { 5592 : super(comment, metadata) {
5379 _returnType = _becomeParentOf(returnType); 5593 _returnType = _becomeParentOf(returnType);
5380 _name = _becomeParentOf(name); 5594 _name = _becomeParentOf(name);
5381 _parameters = _becomeParentOf(parameters); 5595 _parameters = _becomeParentOf(parameters);
5382 _initializers = new NodeList<ConstructorInitializer>(this, initializers); 5596 _initializers = new NodeList<ConstructorInitializer>(this, initializers);
5383 _redirectedConstructor = _becomeParentOf(redirectedConstructor); 5597 _redirectedConstructor = _becomeParentOf(redirectedConstructor);
5384 _body = _becomeParentOf(body); 5598 _body = _becomeParentOf(body);
5385 } 5599 }
5386 5600
5387 /** 5601 /**
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
6148 Token rightParenthesis; 6362 Token rightParenthesis;
6149 6363
6150 /** 6364 /**
6151 * The semicolon terminating the statement. 6365 * The semicolon terminating the statement.
6152 */ 6366 */
6153 Token semicolon; 6367 Token semicolon;
6154 6368
6155 /** 6369 /**
6156 * Initialize a newly created do loop. 6370 * Initialize a newly created do loop.
6157 */ 6371 */
6158 DoStatement(this.doKeyword, Statement body, this.whileKeyword, 6372 DoStatement(
6159 this.leftParenthesis, Expression condition, this.rightParenthesis, 6373 this.doKeyword,
6374 Statement body,
6375 this.whileKeyword,
6376 this.leftParenthesis,
6377 Expression condition,
6378 this.rightParenthesis,
6160 this.semicolon) { 6379 this.semicolon) {
6161 _body = _becomeParentOf(body); 6380 _body = _becomeParentOf(body);
6162 _condition = _becomeParentOf(condition); 6381 _condition = _becomeParentOf(condition);
6163 } 6382 }
6164 6383
6165 @override 6384 @override
6166 Token get beginToken => doKeyword; 6385 Token get beginToken => doKeyword;
6167 6386
6168 /** 6387 /**
6169 * Return the body of the loop. 6388 * Return the body of the loop.
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
6555 * The right curly bracket. 6774 * The right curly bracket.
6556 */ 6775 */
6557 Token rightBracket; 6776 Token rightBracket;
6558 6777
6559 /** 6778 /**
6560 * Initialize a newly created enumeration declaration. Either or both of the 6779 * Initialize a newly created enumeration declaration. Either or both of the
6561 * [comment] and [metadata] can be `null` if the declaration does not have the 6780 * [comment] and [metadata] can be `null` if the declaration does not have the
6562 * corresponding attribute. The list of [constants] must contain at least one 6781 * corresponding attribute. The list of [constants] must contain at least one
6563 * value. 6782 * value.
6564 */ 6783 */
6565 EnumDeclaration(Comment comment, List<Annotation> metadata, this.enumKeyword, 6784 EnumDeclaration(
6566 SimpleIdentifier name, this.leftBracket, 6785 Comment comment,
6567 List<EnumConstantDeclaration> constants, this.rightBracket) 6786 List<Annotation> metadata,
6787 this.enumKeyword,
6788 SimpleIdentifier name,
6789 this.leftBracket,
6790 List<EnumConstantDeclaration> constants,
6791 this.rightBracket)
6568 : super(comment, metadata, name) { 6792 : super(comment, metadata, name) {
6569 _constants = new NodeList<EnumConstantDeclaration>(this, constants); 6793 _constants = new NodeList<EnumConstantDeclaration>(this, constants);
6570 } 6794 }
6571 6795
6572 @override 6796 @override
6573 // TODO(brianwilkerson) Add commas? 6797 // TODO(brianwilkerson) Add commas?
6574 Iterable get childEntities => super._childEntities 6798 Iterable get childEntities => super._childEntities
6575 ..add(enumKeyword) 6799 ..add(enumKeyword)
6576 ..add(_name) 6800 ..add(_name)
6577 ..add(leftBracket) 6801 ..add(leftBracket)
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
7172 7396
7173 /** 7397 /**
7174 * Initialize a newly created formal parameter. Either or both of the 7398 * Initialize a newly created formal parameter. Either or both of the
7175 * [comment] and [metadata] can be `null` if the parameter does not have the 7399 * [comment] and [metadata] can be `null` if the parameter does not have the
7176 * corresponding attribute. The [keyword] can be `null` if there is a type. 7400 * corresponding attribute. The [keyword] can be `null` if there is a type.
7177 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and 7401 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
7178 * [period] can be `null` if the keyword 'this' was not provided. The 7402 * [period] can be `null` if the keyword 'this' was not provided. The
7179 * [parameters] can be `null` if this is not a function-typed field formal 7403 * [parameters] can be `null` if this is not a function-typed field formal
7180 * parameter. 7404 * parameter.
7181 */ 7405 */
7182 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, 7406 FieldFormalParameter(
7183 TypeName type, this.thisKeyword, this.period, SimpleIdentifier identifier, 7407 Comment comment,
7184 TypeParameterList typeParameters, FormalParameterList parameters) 7408 List<Annotation> metadata,
7409 this.keyword,
7410 TypeName type,
7411 this.thisKeyword,
7412 this.period,
7413 SimpleIdentifier identifier,
7414 TypeParameterList typeParameters,
7415 FormalParameterList parameters)
7185 : super(comment, metadata, identifier) { 7416 : super(comment, metadata, identifier) {
7186 _type = _becomeParentOf(type); 7417 _type = _becomeParentOf(type);
7187 _typeParameters = _becomeParentOf(typeParameters); 7418 _typeParameters = _becomeParentOf(typeParameters);
7188 _parameters = _becomeParentOf(parameters); 7419 _parameters = _becomeParentOf(parameters);
7189 } 7420 }
7190 7421
7191 @override 7422 @override
7192 Token get beginToken { 7423 Token get beginToken {
7193 if (keyword != null) { 7424 if (keyword != null) {
7194 return keyword; 7425 return keyword;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
7346 /** 7577 /**
7347 * The body of the loop. 7578 * The body of the loop.
7348 */ 7579 */
7349 Statement _body; 7580 Statement _body;
7350 7581
7351 /** 7582 /**
7352 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7583 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7353 * `null` if this is not an asynchronous for loop. 7584 * `null` if this is not an asynchronous for loop.
7354 */ 7585 */
7355 @deprecated // Use new ForEachStatement.withDeclaration(...) 7586 @deprecated // Use new ForEachStatement.withDeclaration(...)
7356 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, 7587 ForEachStatement.con1(
7357 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7588 this.awaitKeyword,
7358 Expression iterator, this.rightParenthesis, Statement body) { 7589 this.forKeyword,
7590 this.leftParenthesis,
7591 DeclaredIdentifier loopVariable,
7592 this.inKeyword,
7593 Expression iterator,
7594 this.rightParenthesis,
7595 Statement body) {
7359 _loopVariable = _becomeParentOf(loopVariable); 7596 _loopVariable = _becomeParentOf(loopVariable);
7360 _iterable = _becomeParentOf(iterator); 7597 _iterable = _becomeParentOf(iterator);
7361 _body = _becomeParentOf(body); 7598 _body = _becomeParentOf(body);
7362 } 7599 }
7363 7600
7364 /** 7601 /**
7365 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7602 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7366 * `null` if this is not an asynchronous for loop. 7603 * `null` if this is not an asynchronous for loop.
7367 */ 7604 */
7368 @deprecated // Use new ForEachStatement.withReference(...) 7605 @deprecated // Use new ForEachStatement.withReference(...)
7369 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, 7606 ForEachStatement.con2(
7370 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7607 this.awaitKeyword,
7371 Expression iterator, this.rightParenthesis, Statement body) { 7608 this.forKeyword,
7609 this.leftParenthesis,
7610 SimpleIdentifier identifier,
7611 this.inKeyword,
7612 Expression iterator,
7613 this.rightParenthesis,
7614 Statement body) {
7372 _identifier = _becomeParentOf(identifier); 7615 _identifier = _becomeParentOf(identifier);
7373 _iterable = _becomeParentOf(iterator); 7616 _iterable = _becomeParentOf(iterator);
7374 _body = _becomeParentOf(body); 7617 _body = _becomeParentOf(body);
7375 } 7618 }
7376 7619
7377 /** 7620 /**
7378 * Initialize a newly created for-each statement whose loop control variable 7621 * Initialize a newly created for-each statement whose loop control variable
7379 * is declared internally (in the for-loop part). The [awaitKeyword] can be 7622 * is declared internally (in the for-loop part). The [awaitKeyword] can be
7380 * `null` if this is not an asynchronous for loop. 7623 * `null` if this is not an asynchronous for loop.
7381 */ 7624 */
7382 ForEachStatement.withDeclaration(this.awaitKeyword, this.forKeyword, 7625 ForEachStatement.withDeclaration(
7383 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7626 this.awaitKeyword,
7384 Expression iterator, this.rightParenthesis, Statement body) { 7627 this.forKeyword,
7628 this.leftParenthesis,
7629 DeclaredIdentifier loopVariable,
7630 this.inKeyword,
7631 Expression iterator,
7632 this.rightParenthesis,
7633 Statement body) {
7385 _loopVariable = _becomeParentOf(loopVariable); 7634 _loopVariable = _becomeParentOf(loopVariable);
7386 _iterable = _becomeParentOf(iterator); 7635 _iterable = _becomeParentOf(iterator);
7387 _body = _becomeParentOf(body); 7636 _body = _becomeParentOf(body);
7388 } 7637 }
7389 7638
7390 /** 7639 /**
7391 * Initialize a newly created for-each statement whose loop control variable 7640 * Initialize a newly created for-each statement whose loop control variable
7392 * is declared outside the for loop. The [awaitKeyword] can be `null` if this 7641 * is declared outside the for loop. The [awaitKeyword] can be `null` if this
7393 * is not an asynchronous for loop. 7642 * is not an asynchronous for loop.
7394 */ 7643 */
7395 ForEachStatement.withReference(this.awaitKeyword, this.forKeyword, 7644 ForEachStatement.withReference(
7396 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7645 this.awaitKeyword,
7397 Expression iterator, this.rightParenthesis, Statement body) { 7646 this.forKeyword,
7647 this.leftParenthesis,
7648 SimpleIdentifier identifier,
7649 this.inKeyword,
7650 Expression iterator,
7651 this.rightParenthesis,
7652 Statement body) {
7398 _identifier = _becomeParentOf(identifier); 7653 _identifier = _becomeParentOf(identifier);
7399 _iterable = _becomeParentOf(iterator); 7654 _iterable = _becomeParentOf(iterator);
7400 _body = _becomeParentOf(body); 7655 _body = _becomeParentOf(body);
7401 } 7656 }
7402 7657
7403 @override 7658 @override
7404 Token get beginToken => forKeyword; 7659 Token get beginToken => forKeyword;
7405 7660
7406 /** 7661 /**
7407 * Return the body of the loop. 7662 * Return the body of the loop.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
7718 * The body of the loop. 7973 * The body of the loop.
7719 */ 7974 */
7720 Statement _body; 7975 Statement _body;
7721 7976
7722 /** 7977 /**
7723 * Initialize a newly created for statement. Either the [variableList] or the 7978 * Initialize a newly created for statement. Either the [variableList] or the
7724 * [initialization] must be `null`. Either the [condition] and the list of 7979 * [initialization] must be `null`. Either the [condition] and the list of
7725 * [updaters] can be `null` if the loop does not have the corresponding 7980 * [updaters] can be `null` if the loop does not have the corresponding
7726 * attribute. 7981 * attribute.
7727 */ 7982 */
7728 ForStatement(this.forKeyword, this.leftParenthesis, 7983 ForStatement(
7729 VariableDeclarationList variableList, Expression initialization, 7984 this.forKeyword,
7730 this.leftSeparator, Expression condition, this.rightSeparator, 7985 this.leftParenthesis,
7731 List<Expression> updaters, this.rightParenthesis, Statement body) { 7986 VariableDeclarationList variableList,
7987 Expression initialization,
7988 this.leftSeparator,
7989 Expression condition,
7990 this.rightSeparator,
7991 List<Expression> updaters,
7992 this.rightParenthesis,
7993 Statement body) {
7732 _variableList = _becomeParentOf(variableList); 7994 _variableList = _becomeParentOf(variableList);
7733 _initialization = _becomeParentOf(initialization); 7995 _initialization = _becomeParentOf(initialization);
7734 _condition = _becomeParentOf(condition); 7996 _condition = _becomeParentOf(condition);
7735 _updaters = new NodeList<Expression>(this, updaters); 7997 _updaters = new NodeList<Expression>(this, updaters);
7736 _body = _becomeParentOf(body); 7998 _body = _becomeParentOf(body);
7737 } 7999 }
7738 8000
7739 @override 8001 @override
7740 Token get beginToken => forKeyword; 8002 Token get beginToken => forKeyword;
7741 8003
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
7896 FunctionExpression _functionExpression; 8158 FunctionExpression _functionExpression;
7897 8159
7898 /** 8160 /**
7899 * Initialize a newly created function declaration. Either or both of the 8161 * Initialize a newly created function declaration. Either or both of the
7900 * [comment] and [metadata] can be `null` if the function does not have the 8162 * [comment] and [metadata] can be `null` if the function does not have the
7901 * corresponding attribute. The [externalKeyword] can be `null` if the 8163 * corresponding attribute. The [externalKeyword] can be `null` if the
7902 * function is not an external function. The [returnType] can be `null` if no 8164 * function is not an external function. The [returnType] can be `null` if no
7903 * return type was specified. The [propertyKeyword] can be `null` if the 8165 * return type was specified. The [propertyKeyword] can be `null` if the
7904 * function is neither a getter or a setter. 8166 * function is neither a getter or a setter.
7905 */ 8167 */
7906 FunctionDeclaration(Comment comment, List<Annotation> metadata, 8168 FunctionDeclaration(
7907 this.externalKeyword, TypeName returnType, this.propertyKeyword, 8169 Comment comment,
7908 SimpleIdentifier name, FunctionExpression functionExpression) 8170 List<Annotation> metadata,
8171 this.externalKeyword,
8172 TypeName returnType,
8173 this.propertyKeyword,
8174 SimpleIdentifier name,
8175 FunctionExpression functionExpression)
7909 : super(comment, metadata, name) { 8176 : super(comment, metadata, name) {
7910 _returnType = _becomeParentOf(returnType); 8177 _returnType = _becomeParentOf(returnType);
7911 _functionExpression = _becomeParentOf(functionExpression); 8178 _functionExpression = _becomeParentOf(functionExpression);
7912 } 8179 }
7913 8180
7914 @override 8181 @override
7915 Iterable get childEntities => super._childEntities 8182 Iterable get childEntities => super._childEntities
7916 ..add(externalKeyword) 8183 ..add(externalKeyword)
7917 ..add(_returnType) 8184 ..add(_returnType)
7918 ..add(propertyKeyword) 8185 ..add(propertyKeyword)
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
8314 */ 8581 */
8315 FormalParameterList _parameters; 8582 FormalParameterList _parameters;
8316 8583
8317 /** 8584 /**
8318 * Initialize a newly created function type alias. Either or both of the 8585 * Initialize a newly created function type alias. Either or both of the
8319 * [comment] and [metadata] can be `null` if the function does not have the 8586 * [comment] and [metadata] can be `null` if the function does not have the
8320 * corresponding attribute. The [returnType] can be `null` if no return type 8587 * corresponding attribute. The [returnType] can be `null` if no return type
8321 * was specified. The [typeParameters] can be `null` if the function has no 8588 * was specified. The [typeParameters] can be `null` if the function has no
8322 * type parameters. 8589 * type parameters.
8323 */ 8590 */
8324 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 8591 FunctionTypeAlias(
8325 TypeName returnType, SimpleIdentifier name, 8592 Comment comment,
8326 TypeParameterList typeParameters, FormalParameterList parameters, 8593 List<Annotation> metadata,
8594 Token keyword,
8595 TypeName returnType,
8596 SimpleIdentifier name,
8597 TypeParameterList typeParameters,
8598 FormalParameterList parameters,
8327 Token semicolon) 8599 Token semicolon)
8328 : super(comment, metadata, keyword, name, semicolon) { 8600 : super(comment, metadata, keyword, name, semicolon) {
8329 _returnType = _becomeParentOf(returnType); 8601 _returnType = _becomeParentOf(returnType);
8330 _typeParameters = _becomeParentOf(typeParameters); 8602 _typeParameters = _becomeParentOf(typeParameters);
8331 _parameters = _becomeParentOf(parameters); 8603 _parameters = _becomeParentOf(parameters);
8332 } 8604 }
8333 8605
8334 @override 8606 @override
8335 Iterable get childEntities => super._childEntities 8607 Iterable get childEntities => super._childEntities
8336 ..add(typedefKeyword) 8608 ..add(typedefKeyword)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
8421 * The parameters of the function-typed parameter. 8693 * The parameters of the function-typed parameter.
8422 */ 8694 */
8423 FormalParameterList _parameters; 8695 FormalParameterList _parameters;
8424 8696
8425 /** 8697 /**
8426 * Initialize a newly created formal parameter. Either or both of the 8698 * Initialize a newly created formal parameter. Either or both of the
8427 * [comment] and [metadata] can be `null` if the parameter does not have the 8699 * [comment] and [metadata] can be `null` if the parameter does not have the
8428 * corresponding attribute. The [returnType] can be `null` if no return type 8700 * corresponding attribute. The [returnType] can be `null` if no return type
8429 * was specified. 8701 * was specified.
8430 */ 8702 */
8431 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, 8703 FunctionTypedFormalParameter(
8432 TypeName returnType, SimpleIdentifier identifier, 8704 Comment comment,
8433 TypeParameterList typeParameters, FormalParameterList parameters) 8705 List<Annotation> metadata,
8706 TypeName returnType,
8707 SimpleIdentifier identifier,
8708 TypeParameterList typeParameters,
8709 FormalParameterList parameters)
8434 : super(comment, metadata, identifier) { 8710 : super(comment, metadata, identifier) {
8435 _returnType = _becomeParentOf(returnType); 8711 _returnType = _becomeParentOf(returnType);
8436 _typeParameters = _becomeParentOf(typeParameters); 8712 _typeParameters = _becomeParentOf(typeParameters);
8437 _parameters = _becomeParentOf(parameters); 8713 _parameters = _becomeParentOf(parameters);
8438 } 8714 }
8439 8715
8440 @override 8716 @override
8441 Token get beginToken { 8717 Token get beginToken {
8442 if (_returnType != null) { 8718 if (_returnType != null) {
8443 return _returnType.beginToken; 8719 return _returnType.beginToken;
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
9080 /** 9356 /**
9081 * The statement that is executed if the condition evaluates to `false`, or 9357 * The statement that is executed if the condition evaluates to `false`, or
9082 * `null` if there is no else statement. 9358 * `null` if there is no else statement.
9083 */ 9359 */
9084 Statement _elseStatement; 9360 Statement _elseStatement;
9085 9361
9086 /** 9362 /**
9087 * Initialize a newly created if statement. The [elseKeyword] and 9363 * Initialize a newly created if statement. The [elseKeyword] and
9088 * [elseStatement] can be `null` if there is no else clause. 9364 * [elseStatement] can be `null` if there is no else clause.
9089 */ 9365 */
9090 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, 9366 IfStatement(
9091 this.rightParenthesis, Statement thenStatement, this.elseKeyword, 9367 this.ifKeyword,
9368 this.leftParenthesis,
9369 Expression condition,
9370 this.rightParenthesis,
9371 Statement thenStatement,
9372 this.elseKeyword,
9092 Statement elseStatement) { 9373 Statement elseStatement) {
9093 _condition = _becomeParentOf(condition); 9374 _condition = _becomeParentOf(condition);
9094 _thenStatement = _becomeParentOf(thenStatement); 9375 _thenStatement = _becomeParentOf(thenStatement);
9095 _elseStatement = _becomeParentOf(elseStatement); 9376 _elseStatement = _becomeParentOf(elseStatement);
9096 } 9377 }
9097 9378
9098 @override 9379 @override
9099 Token get beginToken => ifKeyword; 9380 Token get beginToken => ifKeyword;
9100 9381
9101 @override 9382 @override
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
9235 } 9516 }
9236 9517
9237 /** 9518 /**
9238 * An import directive. 9519 * An import directive.
9239 * 9520 *
9240 * > importDirective ::= 9521 * > importDirective ::=
9241 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';' 9522 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';'
9242 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';' 9523 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';'
9243 */ 9524 */
9244 class ImportDirective extends NamespaceDirective { 9525 class ImportDirective extends NamespaceDirective {
9245 static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1, 9526 static Comparator<ImportDirective> COMPARATOR =
9246 ImportDirective import2) { 9527 (ImportDirective import1, ImportDirective import2) {
9247 // 9528 //
9248 // uri 9529 // uri
9249 // 9530 //
9250 StringLiteral uri1 = import1.uri; 9531 StringLiteral uri1 = import1.uri;
9251 StringLiteral uri2 = import2.uri; 9532 StringLiteral uri2 = import2.uri;
9252 String uriStr1 = uri1.stringValue; 9533 String uriStr1 = uri1.stringValue;
9253 String uriStr2 = uri2.stringValue; 9534 String uriStr2 = uri2.stringValue;
9254 if (uriStr1 != null || uriStr2 != null) { 9535 if (uriStr1 != null || uriStr2 != null) {
9255 if (uriStr1 == null) { 9536 if (uriStr1 == null) {
9256 return -1; 9537 return -1;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
9355 SimpleIdentifier _prefix; 9636 SimpleIdentifier _prefix;
9356 9637
9357 /** 9638 /**
9358 * Initialize a newly created import directive. Either or both of the 9639 * Initialize a newly created import directive. Either or both of the
9359 * [comment] and [metadata] can be `null` if the function does not have the 9640 * [comment] and [metadata] can be `null` if the function does not have the
9360 * corresponding attribute. The [deferredKeyword] can be `null` if the import 9641 * corresponding attribute. The [deferredKeyword] can be `null` if the import
9361 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import 9642 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import
9362 * does not specify a prefix. The list of [combinators] can be `null` if there 9643 * does not specify a prefix. The list of [combinators] can be `null` if there
9363 * are no combinators. 9644 * are no combinators.
9364 */ 9645 */
9365 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, 9646 ImportDirective(
9366 StringLiteral libraryUri, this.deferredKeyword, this.asKeyword, 9647 Comment comment,
9367 SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) 9648 List<Annotation> metadata,
9649 Token keyword,
9650 StringLiteral libraryUri,
9651 this.deferredKeyword,
9652 this.asKeyword,
9653 SimpleIdentifier prefix,
9654 List<Combinator> combinators,
9655 Token semicolon)
9368 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { 9656 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
9369 _prefix = _becomeParentOf(prefix); 9657 _prefix = _becomeParentOf(prefix);
9370 } 9658 }
9371 9659
9372 /** 9660 /**
9373 * The token representing the 'as' token, or `null` if the imported names are 9661 * The token representing the 'as' token, or `null` if the imported names are
9374 * not prefixed. 9662 * not prefixed.
9375 */ 9663 */
9376 @deprecated // Use "this.asKeyword" 9664 @deprecated // Use "this.asKeyword"
9377 Token get asToken => asKeyword; 9665 Token get asToken => asKeyword;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
9472 * mapping of old tokens to new tokens. 9760 * mapping of old tokens to new tokens.
9473 */ 9761 */
9474 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); 9762 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap);
9475 9763
9476 @override 9764 @override
9477 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 9765 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
9478 new AdjacentStrings(_cloneNodeList(node.strings)); 9766 new AdjacentStrings(_cloneNodeList(node.strings));
9479 9767
9480 @override 9768 @override
9481 Annotation visitAnnotation(Annotation node) { 9769 Annotation visitAnnotation(Annotation node) {
9482 Annotation copy = new Annotation(_mapToken(node.atSign), 9770 Annotation copy = new Annotation(
9483 _cloneNode(node.name), _mapToken(node.period), 9771 _mapToken(node.atSign),
9484 _cloneNode(node.constructorName), _cloneNode(node.arguments)); 9772 _cloneNode(node.name),
9773 _mapToken(node.period),
9774 _cloneNode(node.constructorName),
9775 _cloneNode(node.arguments));
9485 copy.element = node.element; 9776 copy.element = node.element;
9486 return copy; 9777 return copy;
9487 } 9778 }
9488 9779
9489 @override 9780 @override
9490 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 9781 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
9491 _mapToken(node.leftParenthesis), _cloneNodeList(node.arguments), 9782 _mapToken(node.leftParenthesis),
9783 _cloneNodeList(node.arguments),
9492 _mapToken(node.rightParenthesis)); 9784 _mapToken(node.rightParenthesis));
9493 9785
9494 @override 9786 @override
9495 AsExpression visitAsExpression(AsExpression node) { 9787 AsExpression visitAsExpression(AsExpression node) {
9496 AsExpression copy = new AsExpression(_cloneNode(node.expression), 9788 AsExpression copy = new AsExpression(_cloneNode(node.expression),
9497 _mapToken(node.asOperator), _cloneNode(node.type)); 9789 _mapToken(node.asOperator), _cloneNode(node.type));
9498 copy.propagatedType = node.propagatedType; 9790 copy.propagatedType = node.propagatedType;
9499 copy.staticType = node.staticType; 9791 copy.staticType = node.staticType;
9500 return copy; 9792 return copy;
9501 } 9793 }
9502 9794
9503 @override 9795 @override
9504 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 9796 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
Brian Wilkerson 2015/09/02 15:49:16 This needs to be updated to map/clone the new chil
Paul Berry 2015/09/07 19:44:29 Done.
9505 _mapToken(node.assertKeyword), _mapToken(node.leftParenthesis), 9797 _mapToken(node.assertKeyword),
9506 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 9798 _mapToken(node.leftParenthesis),
9799 _cloneNode(node.condition),
9800 _mapToken(node.rightParenthesis),
9507 _mapToken(node.semicolon)); 9801 _mapToken(node.semicolon));
9508 9802
9509 @override 9803 @override
9510 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 9804 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
9511 AssignmentExpression copy = new AssignmentExpression( 9805 AssignmentExpression copy = new AssignmentExpression(
9512 _cloneNode(node.leftHandSide), _mapToken(node.operator), 9806 _cloneNode(node.leftHandSide),
9807 _mapToken(node.operator),
9513 _cloneNode(node.rightHandSide)); 9808 _cloneNode(node.rightHandSide));
9514 copy.propagatedElement = node.propagatedElement; 9809 copy.propagatedElement = node.propagatedElement;
9515 copy.propagatedType = node.propagatedType; 9810 copy.propagatedType = node.propagatedType;
9516 copy.staticElement = node.staticElement; 9811 copy.staticElement = node.staticElement;
9517 copy.staticType = node.staticType; 9812 copy.staticType = node.staticType;
9518 return copy; 9813 return copy;
9519 } 9814 }
9520 9815
9521 @override 9816 @override
9522 AwaitExpression visitAwaitExpression(AwaitExpression node) => 9817 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
9523 new AwaitExpression( 9818 new AwaitExpression(
9524 _mapToken(node.awaitKeyword), _cloneNode(node.expression)); 9819 _mapToken(node.awaitKeyword), _cloneNode(node.expression));
9525 9820
9526 @override 9821 @override
9527 BinaryExpression visitBinaryExpression(BinaryExpression node) { 9822 BinaryExpression visitBinaryExpression(BinaryExpression node) {
9528 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), 9823 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand),
9529 _mapToken(node.operator), _cloneNode(node.rightOperand)); 9824 _mapToken(node.operator), _cloneNode(node.rightOperand));
9530 copy.propagatedElement = node.propagatedElement; 9825 copy.propagatedElement = node.propagatedElement;
9531 copy.propagatedType = node.propagatedType; 9826 copy.propagatedType = node.propagatedType;
9532 copy.staticElement = node.staticElement; 9827 copy.staticElement = node.staticElement;
9533 copy.staticType = node.staticType; 9828 copy.staticType = node.staticType;
9534 return copy; 9829 return copy;
9535 } 9830 }
9536 9831
9537 @override 9832 @override
9538 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), 9833 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket),
9539 _cloneNodeList(node.statements), _mapToken(node.rightBracket)); 9834 _cloneNodeList(node.statements), _mapToken(node.rightBracket));
9540 9835
9541 @override 9836 @override
9542 BlockFunctionBody visitBlockFunctionBody( 9837 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
9543 BlockFunctionBody node) => new BlockFunctionBody( 9838 new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star),
9544 _mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block)); 9839 _cloneNode(node.block));
9545 9840
9546 @override 9841 @override
9547 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 9842 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
9548 BooleanLiteral copy = 9843 BooleanLiteral copy =
9549 new BooleanLiteral(_mapToken(node.literal), node.value); 9844 new BooleanLiteral(_mapToken(node.literal), node.value);
9550 copy.propagatedType = node.propagatedType; 9845 copy.propagatedType = node.propagatedType;
9551 copy.staticType = node.staticType; 9846 copy.staticType = node.staticType;
9552 return copy; 9847 return copy;
9553 } 9848 }
9554 9849
9555 @override 9850 @override
9556 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 9851 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
9557 _mapToken(node.breakKeyword), _cloneNode(node.label), 9852 _mapToken(node.breakKeyword),
9853 _cloneNode(node.label),
9558 _mapToken(node.semicolon)); 9854 _mapToken(node.semicolon));
9559 9855
9560 @override 9856 @override
9561 CascadeExpression visitCascadeExpression(CascadeExpression node) { 9857 CascadeExpression visitCascadeExpression(CascadeExpression node) {
9562 CascadeExpression copy = new CascadeExpression( 9858 CascadeExpression copy = new CascadeExpression(
9563 _cloneNode(node.target), _cloneNodeList(node.cascadeSections)); 9859 _cloneNode(node.target), _cloneNodeList(node.cascadeSections));
9564 copy.propagatedType = node.propagatedType; 9860 copy.propagatedType = node.propagatedType;
9565 copy.staticType = node.staticType; 9861 copy.staticType = node.staticType;
9566 return copy; 9862 return copy;
9567 } 9863 }
9568 9864
9569 @override 9865 @override
9570 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 9866 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
9571 _mapToken(node.onKeyword), _cloneNode(node.exceptionType), 9867 _mapToken(node.onKeyword),
9572 _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis), 9868 _cloneNode(node.exceptionType),
9573 _cloneNode(node.exceptionParameter), _mapToken(node.comma), 9869 _mapToken(node.catchKeyword),
9574 _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis), 9870 _mapToken(node.leftParenthesis),
9871 _cloneNode(node.exceptionParameter),
9872 _mapToken(node.comma),
9873 _cloneNode(node.stackTraceParameter),
9874 _mapToken(node.rightParenthesis),
9575 _cloneNode(node.body)); 9875 _cloneNode(node.body));
9576 9876
9577 @override 9877 @override
9578 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 9878 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
9579 ClassDeclaration copy = new ClassDeclaration( 9879 ClassDeclaration copy = new ClassDeclaration(
9580 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9880 _cloneNode(node.documentationComment),
9581 _mapToken(node.abstractKeyword), _mapToken(node.classKeyword), 9881 _cloneNodeList(node.metadata),
9582 _cloneNode(node.name), _cloneNode(node.typeParameters), 9882 _mapToken(node.abstractKeyword),
9583 _cloneNode(node.extendsClause), _cloneNode(node.withClause), 9883 _mapToken(node.classKeyword),
9584 _cloneNode(node.implementsClause), _mapToken(node.leftBracket), 9884 _cloneNode(node.name),
9585 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 9885 _cloneNode(node.typeParameters),
9886 _cloneNode(node.extendsClause),
9887 _cloneNode(node.withClause),
9888 _cloneNode(node.implementsClause),
9889 _mapToken(node.leftBracket),
9890 _cloneNodeList(node.members),
9891 _mapToken(node.rightBracket));
9586 copy.nativeClause = _cloneNode(node.nativeClause); 9892 copy.nativeClause = _cloneNode(node.nativeClause);
9587 return copy; 9893 return copy;
9588 } 9894 }
9589 9895
9590 @override 9896 @override
9591 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 9897 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
9592 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9898 _cloneNode(node.documentationComment),
9593 _mapToken(node.typedefKeyword), _cloneNode(node.name), 9899 _cloneNodeList(node.metadata),
9594 _cloneNode(node.typeParameters), _mapToken(node.equals), 9900 _mapToken(node.typedefKeyword),
9595 _mapToken(node.abstractKeyword), _cloneNode(node.superclass), 9901 _cloneNode(node.name),
9596 _cloneNode(node.withClause), _cloneNode(node.implementsClause), 9902 _cloneNode(node.typeParameters),
9903 _mapToken(node.equals),
9904 _mapToken(node.abstractKeyword),
9905 _cloneNode(node.superclass),
9906 _cloneNode(node.withClause),
9907 _cloneNode(node.implementsClause),
9597 _mapToken(node.semicolon)); 9908 _mapToken(node.semicolon));
9598 9909
9599 @override 9910 @override
9600 Comment visitComment(Comment node) { 9911 Comment visitComment(Comment node) {
9601 if (node.isDocumentation) { 9912 if (node.isDocumentation) {
9602 return Comment.createDocumentationCommentWithReferences( 9913 return Comment.createDocumentationCommentWithReferences(
9603 _mapTokens(node.tokens), _cloneNodeList(node.references)); 9914 _mapTokens(node.tokens), _cloneNodeList(node.references));
9604 } else if (node.isBlock) { 9915 } else if (node.isBlock) {
9605 return Comment.createBlockComment(_mapTokens(node.tokens)); 9916 return Comment.createBlockComment(_mapTokens(node.tokens));
9606 } 9917 }
9607 return Comment.createEndOfLineComment(_mapTokens(node.tokens)); 9918 return Comment.createEndOfLineComment(_mapTokens(node.tokens));
9608 } 9919 }
9609 9920
9610 @override 9921 @override
9611 CommentReference visitCommentReference(CommentReference node) => 9922 CommentReference visitCommentReference(CommentReference node) =>
9612 new CommentReference( 9923 new CommentReference(
9613 _mapToken(node.newKeyword), _cloneNode(node.identifier)); 9924 _mapToken(node.newKeyword), _cloneNode(node.identifier));
9614 9925
9615 @override 9926 @override
9616 CompilationUnit visitCompilationUnit(CompilationUnit node) { 9927 CompilationUnit visitCompilationUnit(CompilationUnit node) {
9617 CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken), 9928 CompilationUnit copy = new CompilationUnit(
9618 _cloneNode(node.scriptTag), _cloneNodeList(node.directives), 9929 _mapToken(node.beginToken),
9619 _cloneNodeList(node.declarations), _mapToken(node.endToken)); 9930 _cloneNode(node.scriptTag),
9931 _cloneNodeList(node.directives),
9932 _cloneNodeList(node.declarations),
9933 _mapToken(node.endToken));
9620 copy.lineInfo = node.lineInfo; 9934 copy.lineInfo = node.lineInfo;
9621 copy.element = node.element; 9935 copy.element = node.element;
9622 return copy; 9936 return copy;
9623 } 9937 }
9624 9938
9625 @override 9939 @override
9626 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 9940 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
9627 ConditionalExpression copy = new ConditionalExpression( 9941 ConditionalExpression copy = new ConditionalExpression(
9628 _cloneNode(node.condition), _mapToken(node.question), 9942 _cloneNode(node.condition),
9629 _cloneNode(node.thenExpression), _mapToken(node.colon), 9943 _mapToken(node.question),
9944 _cloneNode(node.thenExpression),
9945 _mapToken(node.colon),
9630 _cloneNode(node.elseExpression)); 9946 _cloneNode(node.elseExpression));
9631 copy.propagatedType = node.propagatedType; 9947 copy.propagatedType = node.propagatedType;
9632 copy.staticType = node.staticType; 9948 copy.staticType = node.staticType;
9633 return copy; 9949 return copy;
9634 } 9950 }
9635 9951
9636 @override 9952 @override
9637 ConstructorDeclaration visitConstructorDeclaration( 9953 ConstructorDeclaration visitConstructorDeclaration(
9638 ConstructorDeclaration node) { 9954 ConstructorDeclaration node) {
9639 ConstructorDeclaration copy = new ConstructorDeclaration( 9955 ConstructorDeclaration copy = new ConstructorDeclaration(
9640 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9956 _cloneNode(node.documentationComment),
9641 _mapToken(node.externalKeyword), _mapToken(node.constKeyword), 9957 _cloneNodeList(node.metadata),
9642 _mapToken(node.factoryKeyword), _cloneNode(node.returnType), 9958 _mapToken(node.externalKeyword),
9643 _mapToken(node.period), _cloneNode(node.name), 9959 _mapToken(node.constKeyword),
9644 _cloneNode(node.parameters), _mapToken(node.separator), 9960 _mapToken(node.factoryKeyword),
9961 _cloneNode(node.returnType),
9962 _mapToken(node.period),
9963 _cloneNode(node.name),
9964 _cloneNode(node.parameters),
9965 _mapToken(node.separator),
9645 _cloneNodeList(node.initializers), 9966 _cloneNodeList(node.initializers),
9646 _cloneNode(node.redirectedConstructor), _cloneNode(node.body)); 9967 _cloneNode(node.redirectedConstructor),
9968 _cloneNode(node.body));
9647 copy.element = node.element; 9969 copy.element = node.element;
9648 return copy; 9970 return copy;
9649 } 9971 }
9650 9972
9651 @override 9973 @override
9652 ConstructorFieldInitializer visitConstructorFieldInitializer( 9974 ConstructorFieldInitializer visitConstructorFieldInitializer(
9653 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 9975 ConstructorFieldInitializer node) =>
9654 _mapToken(node.thisKeyword), _mapToken(node.period), 9976 new ConstructorFieldInitializer(
9655 _cloneNode(node.fieldName), _mapToken(node.equals), 9977 _mapToken(node.thisKeyword),
9656 _cloneNode(node.expression)); 9978 _mapToken(node.period),
9979 _cloneNode(node.fieldName),
9980 _mapToken(node.equals),
9981 _cloneNode(node.expression));
9657 9982
9658 @override 9983 @override
9659 ConstructorName visitConstructorName(ConstructorName node) { 9984 ConstructorName visitConstructorName(ConstructorName node) {
9660 ConstructorName copy = new ConstructorName( 9985 ConstructorName copy = new ConstructorName(
9661 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name)); 9986 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name));
9662 copy.staticElement = node.staticElement; 9987 copy.staticElement = node.staticElement;
9663 return copy; 9988 return copy;
9664 } 9989 }
9665 9990
9666 @override 9991 @override
9667 ContinueStatement visitContinueStatement(ContinueStatement node) => 9992 ContinueStatement visitContinueStatement(ContinueStatement node) =>
9668 new ContinueStatement(_mapToken(node.continueKeyword), 9993 new ContinueStatement(_mapToken(node.continueKeyword),
9669 _cloneNode(node.label), _mapToken(node.semicolon)); 9994 _cloneNode(node.label), _mapToken(node.semicolon));
9670 9995
9671 @override 9996 @override
9672 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 9997 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
9673 new DeclaredIdentifier(_cloneNode(node.documentationComment), 9998 new DeclaredIdentifier(
9674 _cloneNodeList(node.metadata), _mapToken(node.keyword), 9999 _cloneNode(node.documentationComment),
9675 _cloneNode(node.type), _cloneNode(node.identifier)); 10000 _cloneNodeList(node.metadata),
10001 _mapToken(node.keyword),
10002 _cloneNode(node.type),
10003 _cloneNode(node.identifier));
9676 10004
9677 @override 10005 @override
9678 DefaultFormalParameter visitDefaultFormalParameter( 10006 DefaultFormalParameter visitDefaultFormalParameter(
9679 DefaultFormalParameter node) => new DefaultFormalParameter( 10007 DefaultFormalParameter node) =>
9680 _cloneNode(node.parameter), node.kind, _mapToken(node.separator), 10008 new DefaultFormalParameter(_cloneNode(node.parameter), node.kind,
9681 _cloneNode(node.defaultValue)); 10009 _mapToken(node.separator), _cloneNode(node.defaultValue));
9682 10010
9683 @override 10011 @override
9684 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 10012 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
9685 _mapToken(node.doKeyword), _cloneNode(node.body), 10013 _mapToken(node.doKeyword),
9686 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10014 _cloneNode(node.body),
9687 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10015 _mapToken(node.whileKeyword),
10016 _mapToken(node.leftParenthesis),
10017 _cloneNode(node.condition),
10018 _mapToken(node.rightParenthesis),
9688 _mapToken(node.semicolon)); 10019 _mapToken(node.semicolon));
9689 10020
9690 @override 10021 @override
9691 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 10022 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
9692 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); 10023 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value);
9693 copy.propagatedType = node.propagatedType; 10024 copy.propagatedType = node.propagatedType;
9694 copy.staticType = node.staticType; 10025 copy.staticType = node.staticType;
9695 return copy; 10026 return copy;
9696 } 10027 }
9697 10028
9698 @override 10029 @override
9699 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 10030 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
9700 new EmptyFunctionBody(_mapToken(node.semicolon)); 10031 new EmptyFunctionBody(_mapToken(node.semicolon));
9701 10032
9702 @override 10033 @override
9703 EmptyStatement visitEmptyStatement(EmptyStatement node) => 10034 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
9704 new EmptyStatement(_mapToken(node.semicolon)); 10035 new EmptyStatement(_mapToken(node.semicolon));
9705 10036
9706 @override 10037 @override
9707 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 10038 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
9708 new EnumConstantDeclaration(_cloneNode(node.documentationComment), 10039 new EnumConstantDeclaration(_cloneNode(node.documentationComment),
9709 _cloneNodeList(node.metadata), _cloneNode(node.name)); 10040 _cloneNodeList(node.metadata), _cloneNode(node.name));
9710 10041
9711 @override 10042 @override
9712 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration( 10043 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(
9713 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10044 _cloneNode(node.documentationComment),
9714 _mapToken(node.enumKeyword), _cloneNode(node.name), 10045 _cloneNodeList(node.metadata),
9715 _mapToken(node.leftBracket), _cloneNodeList(node.constants), 10046 _mapToken(node.enumKeyword),
10047 _cloneNode(node.name),
10048 _mapToken(node.leftBracket),
10049 _cloneNodeList(node.constants),
9716 _mapToken(node.rightBracket)); 10050 _mapToken(node.rightBracket));
9717 10051
9718 @override 10052 @override
9719 ExportDirective visitExportDirective(ExportDirective node) { 10053 ExportDirective visitExportDirective(ExportDirective node) {
9720 ExportDirective copy = new ExportDirective( 10054 ExportDirective copy = new ExportDirective(
9721 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10055 _cloneNode(node.documentationComment),
9722 _mapToken(node.keyword), _cloneNode(node.uri), 10056 _cloneNodeList(node.metadata),
9723 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10057 _mapToken(node.keyword),
10058 _cloneNode(node.uri),
10059 _cloneNodeList(node.combinators),
10060 _mapToken(node.semicolon));
9724 copy.element = node.element; 10061 copy.element = node.element;
9725 return copy; 10062 return copy;
9726 } 10063 }
9727 10064
9728 @override 10065 @override
9729 ExpressionFunctionBody visitExpressionFunctionBody( 10066 ExpressionFunctionBody visitExpressionFunctionBody(
9730 ExpressionFunctionBody node) => new ExpressionFunctionBody( 10067 ExpressionFunctionBody node) =>
9731 _mapToken(node.keyword), _mapToken(node.functionDefinition), 10068 new ExpressionFunctionBody(
9732 _cloneNode(node.expression), _mapToken(node.semicolon)); 10069 _mapToken(node.keyword),
10070 _mapToken(node.functionDefinition),
10071 _cloneNode(node.expression),
10072 _mapToken(node.semicolon));
9733 10073
9734 @override 10074 @override
9735 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 10075 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
9736 new ExpressionStatement( 10076 new ExpressionStatement(
9737 _cloneNode(node.expression), _mapToken(node.semicolon)); 10077 _cloneNode(node.expression), _mapToken(node.semicolon));
9738 10078
9739 @override 10079 @override
9740 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 10080 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
9741 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); 10081 _mapToken(node.extendsKeyword), _cloneNode(node.superclass));
9742 10082
9743 @override 10083 @override
9744 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 10084 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
9745 new FieldDeclaration(_cloneNode(node.documentationComment), 10085 new FieldDeclaration(
9746 _cloneNodeList(node.metadata), _mapToken(node.staticKeyword), 10086 _cloneNode(node.documentationComment),
9747 _cloneNode(node.fields), _mapToken(node.semicolon)); 10087 _cloneNodeList(node.metadata),
10088 _mapToken(node.staticKeyword),
10089 _cloneNode(node.fields),
10090 _mapToken(node.semicolon));
9748 10091
9749 @override 10092 @override
9750 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 10093 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
9751 new FieldFormalParameter(_cloneNode(node.documentationComment), 10094 new FieldFormalParameter(
9752 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10095 _cloneNode(node.documentationComment),
9753 _cloneNode(node.type), _mapToken(node.thisKeyword), 10096 _cloneNodeList(node.metadata),
9754 _mapToken(node.period), _cloneNode(node.identifier), 10097 _mapToken(node.keyword),
9755 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10098 _cloneNode(node.type),
10099 _mapToken(node.thisKeyword),
10100 _mapToken(node.period),
10101 _cloneNode(node.identifier),
10102 _cloneNode(node.typeParameters),
10103 _cloneNode(node.parameters));
9756 10104
9757 @override 10105 @override
9758 ForEachStatement visitForEachStatement(ForEachStatement node) { 10106 ForEachStatement visitForEachStatement(ForEachStatement node) {
9759 DeclaredIdentifier loopVariable = node.loopVariable; 10107 DeclaredIdentifier loopVariable = node.loopVariable;
9760 if (loopVariable == null) { 10108 if (loopVariable == null) {
9761 return new ForEachStatement.withReference(_mapToken(node.awaitKeyword), 10109 return new ForEachStatement.withReference(
9762 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10110 _mapToken(node.awaitKeyword),
9763 _cloneNode(node.identifier), _mapToken(node.inKeyword), 10111 _mapToken(node.forKeyword),
9764 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10112 _mapToken(node.leftParenthesis),
10113 _cloneNode(node.identifier),
10114 _mapToken(node.inKeyword),
10115 _cloneNode(node.iterable),
10116 _mapToken(node.rightParenthesis),
9765 _cloneNode(node.body)); 10117 _cloneNode(node.body));
9766 } 10118 }
9767 return new ForEachStatement.withDeclaration(_mapToken(node.awaitKeyword), 10119 return new ForEachStatement.withDeclaration(
9768 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10120 _mapToken(node.awaitKeyword),
9769 _cloneNode(loopVariable), _mapToken(node.inKeyword), 10121 _mapToken(node.forKeyword),
9770 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10122 _mapToken(node.leftParenthesis),
10123 _cloneNode(loopVariable),
10124 _mapToken(node.inKeyword),
10125 _cloneNode(node.iterable),
10126 _mapToken(node.rightParenthesis),
9771 _cloneNode(node.body)); 10127 _cloneNode(node.body));
9772 } 10128 }
9773 10129
9774 @override 10130 @override
9775 FormalParameterList visitFormalParameterList(FormalParameterList node) => 10131 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
9776 new FormalParameterList(_mapToken(node.leftParenthesis), 10132 new FormalParameterList(
9777 _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter), 10133 _mapToken(node.leftParenthesis),
9778 _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis)); 10134 _cloneNodeList(node.parameters),
10135 _mapToken(node.leftDelimiter),
10136 _mapToken(node.rightDelimiter),
10137 _mapToken(node.rightParenthesis));
9779 10138
9780 @override 10139 @override
9781 ForStatement visitForStatement(ForStatement node) => new ForStatement( 10140 ForStatement visitForStatement(ForStatement node) => new ForStatement(
9782 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10141 _mapToken(node.forKeyword),
9783 _cloneNode(node.variables), _cloneNode(node.initialization), 10142 _mapToken(node.leftParenthesis),
9784 _mapToken(node.leftSeparator), _cloneNode(node.condition), 10143 _cloneNode(node.variables),
9785 _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), 10144 _cloneNode(node.initialization),
9786 _mapToken(node.rightParenthesis), _cloneNode(node.body)); 10145 _mapToken(node.leftSeparator),
10146 _cloneNode(node.condition),
10147 _mapToken(node.rightSeparator),
10148 _cloneNodeList(node.updaters),
10149 _mapToken(node.rightParenthesis),
10150 _cloneNode(node.body));
9787 10151
9788 @override 10152 @override
9789 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 10153 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
9790 new FunctionDeclaration(_cloneNode(node.documentationComment), 10154 new FunctionDeclaration(
9791 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10155 _cloneNode(node.documentationComment),
9792 _cloneNode(node.returnType), _mapToken(node.propertyKeyword), 10156 _cloneNodeList(node.metadata),
9793 _cloneNode(node.name), _cloneNode(node.functionExpression)); 10157 _mapToken(node.externalKeyword),
10158 _cloneNode(node.returnType),
10159 _mapToken(node.propertyKeyword),
10160 _cloneNode(node.name),
10161 _cloneNode(node.functionExpression));
9794 10162
9795 @override 10163 @override
9796 FunctionDeclarationStatement visitFunctionDeclarationStatement( 10164 FunctionDeclarationStatement visitFunctionDeclarationStatement(
9797 FunctionDeclarationStatement node) => 10165 FunctionDeclarationStatement node) =>
9798 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration)); 10166 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
9799 10167
9800 @override 10168 @override
9801 FunctionExpression visitFunctionExpression(FunctionExpression node) { 10169 FunctionExpression visitFunctionExpression(FunctionExpression node) {
9802 FunctionExpression copy = new FunctionExpression( 10170 FunctionExpression copy = new FunctionExpression(
9803 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10171 _cloneNode(node.typeParameters),
10172 _cloneNode(node.parameters),
9804 _cloneNode(node.body)); 10173 _cloneNode(node.body));
9805 copy.element = node.element; 10174 copy.element = node.element;
9806 copy.propagatedType = node.propagatedType; 10175 copy.propagatedType = node.propagatedType;
9807 copy.staticType = node.staticType; 10176 copy.staticType = node.staticType;
9808 return copy; 10177 return copy;
9809 } 10178 }
9810 10179
9811 @override 10180 @override
9812 FunctionExpressionInvocation visitFunctionExpressionInvocation( 10181 FunctionExpressionInvocation visitFunctionExpressionInvocation(
9813 FunctionExpressionInvocation node) { 10182 FunctionExpressionInvocation node) {
9814 FunctionExpressionInvocation copy = new FunctionExpressionInvocation( 10183 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
9815 _cloneNode(node.function), _cloneNode(node.typeArguments), 10184 _cloneNode(node.function),
10185 _cloneNode(node.typeArguments),
9816 _cloneNode(node.argumentList)); 10186 _cloneNode(node.argumentList));
9817 copy.propagatedElement = node.propagatedElement; 10187 copy.propagatedElement = node.propagatedElement;
9818 copy.propagatedType = node.propagatedType; 10188 copy.propagatedType = node.propagatedType;
9819 copy.staticElement = node.staticElement; 10189 copy.staticElement = node.staticElement;
9820 copy.staticType = node.staticType; 10190 copy.staticType = node.staticType;
9821 return copy; 10191 return copy;
9822 } 10192 }
9823 10193
9824 @override 10194 @override
9825 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 10195 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
9826 new FunctionTypeAlias(_cloneNode(node.documentationComment), 10196 new FunctionTypeAlias(
9827 _cloneNodeList(node.metadata), _mapToken(node.typedefKeyword), 10197 _cloneNode(node.documentationComment),
9828 _cloneNode(node.returnType), _cloneNode(node.name), 10198 _cloneNodeList(node.metadata),
9829 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10199 _mapToken(node.typedefKeyword),
10200 _cloneNode(node.returnType),
10201 _cloneNode(node.name),
10202 _cloneNode(node.typeParameters),
10203 _cloneNode(node.parameters),
9830 _mapToken(node.semicolon)); 10204 _mapToken(node.semicolon));
9831 10205
9832 @override 10206 @override
9833 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 10207 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
9834 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 10208 FunctionTypedFormalParameter node) =>
9835 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10209 new FunctionTypedFormalParameter(
9836 _cloneNode(node.returnType), _cloneNode(node.identifier), 10210 _cloneNode(node.documentationComment),
9837 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10211 _cloneNodeList(node.metadata),
10212 _cloneNode(node.returnType),
10213 _cloneNode(node.identifier),
10214 _cloneNode(node.typeParameters),
10215 _cloneNode(node.parameters));
9838 10216
9839 @override 10217 @override
9840 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 10218 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
9841 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames)); 10219 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
9842 10220
9843 @override 10221 @override
9844 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 10222 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
9845 _mapToken(node.ifKeyword), _mapToken(node.leftParenthesis), 10223 _mapToken(node.ifKeyword),
9846 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10224 _mapToken(node.leftParenthesis),
9847 _cloneNode(node.thenStatement), _mapToken(node.elseKeyword), 10225 _cloneNode(node.condition),
10226 _mapToken(node.rightParenthesis),
10227 _cloneNode(node.thenStatement),
10228 _mapToken(node.elseKeyword),
9848 _cloneNode(node.elseStatement)); 10229 _cloneNode(node.elseStatement));
9849 10230
9850 @override 10231 @override
9851 ImplementsClause visitImplementsClause(ImplementsClause node) => 10232 ImplementsClause visitImplementsClause(ImplementsClause node) =>
9852 new ImplementsClause( 10233 new ImplementsClause(
9853 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); 10234 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces));
9854 10235
9855 @override 10236 @override
9856 ImportDirective visitImportDirective(ImportDirective node) => 10237 ImportDirective visitImportDirective(ImportDirective node) =>
9857 new ImportDirective(_cloneNode(node.documentationComment), 10238 new ImportDirective(
9858 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10239 _cloneNode(node.documentationComment),
9859 _cloneNode(node.uri), _mapToken(node.deferredKeyword), 10240 _cloneNodeList(node.metadata),
9860 _mapToken(node.asKeyword), _cloneNode(node.prefix), 10241 _mapToken(node.keyword),
9861 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10242 _cloneNode(node.uri),
10243 _mapToken(node.deferredKeyword),
10244 _mapToken(node.asKeyword),
10245 _cloneNode(node.prefix),
10246 _cloneNodeList(node.combinators),
10247 _mapToken(node.semicolon));
9862 10248
9863 @override 10249 @override
9864 IndexExpression visitIndexExpression(IndexExpression node) { 10250 IndexExpression visitIndexExpression(IndexExpression node) {
9865 Token period = _mapToken(node.period); 10251 Token period = _mapToken(node.period);
9866 IndexExpression copy; 10252 IndexExpression copy;
9867 if (period == null) { 10253 if (period == null) {
9868 copy = new IndexExpression.forTarget(_cloneNode(node.target), 10254 copy = new IndexExpression.forTarget(
9869 _mapToken(node.leftBracket), _cloneNode(node.index), 10255 _cloneNode(node.target),
10256 _mapToken(node.leftBracket),
10257 _cloneNode(node.index),
9870 _mapToken(node.rightBracket)); 10258 _mapToken(node.rightBracket));
9871 } else { 10259 } else {
9872 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), 10260 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket),
9873 _cloneNode(node.index), _mapToken(node.rightBracket)); 10261 _cloneNode(node.index), _mapToken(node.rightBracket));
9874 } 10262 }
9875 copy.auxiliaryElements = node.auxiliaryElements; 10263 copy.auxiliaryElements = node.auxiliaryElements;
9876 copy.propagatedElement = node.propagatedElement; 10264 copy.propagatedElement = node.propagatedElement;
9877 copy.propagatedType = node.propagatedType; 10265 copy.propagatedType = node.propagatedType;
9878 copy.staticElement = node.staticElement; 10266 copy.staticElement = node.staticElement;
9879 copy.staticType = node.staticType; 10267 copy.staticType = node.staticType;
9880 return copy; 10268 return copy;
9881 } 10269 }
9882 10270
9883 @override 10271 @override
9884 InstanceCreationExpression visitInstanceCreationExpression( 10272 InstanceCreationExpression visitInstanceCreationExpression(
9885 InstanceCreationExpression node) { 10273 InstanceCreationExpression node) {
9886 InstanceCreationExpression copy = new InstanceCreationExpression( 10274 InstanceCreationExpression copy = new InstanceCreationExpression(
9887 _mapToken(node.keyword), _cloneNode(node.constructorName), 10275 _mapToken(node.keyword),
10276 _cloneNode(node.constructorName),
9888 _cloneNode(node.argumentList)); 10277 _cloneNode(node.argumentList));
9889 copy.propagatedType = node.propagatedType; 10278 copy.propagatedType = node.propagatedType;
9890 copy.staticElement = node.staticElement; 10279 copy.staticElement = node.staticElement;
9891 copy.staticType = node.staticType; 10280 copy.staticType = node.staticType;
9892 return copy; 10281 return copy;
9893 } 10282 }
9894 10283
9895 @override 10284 @override
9896 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 10285 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
9897 IntegerLiteral copy = 10286 IntegerLiteral copy =
9898 new IntegerLiteral(_mapToken(node.literal), node.value); 10287 new IntegerLiteral(_mapToken(node.literal), node.value);
9899 copy.propagatedType = node.propagatedType; 10288 copy.propagatedType = node.propagatedType;
9900 copy.staticType = node.staticType; 10289 copy.staticType = node.staticType;
9901 return copy; 10290 return copy;
9902 } 10291 }
9903 10292
9904 @override 10293 @override
9905 InterpolationExpression visitInterpolationExpression( 10294 InterpolationExpression visitInterpolationExpression(
9906 InterpolationExpression node) => new InterpolationExpression( 10295 InterpolationExpression node) =>
9907 _mapToken(node.leftBracket), _cloneNode(node.expression), 10296 new InterpolationExpression(_mapToken(node.leftBracket),
9908 _mapToken(node.rightBracket)); 10297 _cloneNode(node.expression), _mapToken(node.rightBracket));
9909 10298
9910 @override 10299 @override
9911 InterpolationString visitInterpolationString(InterpolationString node) => 10300 InterpolationString visitInterpolationString(InterpolationString node) =>
9912 new InterpolationString(_mapToken(node.contents), node.value); 10301 new InterpolationString(_mapToken(node.contents), node.value);
9913 10302
9914 @override 10303 @override
9915 IsExpression visitIsExpression(IsExpression node) { 10304 IsExpression visitIsExpression(IsExpression node) {
9916 IsExpression copy = new IsExpression(_cloneNode(node.expression), 10305 IsExpression copy = new IsExpression(
9917 _mapToken(node.isOperator), _mapToken(node.notOperator), 10306 _cloneNode(node.expression),
10307 _mapToken(node.isOperator),
10308 _mapToken(node.notOperator),
9918 _cloneNode(node.type)); 10309 _cloneNode(node.type));
9919 copy.propagatedType = node.propagatedType; 10310 copy.propagatedType = node.propagatedType;
9920 copy.staticType = node.staticType; 10311 copy.staticType = node.staticType;
9921 return copy; 10312 return copy;
9922 } 10313 }
9923 10314
9924 @override 10315 @override
9925 Label visitLabel(Label node) => 10316 Label visitLabel(Label node) =>
9926 new Label(_cloneNode(node.label), _mapToken(node.colon)); 10317 new Label(_cloneNode(node.label), _mapToken(node.colon));
9927 10318
9928 @override 10319 @override
9929 LabeledStatement visitLabeledStatement(LabeledStatement node) => 10320 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
9930 new LabeledStatement( 10321 new LabeledStatement(
9931 _cloneNodeList(node.labels), _cloneNode(node.statement)); 10322 _cloneNodeList(node.labels), _cloneNode(node.statement));
9932 10323
9933 @override 10324 @override
9934 LibraryDirective visitLibraryDirective(LibraryDirective node) => 10325 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
9935 new LibraryDirective(_cloneNode(node.documentationComment), 10326 new LibraryDirective(
9936 _cloneNodeList(node.metadata), _mapToken(node.libraryKeyword), 10327 _cloneNode(node.documentationComment),
9937 _cloneNode(node.name), _mapToken(node.semicolon)); 10328 _cloneNodeList(node.metadata),
10329 _mapToken(node.libraryKeyword),
10330 _cloneNode(node.name),
10331 _mapToken(node.semicolon));
9938 10332
9939 @override 10333 @override
9940 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 10334 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
9941 LibraryIdentifier copy = 10335 LibraryIdentifier copy =
9942 new LibraryIdentifier(_cloneNodeList(node.components)); 10336 new LibraryIdentifier(_cloneNodeList(node.components));
9943 copy.propagatedType = node.propagatedType; 10337 copy.propagatedType = node.propagatedType;
9944 copy.staticType = node.staticType; 10338 copy.staticType = node.staticType;
9945 return copy; 10339 return copy;
9946 } 10340 }
9947 10341
9948 @override 10342 @override
9949 ListLiteral visitListLiteral(ListLiteral node) { 10343 ListLiteral visitListLiteral(ListLiteral node) {
9950 ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword), 10344 ListLiteral copy = new ListLiteral(
9951 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10345 _mapToken(node.constKeyword),
9952 _cloneNodeList(node.elements), _mapToken(node.rightBracket)); 10346 _cloneNode(node.typeArguments),
10347 _mapToken(node.leftBracket),
10348 _cloneNodeList(node.elements),
10349 _mapToken(node.rightBracket));
9953 copy.propagatedType = node.propagatedType; 10350 copy.propagatedType = node.propagatedType;
9954 copy.staticType = node.staticType; 10351 copy.staticType = node.staticType;
9955 return copy; 10352 return copy;
9956 } 10353 }
9957 10354
9958 @override 10355 @override
9959 MapLiteral visitMapLiteral(MapLiteral node) { 10356 MapLiteral visitMapLiteral(MapLiteral node) {
9960 MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword), 10357 MapLiteral copy = new MapLiteral(
9961 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10358 _mapToken(node.constKeyword),
9962 _cloneNodeList(node.entries), _mapToken(node.rightBracket)); 10359 _cloneNode(node.typeArguments),
10360 _mapToken(node.leftBracket),
10361 _cloneNodeList(node.entries),
10362 _mapToken(node.rightBracket));
9963 copy.propagatedType = node.propagatedType; 10363 copy.propagatedType = node.propagatedType;
9964 copy.staticType = node.staticType; 10364 copy.staticType = node.staticType;
9965 return copy; 10365 return copy;
9966 } 10366 }
9967 10367
9968 @override 10368 @override
9969 MapLiteralEntry visitMapLiteralEntry( 10369 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
9970 MapLiteralEntry node) => new MapLiteralEntry( 10370 new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator),
9971 _cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value)); 10371 _cloneNode(node.value));
9972 10372
9973 @override 10373 @override
9974 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 10374 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
9975 new MethodDeclaration(_cloneNode(node.documentationComment), 10375 new MethodDeclaration(
9976 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10376 _cloneNode(node.documentationComment),
9977 _mapToken(node.modifierKeyword), _cloneNode(node.returnType), 10377 _cloneNodeList(node.metadata),
9978 _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword), 10378 _mapToken(node.externalKeyword),
9979 _cloneNode(node.name), _cloneNode(node._typeParameters), 10379 _mapToken(node.modifierKeyword),
9980 _cloneNode(node.parameters), _cloneNode(node.body)); 10380 _cloneNode(node.returnType),
10381 _mapToken(node.propertyKeyword),
10382 _mapToken(node.operatorKeyword),
10383 _cloneNode(node.name),
10384 _cloneNode(node._typeParameters),
10385 _cloneNode(node.parameters),
10386 _cloneNode(node.body));
9981 10387
9982 @override 10388 @override
9983 MethodInvocation visitMethodInvocation(MethodInvocation node) { 10389 MethodInvocation visitMethodInvocation(MethodInvocation node) {
9984 MethodInvocation copy = new MethodInvocation(_cloneNode(node.target), 10390 MethodInvocation copy = new MethodInvocation(
9985 _mapToken(node.operator), _cloneNode(node.methodName), 10391 _cloneNode(node.target),
9986 _cloneNode(node.typeArguments), _cloneNode(node.argumentList)); 10392 _mapToken(node.operator),
10393 _cloneNode(node.methodName),
10394 _cloneNode(node.typeArguments),
10395 _cloneNode(node.argumentList));
9987 copy.propagatedType = node.propagatedType; 10396 copy.propagatedType = node.propagatedType;
9988 copy.staticType = node.staticType; 10397 copy.staticType = node.staticType;
9989 return copy; 10398 return copy;
9990 } 10399 }
9991 10400
9992 @override 10401 @override
9993 NamedExpression visitNamedExpression(NamedExpression node) { 10402 NamedExpression visitNamedExpression(NamedExpression node) {
9994 NamedExpression copy = 10403 NamedExpression copy =
9995 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression)); 10404 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
9996 copy.propagatedType = node.propagatedType; 10405 copy.propagatedType = node.propagatedType;
(...skipping 15 matching lines...) Expand all
10012 NullLiteral copy = new NullLiteral(_mapToken(node.literal)); 10421 NullLiteral copy = new NullLiteral(_mapToken(node.literal));
10013 copy.propagatedType = node.propagatedType; 10422 copy.propagatedType = node.propagatedType;
10014 copy.staticType = node.staticType; 10423 copy.staticType = node.staticType;
10015 return copy; 10424 return copy;
10016 } 10425 }
10017 10426
10018 @override 10427 @override
10019 ParenthesizedExpression visitParenthesizedExpression( 10428 ParenthesizedExpression visitParenthesizedExpression(
10020 ParenthesizedExpression node) { 10429 ParenthesizedExpression node) {
10021 ParenthesizedExpression copy = new ParenthesizedExpression( 10430 ParenthesizedExpression copy = new ParenthesizedExpression(
10022 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10431 _mapToken(node.leftParenthesis),
10432 _cloneNode(node.expression),
10023 _mapToken(node.rightParenthesis)); 10433 _mapToken(node.rightParenthesis));
10024 copy.propagatedType = node.propagatedType; 10434 copy.propagatedType = node.propagatedType;
10025 copy.staticType = node.staticType; 10435 copy.staticType = node.staticType;
10026 return copy; 10436 return copy;
10027 } 10437 }
10028 10438
10029 @override 10439 @override
10030 PartDirective visitPartDirective(PartDirective node) { 10440 PartDirective visitPartDirective(PartDirective node) {
10031 PartDirective copy = new PartDirective( 10441 PartDirective copy = new PartDirective(
10032 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10442 _cloneNode(node.documentationComment),
10033 _mapToken(node.partKeyword), _cloneNode(node.uri), 10443 _cloneNodeList(node.metadata),
10444 _mapToken(node.partKeyword),
10445 _cloneNode(node.uri),
10034 _mapToken(node.semicolon)); 10446 _mapToken(node.semicolon));
10035 copy.element = node.element; 10447 copy.element = node.element;
10036 return copy; 10448 return copy;
10037 } 10449 }
10038 10450
10039 @override 10451 @override
10040 PartOfDirective visitPartOfDirective(PartOfDirective node) { 10452 PartOfDirective visitPartOfDirective(PartOfDirective node) {
10041 PartOfDirective copy = new PartOfDirective( 10453 PartOfDirective copy = new PartOfDirective(
10042 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10454 _cloneNode(node.documentationComment),
10043 _mapToken(node.partKeyword), _mapToken(node.ofKeyword), 10455 _cloneNodeList(node.metadata),
10044 _cloneNode(node.libraryName), _mapToken(node.semicolon)); 10456 _mapToken(node.partKeyword),
10457 _mapToken(node.ofKeyword),
10458 _cloneNode(node.libraryName),
10459 _mapToken(node.semicolon));
10045 copy.element = node.element; 10460 copy.element = node.element;
10046 return copy; 10461 return copy;
10047 } 10462 }
10048 10463
10049 @override 10464 @override
10050 PostfixExpression visitPostfixExpression(PostfixExpression node) { 10465 PostfixExpression visitPostfixExpression(PostfixExpression node) {
10051 PostfixExpression copy = new PostfixExpression( 10466 PostfixExpression copy = new PostfixExpression(
10052 _cloneNode(node.operand), _mapToken(node.operator)); 10467 _cloneNode(node.operand), _mapToken(node.operator));
10053 copy.propagatedElement = node.propagatedElement; 10468 copy.propagatedElement = node.propagatedElement;
10054 copy.propagatedType = node.propagatedType; 10469 copy.propagatedType = node.propagatedType;
(...skipping 28 matching lines...) Expand all
10083 _mapToken(node.operator), _cloneNode(node.propertyName)); 10498 _mapToken(node.operator), _cloneNode(node.propertyName));
10084 copy.propagatedType = node.propagatedType; 10499 copy.propagatedType = node.propagatedType;
10085 copy.staticType = node.staticType; 10500 copy.staticType = node.staticType;
10086 return copy; 10501 return copy;
10087 } 10502 }
10088 10503
10089 @override 10504 @override
10090 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 10505 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
10091 RedirectingConstructorInvocation node) { 10506 RedirectingConstructorInvocation node) {
10092 RedirectingConstructorInvocation copy = 10507 RedirectingConstructorInvocation copy =
10093 new RedirectingConstructorInvocation(_mapToken(node.thisKeyword), 10508 new RedirectingConstructorInvocation(
10094 _mapToken(node.period), _cloneNode(node.constructorName), 10509 _mapToken(node.thisKeyword),
10510 _mapToken(node.period),
10511 _cloneNode(node.constructorName),
10095 _cloneNode(node.argumentList)); 10512 _cloneNode(node.argumentList));
10096 copy.staticElement = node.staticElement; 10513 copy.staticElement = node.staticElement;
10097 return copy; 10514 return copy;
10098 } 10515 }
10099 10516
10100 @override 10517 @override
10101 RethrowExpression visitRethrowExpression(RethrowExpression node) { 10518 RethrowExpression visitRethrowExpression(RethrowExpression node) {
10102 RethrowExpression copy = 10519 RethrowExpression copy =
10103 new RethrowExpression(_mapToken(node.rethrowKeyword)); 10520 new RethrowExpression(_mapToken(node.rethrowKeyword));
10104 copy.propagatedType = node.propagatedType; 10521 copy.propagatedType = node.propagatedType;
10105 copy.staticType = node.staticType; 10522 copy.staticType = node.staticType;
10106 return copy; 10523 return copy;
10107 } 10524 }
10108 10525
10109 @override 10526 @override
10110 ReturnStatement visitReturnStatement(ReturnStatement node) => 10527 ReturnStatement visitReturnStatement(ReturnStatement node) =>
10111 new ReturnStatement(_mapToken(node.returnKeyword), 10528 new ReturnStatement(_mapToken(node.returnKeyword),
10112 _cloneNode(node.expression), _mapToken(node.semicolon)); 10529 _cloneNode(node.expression), _mapToken(node.semicolon));
10113 10530
10114 @override 10531 @override
10115 ScriptTag visitScriptTag(ScriptTag node) => 10532 ScriptTag visitScriptTag(ScriptTag node) =>
10116 new ScriptTag(_mapToken(node.scriptTag)); 10533 new ScriptTag(_mapToken(node.scriptTag));
10117 10534
10118 @override 10535 @override
10119 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 10536 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
10120 _mapToken(node.keyword), _cloneNodeList(node.shownNames)); 10537 _mapToken(node.keyword), _cloneNodeList(node.shownNames));
10121 10538
10122 @override 10539 @override
10123 SimpleFormalParameter visitSimpleFormalParameter( 10540 SimpleFormalParameter visitSimpleFormalParameter(
10124 SimpleFormalParameter node) => new SimpleFormalParameter( 10541 SimpleFormalParameter node) =>
10125 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10542 new SimpleFormalParameter(
10126 _mapToken(node.keyword), _cloneNode(node.type), 10543 _cloneNode(node.documentationComment),
10127 _cloneNode(node.identifier)); 10544 _cloneNodeList(node.metadata),
10545 _mapToken(node.keyword),
10546 _cloneNode(node.type),
10547 _cloneNode(node.identifier));
10128 10548
10129 @override 10549 @override
10130 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 10550 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
10131 Token mappedToken = _mapToken(node.token); 10551 Token mappedToken = _mapToken(node.token);
10132 if (mappedToken == null) { 10552 if (mappedToken == null) {
10133 // This only happens for SimpleIdentifiers created by the parser as part 10553 // This only happens for SimpleIdentifiers created by the parser as part
10134 // of scanning documentation comments (the tokens for those identifiers 10554 // of scanning documentation comments (the tokens for those identifiers
10135 // are not in the original token stream and hence do not get copied). 10555 // are not in the original token stream and hence do not get copied).
10136 // This extra check can be removed if the scanner is changed to scan 10556 // This extra check can be removed if the scanner is changed to scan
10137 // documentation comments for the parser. 10557 // documentation comments for the parser.
(...skipping 23 matching lines...) Expand all
10161 new StringInterpolation(_cloneNodeList(node.elements)); 10581 new StringInterpolation(_cloneNodeList(node.elements));
10162 copy.propagatedType = node.propagatedType; 10582 copy.propagatedType = node.propagatedType;
10163 copy.staticType = node.staticType; 10583 copy.staticType = node.staticType;
10164 return copy; 10584 return copy;
10165 } 10585 }
10166 10586
10167 @override 10587 @override
10168 SuperConstructorInvocation visitSuperConstructorInvocation( 10588 SuperConstructorInvocation visitSuperConstructorInvocation(
10169 SuperConstructorInvocation node) { 10589 SuperConstructorInvocation node) {
10170 SuperConstructorInvocation copy = new SuperConstructorInvocation( 10590 SuperConstructorInvocation copy = new SuperConstructorInvocation(
10171 _mapToken(node.superKeyword), _mapToken(node.period), 10591 _mapToken(node.superKeyword),
10172 _cloneNode(node.constructorName), _cloneNode(node.argumentList)); 10592 _mapToken(node.period),
10593 _cloneNode(node.constructorName),
10594 _cloneNode(node.argumentList));
10173 copy.staticElement = node.staticElement; 10595 copy.staticElement = node.staticElement;
10174 return copy; 10596 return copy;
10175 } 10597 }
10176 10598
10177 @override 10599 @override
10178 SuperExpression visitSuperExpression(SuperExpression node) { 10600 SuperExpression visitSuperExpression(SuperExpression node) {
10179 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword)); 10601 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword));
10180 copy.propagatedType = node.propagatedType; 10602 copy.propagatedType = node.propagatedType;
10181 copy.staticType = node.staticType; 10603 copy.staticType = node.staticType;
10182 return copy; 10604 return copy;
10183 } 10605 }
10184 10606
10185 @override 10607 @override
10186 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 10608 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
10187 _cloneNodeList(node.labels), _mapToken(node.keyword), 10609 _cloneNodeList(node.labels),
10188 _cloneNode(node.expression), _mapToken(node.colon), 10610 _mapToken(node.keyword),
10611 _cloneNode(node.expression),
10612 _mapToken(node.colon),
10189 _cloneNodeList(node.statements)); 10613 _cloneNodeList(node.statements));
10190 10614
10191 @override 10615 @override
10192 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 10616 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
10193 _cloneNodeList(node.labels), _mapToken(node.keyword), 10617 _cloneNodeList(node.labels),
10194 _mapToken(node.colon), _cloneNodeList(node.statements)); 10618 _mapToken(node.keyword),
10619 _mapToken(node.colon),
10620 _cloneNodeList(node.statements));
10195 10621
10196 @override 10622 @override
10197 SwitchStatement visitSwitchStatement(SwitchStatement node) => 10623 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
10198 new SwitchStatement(_mapToken(node.switchKeyword), 10624 new SwitchStatement(
10199 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10625 _mapToken(node.switchKeyword),
10200 _mapToken(node.rightParenthesis), _mapToken(node.leftBracket), 10626 _mapToken(node.leftParenthesis),
10201 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 10627 _cloneNode(node.expression),
10628 _mapToken(node.rightParenthesis),
10629 _mapToken(node.leftBracket),
10630 _cloneNodeList(node.members),
10631 _mapToken(node.rightBracket));
10202 10632
10203 @override 10633 @override
10204 AstNode visitSymbolLiteral(SymbolLiteral node) { 10634 AstNode visitSymbolLiteral(SymbolLiteral node) {
10205 SymbolLiteral copy = new SymbolLiteral( 10635 SymbolLiteral copy = new SymbolLiteral(
10206 _mapToken(node.poundSign), _mapTokens(node.components)); 10636 _mapToken(node.poundSign), _mapTokens(node.components));
10207 copy.propagatedType = node.propagatedType; 10637 copy.propagatedType = node.propagatedType;
10208 copy.staticType = node.staticType; 10638 copy.staticType = node.staticType;
10209 return copy; 10639 return copy;
10210 } 10640 }
10211 10641
10212 @override 10642 @override
10213 ThisExpression visitThisExpression(ThisExpression node) { 10643 ThisExpression visitThisExpression(ThisExpression node) {
10214 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword)); 10644 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword));
10215 copy.propagatedType = node.propagatedType; 10645 copy.propagatedType = node.propagatedType;
10216 copy.staticType = node.staticType; 10646 copy.staticType = node.staticType;
10217 return copy; 10647 return copy;
10218 } 10648 }
10219 10649
10220 @override 10650 @override
10221 ThrowExpression visitThrowExpression(ThrowExpression node) { 10651 ThrowExpression visitThrowExpression(ThrowExpression node) {
10222 ThrowExpression copy = new ThrowExpression( 10652 ThrowExpression copy = new ThrowExpression(
10223 _mapToken(node.throwKeyword), _cloneNode(node.expression)); 10653 _mapToken(node.throwKeyword), _cloneNode(node.expression));
10224 copy.propagatedType = node.propagatedType; 10654 copy.propagatedType = node.propagatedType;
10225 copy.staticType = node.staticType; 10655 copy.staticType = node.staticType;
10226 return copy; 10656 return copy;
10227 } 10657 }
10228 10658
10229 @override 10659 @override
10230 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 10660 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
10231 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 10661 TopLevelVariableDeclaration node) =>
10232 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10662 new TopLevelVariableDeclaration(
10233 _cloneNode(node.variables), _mapToken(node.semicolon)); 10663 _cloneNode(node.documentationComment),
10664 _cloneNodeList(node.metadata),
10665 _cloneNode(node.variables),
10666 _mapToken(node.semicolon));
10234 10667
10235 @override 10668 @override
10236 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 10669 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
10237 _mapToken(node.tryKeyword), _cloneNode(node.body), 10670 _mapToken(node.tryKeyword),
10238 _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword), 10671 _cloneNode(node.body),
10672 _cloneNodeList(node.catchClauses),
10673 _mapToken(node.finallyKeyword),
10239 _cloneNode(node.finallyBlock)); 10674 _cloneNode(node.finallyBlock));
10240 10675
10241 @override 10676 @override
10242 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 10677 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
10243 new TypeArgumentList(_mapToken(node.leftBracket), 10678 new TypeArgumentList(_mapToken(node.leftBracket),
10244 _cloneNodeList(node.arguments), _mapToken(node.rightBracket)); 10679 _cloneNodeList(node.arguments), _mapToken(node.rightBracket));
10245 10680
10246 @override 10681 @override
10247 TypeName visitTypeName(TypeName node) { 10682 TypeName visitTypeName(TypeName node) {
10248 TypeName copy = 10683 TypeName copy =
10249 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments)); 10684 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
10250 copy.type = node.type; 10685 copy.type = node.type;
10251 return copy; 10686 return copy;
10252 } 10687 }
10253 10688
10254 @override 10689 @override
10255 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 10690 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
10256 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10691 _cloneNode(node.documentationComment),
10257 _cloneNode(node.name), _mapToken(node.extendsKeyword), 10692 _cloneNodeList(node.metadata),
10693 _cloneNode(node.name),
10694 _mapToken(node.extendsKeyword),
10258 _cloneNode(node.bound)); 10695 _cloneNode(node.bound));
10259 10696
10260 @override 10697 @override
10261 TypeParameterList visitTypeParameterList(TypeParameterList node) => 10698 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
10262 new TypeParameterList(_mapToken(node.leftBracket), 10699 new TypeParameterList(_mapToken(node.leftBracket),
10263 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); 10700 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket));
10264 10701
10265 @override 10702 @override
10266 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 10703 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
10267 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals), 10704 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals),
10268 _cloneNode(node.initializer)); 10705 _cloneNode(node.initializer));
10269 10706
10270 @override 10707 @override
10271 VariableDeclarationList visitVariableDeclarationList( 10708 VariableDeclarationList visitVariableDeclarationList(
10272 VariableDeclarationList node) => new VariableDeclarationList(null, 10709 VariableDeclarationList node) =>
10273 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10710 new VariableDeclarationList(
10274 _cloneNode(node.type), _cloneNodeList(node.variables)); 10711 null,
10712 _cloneNodeList(node.metadata),
10713 _mapToken(node.keyword),
10714 _cloneNode(node.type),
10715 _cloneNodeList(node.variables));
10275 10716
10276 @override 10717 @override
10277 VariableDeclarationStatement visitVariableDeclarationStatement( 10718 VariableDeclarationStatement visitVariableDeclarationStatement(
10278 VariableDeclarationStatement node) => new VariableDeclarationStatement( 10719 VariableDeclarationStatement node) =>
10279 _cloneNode(node.variables), _mapToken(node.semicolon)); 10720 new VariableDeclarationStatement(
10721 _cloneNode(node.variables), _mapToken(node.semicolon));
10280 10722
10281 @override 10723 @override
10282 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 10724 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
10283 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10725 _mapToken(node.whileKeyword),
10284 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10726 _mapToken(node.leftParenthesis),
10727 _cloneNode(node.condition),
10728 _mapToken(node.rightParenthesis),
10285 _cloneNode(node.body)); 10729 _cloneNode(node.body));
10286 10730
10287 @override 10731 @override
10288 WithClause visitWithClause(WithClause node) => new WithClause( 10732 WithClause visitWithClause(WithClause node) => new WithClause(
10289 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes)); 10733 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
10290 10734
10291 @override 10735 @override
10292 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 10736 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
10293 _mapToken(node.yieldKeyword), _mapToken(node.star), 10737 _mapToken(node.yieldKeyword),
10294 _cloneNode(node.expression), _mapToken(node.semicolon)); 10738 _mapToken(node.star),
10739 _cloneNode(node.expression),
10740 _mapToken(node.semicolon));
10295 10741
10296 AstNode _cloneNode(AstNode node) { 10742 AstNode _cloneNode(AstNode node) {
10297 if (node == null) { 10743 if (node == null) {
10298 return null; 10744 return null;
10299 } 10745 }
10300 if (identical(node, _oldNode)) { 10746 if (identical(node, _oldNode)) {
10301 return _newNode; 10747 return _newNode;
10302 } 10748 }
10303 return node.accept(this) as AstNode; 10749 return node.accept(this) as AstNode;
10304 } 10750 }
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after
11567 * Initialize a newly created method declaration. Either or both of the 12013 * Initialize a newly created method declaration. Either or both of the
11568 * [comment] and [metadata] can be `null` if the declaration does not have the 12014 * [comment] and [metadata] can be `null` if the declaration does not have the
11569 * corresponding attribute. The [externalKeyword] can be `null` if the method 12015 * corresponding attribute. The [externalKeyword] can be `null` if the method
11570 * is not external. The [modifierKeyword] can be `null` if the method is 12016 * is not external. The [modifierKeyword] can be `null` if the method is
11571 * neither abstract nor static. The [returnType] can be `null` if no return 12017 * neither abstract nor static. The [returnType] can be `null` if no return
11572 * type was specified. The [propertyKeyword] can be `null` if the method is 12018 * type was specified. The [propertyKeyword] can be `null` if the method is
11573 * neither a getter or a setter. The [operatorKeyword] can be `null` if the 12019 * neither a getter or a setter. The [operatorKeyword] can be `null` if the
11574 * method does not implement an operator. The [parameters] must be `null` if 12020 * method does not implement an operator. The [parameters] must be `null` if
11575 * this method declares a getter. 12021 * this method declares a getter.
11576 */ 12022 */
11577 MethodDeclaration(Comment comment, List<Annotation> metadata, 12023 MethodDeclaration(
11578 this.externalKeyword, this.modifierKeyword, TypeName returnType, 12024 Comment comment,
11579 this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name, 12025 List<Annotation> metadata,
11580 TypeParameterList typeParameters, FormalParameterList parameters, 12026 this.externalKeyword,
12027 this.modifierKeyword,
12028 TypeName returnType,
12029 this.propertyKeyword,
12030 this.operatorKeyword,
12031 SimpleIdentifier name,
12032 TypeParameterList typeParameters,
12033 FormalParameterList parameters,
11581 FunctionBody body) 12034 FunctionBody body)
11582 : super(comment, metadata) { 12035 : super(comment, metadata) {
11583 _returnType = _becomeParentOf(returnType); 12036 _returnType = _becomeParentOf(returnType);
11584 _name = _becomeParentOf(name); 12037 _name = _becomeParentOf(name);
11585 _typeParameters = _becomeParentOf(typeParameters); 12038 _typeParameters = _becomeParentOf(typeParameters);
11586 _parameters = _becomeParentOf(parameters); 12039 _parameters = _becomeParentOf(parameters);
11587 _body = _becomeParentOf(body); 12040 _body = _becomeParentOf(body);
11588 } 12041 }
11589 12042
11590 /** 12043 /**
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
11774 12227
11775 /** 12228 /**
11776 * The list of arguments to the method. 12229 * The list of arguments to the method.
11777 */ 12230 */
11778 ArgumentList _argumentList; 12231 ArgumentList _argumentList;
11779 12232
11780 /** 12233 /**
11781 * Initialize a newly created method invocation. The [target] and [operator] 12234 * Initialize a newly created method invocation. The [target] and [operator]
11782 * can be `null` if there is no target. 12235 * can be `null` if there is no target.
11783 */ 12236 */
11784 MethodInvocation(Expression target, this.operator, 12237 MethodInvocation(
11785 SimpleIdentifier methodName, TypeArgumentList typeArguments, 12238 Expression target,
12239 this.operator,
12240 SimpleIdentifier methodName,
12241 TypeArgumentList typeArguments,
11786 ArgumentList argumentList) { 12242 ArgumentList argumentList) {
11787 _target = _becomeParentOf(target); 12243 _target = _becomeParentOf(target);
11788 _methodName = _becomeParentOf(methodName); 12244 _methodName = _becomeParentOf(methodName);
11789 _typeArguments = _becomeParentOf(typeArguments); 12245 _typeArguments = _becomeParentOf(typeArguments);
11790 _argumentList = _becomeParentOf(argumentList); 12246 _argumentList = _becomeParentOf(argumentList);
11791 } 12247 }
11792 12248
11793 /** 12249 /**
11794 * Return the list of arguments to the method. 12250 * Return the list of arguments to the method.
11795 */ 12251 */
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after
12570 node.expression = _newNode as Expression; 13026 node.expression = _newNode as Expression;
12571 return true; 13027 return true;
12572 } else if (identical(node.type, _oldNode)) { 13028 } else if (identical(node.type, _oldNode)) {
12573 node.type = _newNode as TypeName; 13029 node.type = _newNode as TypeName;
12574 return true; 13030 return true;
12575 } 13031 }
12576 return visitNode(node); 13032 return visitNode(node);
12577 } 13033 }
12578 13034
12579 @override 13035 @override
12580 bool visitAssertStatement(AssertStatement node) { 13036 bool visitAssertStatement(AssertStatement node) {
Brian Wilkerson 2015/09/02 15:49:15 This needs to be updated to replace the message.
Paul Berry 2015/09/07 19:44:29 Done.
12581 if (identical(node.condition, _oldNode)) { 13037 if (identical(node.condition, _oldNode)) {
12582 node.condition = _newNode as Expression; 13038 node.condition = _newNode as Expression;
12583 return true; 13039 return true;
12584 } 13040 }
12585 return visitNode(node); 13041 return visitNode(node);
12586 } 13042 }
12587 13043
12588 @override 13044 @override
12589 bool visitAssignmentExpression(AssignmentExpression node) { 13045 bool visitAssignmentExpression(AssignmentExpression node) {
12590 if (identical(node.leftHandSide, _oldNode)) { 13046 if (identical(node.leftHandSide, _oldNode)) {
(...skipping 3411 matching lines...) Expand 10 before | Expand all | Expand 10 after
16002 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; 16458 R visitPrefixedIdentifier(PrefixedIdentifier node) => null;
16003 16459
16004 @override 16460 @override
16005 R visitPrefixExpression(PrefixExpression node) => null; 16461 R visitPrefixExpression(PrefixExpression node) => null;
16006 16462
16007 @override 16463 @override
16008 R visitPropertyAccess(PropertyAccess node) => null; 16464 R visitPropertyAccess(PropertyAccess node) => null;
16009 16465
16010 @override 16466 @override
16011 R visitRedirectingConstructorInvocation( 16467 R visitRedirectingConstructorInvocation(
16012 RedirectingConstructorInvocation node) => null; 16468 RedirectingConstructorInvocation node) =>
16469 null;
16013 16470
16014 @override 16471 @override
16015 R visitRethrowExpression(RethrowExpression node) => null; 16472 R visitRethrowExpression(RethrowExpression node) => null;
16016 16473
16017 @override 16474 @override
16018 R visitReturnStatement(ReturnStatement node) => null; 16475 R visitReturnStatement(ReturnStatement node) => null;
16019 16476
16020 @override 16477 @override
16021 R visitScriptTag(ScriptTag node) => null; 16478 R visitScriptTag(ScriptTag node) => null;
16022 16479
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
17223 17680
17224 /** 17681 /**
17225 * The right curly bracket. 17682 * The right curly bracket.
17226 */ 17683 */
17227 Token rightBracket; 17684 Token rightBracket;
17228 17685
17229 /** 17686 /**
17230 * Initialize a newly created switch statement. The list of [members] can be 17687 * Initialize a newly created switch statement. The list of [members] can be
17231 * `null` if there are no switch members. 17688 * `null` if there are no switch members.
17232 */ 17689 */
17233 SwitchStatement(this.switchKeyword, this.leftParenthesis, 17690 SwitchStatement(
17234 Expression expression, this.rightParenthesis, this.leftBracket, 17691 this.switchKeyword,
17235 List<SwitchMember> members, this.rightBracket) { 17692 this.leftParenthesis,
17693 Expression expression,
17694 this.rightParenthesis,
17695 this.leftBracket,
17696 List<SwitchMember> members,
17697 this.rightBracket) {
17236 _expression = _becomeParentOf(expression); 17698 _expression = _becomeParentOf(expression);
17237 _members = new NodeList<SwitchMember>(this, members); 17699 _members = new NodeList<SwitchMember>(this, members);
17238 } 17700 }
17239 17701
17240 @override 17702 @override
17241 Token get beginToken => switchKeyword; 17703 Token get beginToken => switchKeyword;
17242 17704
17243 @override 17705 @override
17244 Iterable get childEntities => new ChildEntities() 17706 Iterable get childEntities => new ChildEntities()
17245 ..add(switchKeyword) 17707 ..add(switchKeyword)
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
17577 18039
17578 @override 18040 @override
17579 Object visitAsExpression(AsExpression node) { 18041 Object visitAsExpression(AsExpression node) {
17580 _visitNode(node.expression); 18042 _visitNode(node.expression);
17581 _writer.print(" as "); 18043 _writer.print(" as ");
17582 _visitNode(node.type); 18044 _visitNode(node.type);
17583 return null; 18045 return null;
17584 } 18046 }
17585 18047
17586 @override 18048 @override
17587 Object visitAssertStatement(AssertStatement node) { 18049 Object visitAssertStatement(AssertStatement node) {
Brian Wilkerson 2015/09/02 15:49:15 This needs to be updated to print the new children
Paul Berry 2015/09/07 19:44:29 Done.
17588 _writer.print("assert ("); 18050 _writer.print("assert (");
17589 _visitNode(node.condition); 18051 _visitNode(node.condition);
17590 _writer.print(");"); 18052 _writer.print(");");
17591 return null; 18053 return null;
17592 } 18054 }
17593 18055
17594 @override 18056 @override
17595 Object visitAssignmentExpression(AssignmentExpression node) { 18057 Object visitAssignmentExpression(AssignmentExpression node) {
17596 _visitNode(node.leftHandSide); 18058 _visitNode(node.leftHandSide);
17597 _writer.print(' '); 18059 _writer.print(' ');
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
19446 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node); 19908 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node);
19447 19909
19448 @override 19910 @override
19449 R visitPrefixExpression(PrefixExpression node) => visitNode(node); 19911 R visitPrefixExpression(PrefixExpression node) => visitNode(node);
19450 19912
19451 @override 19913 @override
19452 R visitPropertyAccess(PropertyAccess node) => visitNode(node); 19914 R visitPropertyAccess(PropertyAccess node) => visitNode(node);
19453 19915
19454 @override 19916 @override
19455 R visitRedirectingConstructorInvocation( 19917 R visitRedirectingConstructorInvocation(
19456 RedirectingConstructorInvocation node) => visitNode(node); 19918 RedirectingConstructorInvocation node) =>
19919 visitNode(node);
19457 19920
19458 @override 19921 @override
19459 R visitRethrowExpression(RethrowExpression node) => visitNode(node); 19922 R visitRethrowExpression(RethrowExpression node) => visitNode(node);
19460 19923
19461 @override 19924 @override
19462 R visitReturnStatement(ReturnStatement node) => visitNode(node); 19925 R visitReturnStatement(ReturnStatement node) => visitNode(node);
19463 19926
19464 @override 19927 @override
19465 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 19928 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
19466 19929
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
20200 } 20663 }
20201 20664
20202 @override 20665 @override
20203 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); 20666 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
20204 20667
20205 @override 20668 @override
20206 void visitChildren(AstVisitor visitor) { 20669 void visitChildren(AstVisitor visitor) {
20207 _safelyVisitChild(_expression, visitor); 20670 _safelyVisitChild(_expression, visitor);
20208 } 20671 }
20209 } 20672 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698