Chromium Code Reviews

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: Address review comments. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 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...)
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.
683 *
684 * Deprecated: please use [AssertStatement.withOptionalMessage] instead.
685 */
686 @deprecated
687 AssertStatement(Token assertKeyword, Token leftParenthesis,
688 Expression condition, Token rightParenthesis, Token semicolon)
689 : this.withOptionalMessage(assertKeyword, leftParenthesis, condition,
690 null, null, rightParenthesis, semicolon);
691
692 /**
693 * Initialize a newly created assert statement.
672 */ 694 */
673 AssertStatement(this.assertKeyword, this.leftParenthesis, 695 AssertStatement.withOptionalMessage(
674 Expression condition, this.rightParenthesis, this.semicolon) { 696 this.assertKeyword,
697 this.leftParenthesis,
698 Expression condition,
699 this.comma,
700 Expression message,
701 this.rightParenthesis,
702 this.semicolon) {
675 _condition = _becomeParentOf(condition); 703 _condition = _becomeParentOf(condition);
704 _message = _becomeParentOf(message);
676 } 705 }
677 706
678 @override 707 @override
679 Token get beginToken => assertKeyword; 708 Token get beginToken => assertKeyword;
680 709
681 @override 710 @override
682 Iterable get childEntities => new ChildEntities() 711 Iterable get childEntities => new ChildEntities()
683 ..add(assertKeyword) 712 ..add(assertKeyword)
684 ..add(leftParenthesis) 713 ..add(leftParenthesis)
685 ..add(_condition) 714 ..add(_condition)
715 ..add(comma)
716 ..add(_message)
686 ..add(rightParenthesis) 717 ..add(rightParenthesis)
687 ..add(semicolon); 718 ..add(semicolon);
688 719
689 /** 720 /**
690 * Return the condition that is being asserted to be `true`. 721 * Return the condition that is being asserted to be `true`.
691 */ 722 */
692 Expression get condition => _condition; 723 Expression get condition => _condition;
693 724
694 /** 725 /**
695 * Set the condition that is being asserted to be `true` to the given 726 * Set the condition that is being asserted to be `true` to the given
(...skipping 13 matching lines...)
709 Token get keyword => assertKeyword; 740 Token get keyword => assertKeyword;
710 741
711 /** 742 /**
712 * Set the token representing the 'assert' keyword to the given [token]. 743 * Set the token representing the 'assert' keyword to the given [token].
713 */ 744 */
714 @deprecated // Use "this.assertKeyword" 745 @deprecated // Use "this.assertKeyword"
715 set keyword(Token token) { 746 set keyword(Token token) {
716 assertKeyword = token; 747 assertKeyword = token;
717 } 748 }
718 749
750 /**
751 * Return the messasge to report if the assertion fails.
752 */
753 Expression get message => _message;
754
755 /**
756 * Set the message to report if the assertion fails to the given
757 * [expression].
758 */
759 void set message(Expression expression) {
760 _message = _becomeParentOf(expression);
761 }
762
719 @override 763 @override
720 accept(AstVisitor visitor) => visitor.visitAssertStatement(this); 764 accept(AstVisitor visitor) => visitor.visitAssertStatement(this);
721 765
722 @override 766 @override
723 void visitChildren(AstVisitor visitor) { 767 void visitChildren(AstVisitor visitor) {
724 _safelyVisitChild(_condition, visitor); 768 _safelyVisitChild(_condition, visitor);
769 _safelyVisitChild(message, visitor);
725 } 770 }
726 } 771 }
727 772
728 /** 773 /**
729 * An assignment expression. 774 * An assignment expression.
730 * 775 *
731 * > assignmentExpression ::= 776 * > assignmentExpression ::=
732 * > [Expression] operator [Expression] 777 * > [Expression] operator [Expression]
733 */ 778 */
734 class AssignmentExpression extends Expression { 779 class AssignmentExpression extends Expression {
(...skipping 221 matching lines...)
956 * A flag indicating whether tokens should be cloned while cloning an AST 1001 * A flag indicating whether tokens should be cloned while cloning an AST
957 * structure. 1002 * structure.
958 */ 1003 */
959 final bool cloneTokens; 1004 final bool cloneTokens;
960 1005
961 /** 1006 /**
962 * Initialize a newly created AST cloner to optionally clone tokens while 1007 * Initialize a newly created AST cloner to optionally clone tokens while
963 * cloning AST nodes if [cloneTokens] is `true`. 1008 * cloning AST nodes if [cloneTokens] is `true`.
964 */ 1009 */
965 AstCloner( 1010 AstCloner(
966 [this.cloneTokens = false]); // TODO(brianwilkerson) Change this to be a n amed parameter. 1011 [this.cloneTokens =
1012 false]); // TODO(brianwilkerson) Change this to be a named parameter.
967 1013
968 /** 1014 /**
969 * Return a clone of the given [node]. 1015 * Return a clone of the given [node].
970 */ 1016 */
971 AstNode cloneNode(AstNode node) { 1017 AstNode cloneNode(AstNode node) {
972 if (node == null) { 1018 if (node == null) {
973 return null; 1019 return null;
974 } 1020 }
975 return node.accept(this) as AstNode; 1021 return node.accept(this) as AstNode;
976 } 1022 }
(...skipping 31 matching lines...)
1008 } 1054 }
1009 return tokens; 1055 return tokens;
1010 } 1056 }
1011 1057
1012 @override 1058 @override
1013 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 1059 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
1014 new AdjacentStrings(cloneNodeList(node.strings)); 1060 new AdjacentStrings(cloneNodeList(node.strings));
1015 1061
1016 @override 1062 @override
1017 Annotation visitAnnotation(Annotation node) => new Annotation( 1063 Annotation visitAnnotation(Annotation node) => new Annotation(
1018 cloneToken(node.atSign), cloneNode(node.name), cloneToken(node.period), 1064 cloneToken(node.atSign),
1019 cloneNode(node.constructorName), cloneNode(node.arguments)); 1065 cloneNode(node.name),
1066 cloneToken(node.period),
1067 cloneNode(node.constructorName),
1068 cloneNode(node.arguments));
1020 1069
1021 @override 1070 @override
1022 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 1071 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
1023 cloneToken(node.leftParenthesis), cloneNodeList(node.arguments), 1072 cloneToken(node.leftParenthesis),
1073 cloneNodeList(node.arguments),
1024 cloneToken(node.rightParenthesis)); 1074 cloneToken(node.rightParenthesis));
1025 1075
1026 @override 1076 @override
1027 AsExpression visitAsExpression(AsExpression node) => new AsExpression( 1077 AsExpression visitAsExpression(AsExpression node) => new AsExpression(
1028 cloneNode(node.expression), cloneToken(node.asOperator), 1078 cloneNode(node.expression),
1079 cloneToken(node.asOperator),
1029 cloneNode(node.type)); 1080 cloneNode(node.type));
1030 1081
1031 @override 1082 @override
1032 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 1083 AstNode visitAssertStatement(AssertStatement node) =>
1033 cloneToken(node.assertKeyword), cloneToken(node.leftParenthesis), 1084 new AssertStatement.withOptionalMessage(
1034 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1085 cloneToken(node.assertKeyword),
1035 cloneToken(node.semicolon)); 1086 cloneToken(node.leftParenthesis),
1087 cloneNode(node.condition),
1088 cloneToken(node.comma),
1089 cloneNode(node.message),
1090 cloneToken(node.rightParenthesis),
1091 cloneToken(node.semicolon));
1036 1092
1037 @override 1093 @override
1038 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => 1094 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) =>
1039 new AssignmentExpression(cloneNode(node.leftHandSide), 1095 new AssignmentExpression(cloneNode(node.leftHandSide),
1040 cloneToken(node.operator), cloneNode(node.rightHandSide)); 1096 cloneToken(node.operator), cloneNode(node.rightHandSide));
1041 1097
1042 @override 1098 @override
1043 AwaitExpression visitAwaitExpression(AwaitExpression node) => 1099 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
1044 new AwaitExpression( 1100 new AwaitExpression(
1045 cloneToken(node.awaitKeyword), cloneNode(node.expression)); 1101 cloneToken(node.awaitKeyword), cloneNode(node.expression));
1046 1102
1047 @override 1103 @override
1048 BinaryExpression visitBinaryExpression(BinaryExpression node) => 1104 BinaryExpression visitBinaryExpression(BinaryExpression node) =>
1049 new BinaryExpression(cloneNode(node.leftOperand), 1105 new BinaryExpression(cloneNode(node.leftOperand),
1050 cloneToken(node.operator), cloneNode(node.rightOperand)); 1106 cloneToken(node.operator), cloneNode(node.rightOperand));
1051 1107
1052 @override 1108 @override
1053 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket), 1109 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket),
1054 cloneNodeList(node.statements), cloneToken(node.rightBracket)); 1110 cloneNodeList(node.statements), cloneToken(node.rightBracket));
1055 1111
1056 @override 1112 @override
1057 BlockFunctionBody visitBlockFunctionBody( 1113 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
1058 BlockFunctionBody node) => new BlockFunctionBody( 1114 new BlockFunctionBody(cloneToken(node.keyword), cloneToken(node.star),
1059 cloneToken(node.keyword), cloneToken(node.star), cloneNode(node.block)); 1115 cloneNode(node.block));
1060 1116
1061 @override 1117 @override
1062 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => 1118 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
1063 new BooleanLiteral(cloneToken(node.literal), node.value); 1119 new BooleanLiteral(cloneToken(node.literal), node.value);
1064 1120
1065 @override 1121 @override
1066 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 1122 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
1067 cloneToken(node.breakKeyword), cloneNode(node.label), 1123 cloneToken(node.breakKeyword),
1124 cloneNode(node.label),
1068 cloneToken(node.semicolon)); 1125 cloneToken(node.semicolon));
1069 1126
1070 @override 1127 @override
1071 CascadeExpression visitCascadeExpression(CascadeExpression node) => 1128 CascadeExpression visitCascadeExpression(CascadeExpression node) =>
1072 new CascadeExpression( 1129 new CascadeExpression(
1073 cloneNode(node.target), cloneNodeList(node.cascadeSections)); 1130 cloneNode(node.target), cloneNodeList(node.cascadeSections));
1074 1131
1075 @override 1132 @override
1076 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 1133 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
1077 cloneToken(node.onKeyword), cloneNode(node.exceptionType), 1134 cloneToken(node.onKeyword),
1078 cloneToken(node.catchKeyword), cloneToken(node.leftParenthesis), 1135 cloneNode(node.exceptionType),
1079 cloneNode(node.exceptionParameter), cloneToken(node.comma), 1136 cloneToken(node.catchKeyword),
1080 cloneNode(node.stackTraceParameter), cloneToken(node.rightParenthesis), 1137 cloneToken(node.leftParenthesis),
1138 cloneNode(node.exceptionParameter),
1139 cloneToken(node.comma),
1140 cloneNode(node.stackTraceParameter),
1141 cloneToken(node.rightParenthesis),
1081 cloneNode(node.body)); 1142 cloneNode(node.body));
1082 1143
1083 @override 1144 @override
1084 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 1145 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
1085 ClassDeclaration copy = new ClassDeclaration( 1146 ClassDeclaration copy = new ClassDeclaration(
1086 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1147 cloneNode(node.documentationComment),
1087 cloneToken(node.abstractKeyword), cloneToken(node.classKeyword), 1148 cloneNodeList(node.metadata),
1088 cloneNode(node.name), cloneNode(node.typeParameters), 1149 cloneToken(node.abstractKeyword),
1089 cloneNode(node.extendsClause), cloneNode(node.withClause), 1150 cloneToken(node.classKeyword),
1090 cloneNode(node.implementsClause), cloneToken(node.leftBracket), 1151 cloneNode(node.name),
1091 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1152 cloneNode(node.typeParameters),
1153 cloneNode(node.extendsClause),
1154 cloneNode(node.withClause),
1155 cloneNode(node.implementsClause),
1156 cloneToken(node.leftBracket),
1157 cloneNodeList(node.members),
1158 cloneToken(node.rightBracket));
1092 copy.nativeClause = cloneNode(node.nativeClause); 1159 copy.nativeClause = cloneNode(node.nativeClause);
1093 return copy; 1160 return copy;
1094 } 1161 }
1095 1162
1096 @override 1163 @override
1097 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 1164 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
1098 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1165 cloneNode(node.documentationComment),
1099 cloneToken(node.typedefKeyword), cloneNode(node.name), 1166 cloneNodeList(node.metadata),
1100 cloneNode(node.typeParameters), cloneToken(node.equals), 1167 cloneToken(node.typedefKeyword),
1101 cloneToken(node.abstractKeyword), cloneNode(node.superclass), 1168 cloneNode(node.name),
1102 cloneNode(node.withClause), cloneNode(node.implementsClause), 1169 cloneNode(node.typeParameters),
1170 cloneToken(node.equals),
1171 cloneToken(node.abstractKeyword),
1172 cloneNode(node.superclass),
1173 cloneNode(node.withClause),
1174 cloneNode(node.implementsClause),
1103 cloneToken(node.semicolon)); 1175 cloneToken(node.semicolon));
1104 1176
1105 @override 1177 @override
1106 Comment visitComment(Comment node) { 1178 Comment visitComment(Comment node) {
1107 if (node.isDocumentation) { 1179 if (node.isDocumentation) {
1108 return Comment.createDocumentationCommentWithReferences( 1180 return Comment.createDocumentationCommentWithReferences(
1109 cloneTokenList(node.tokens), cloneNodeList(node.references)); 1181 cloneTokenList(node.tokens), cloneNodeList(node.references));
1110 } else if (node.isBlock) { 1182 } else if (node.isBlock) {
1111 return Comment.createBlockComment(cloneTokenList(node.tokens)); 1183 return Comment.createBlockComment(cloneTokenList(node.tokens));
1112 } 1184 }
1113 return Comment.createEndOfLineComment(cloneTokenList(node.tokens)); 1185 return Comment.createEndOfLineComment(cloneTokenList(node.tokens));
1114 } 1186 }
1115 1187
1116 @override 1188 @override
1117 CommentReference visitCommentReference(CommentReference node) => 1189 CommentReference visitCommentReference(CommentReference node) =>
1118 new CommentReference( 1190 new CommentReference(
1119 cloneToken(node.newKeyword), cloneNode(node.identifier)); 1191 cloneToken(node.newKeyword), cloneNode(node.identifier));
1120 1192
1121 @override 1193 @override
1122 CompilationUnit visitCompilationUnit(CompilationUnit node) { 1194 CompilationUnit visitCompilationUnit(CompilationUnit node) {
1123 CompilationUnit clone = new CompilationUnit(cloneToken(node.beginToken), 1195 CompilationUnit clone = new CompilationUnit(
1124 cloneNode(node.scriptTag), cloneNodeList(node.directives), 1196 cloneToken(node.beginToken),
1125 cloneNodeList(node.declarations), cloneToken(node.endToken)); 1197 cloneNode(node.scriptTag),
1198 cloneNodeList(node.directives),
1199 cloneNodeList(node.declarations),
1200 cloneToken(node.endToken));
1126 clone.lineInfo = node.lineInfo; 1201 clone.lineInfo = node.lineInfo;
1127 return clone; 1202 return clone;
1128 } 1203 }
1129 1204
1130 @override 1205 @override
1131 ConditionalExpression visitConditionalExpression( 1206 ConditionalExpression visitConditionalExpression(
1132 ConditionalExpression node) => new ConditionalExpression( 1207 ConditionalExpression node) =>
1133 cloneNode(node.condition), cloneToken(node.question), 1208 new ConditionalExpression(
1134 cloneNode(node.thenExpression), cloneToken(node.colon), 1209 cloneNode(node.condition),
1135 cloneNode(node.elseExpression)); 1210 cloneToken(node.question),
1211 cloneNode(node.thenExpression),
1212 cloneToken(node.colon),
1213 cloneNode(node.elseExpression));
1136 1214
1137 @override 1215 @override
1138 ConstructorDeclaration visitConstructorDeclaration( 1216 ConstructorDeclaration visitConstructorDeclaration(
1139 ConstructorDeclaration node) => new ConstructorDeclaration( 1217 ConstructorDeclaration node) =>
1140 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1218 new ConstructorDeclaration(
1141 cloneToken(node.externalKeyword), cloneToken(node.constKeyword), 1219 cloneNode(node.documentationComment),
1142 cloneToken(node.factoryKeyword), cloneNode(node.returnType), 1220 cloneNodeList(node.metadata),
1143 cloneToken(node.period), cloneNode(node.name), cloneNode(node.parameters), 1221 cloneToken(node.externalKeyword),
1144 cloneToken(node.separator), cloneNodeList(node.initializers), 1222 cloneToken(node.constKeyword),
1145 cloneNode(node.redirectedConstructor), cloneNode(node.body)); 1223 cloneToken(node.factoryKeyword),
1224 cloneNode(node.returnType),
1225 cloneToken(node.period),
1226 cloneNode(node.name),
1227 cloneNode(node.parameters),
1228 cloneToken(node.separator),
1229 cloneNodeList(node.initializers),
1230 cloneNode(node.redirectedConstructor),
1231 cloneNode(node.body));
1146 1232
1147 @override 1233 @override
1148 ConstructorFieldInitializer visitConstructorFieldInitializer( 1234 ConstructorFieldInitializer visitConstructorFieldInitializer(
1149 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 1235 ConstructorFieldInitializer node) =>
1150 cloneToken(node.thisKeyword), cloneToken(node.period), 1236 new ConstructorFieldInitializer(
1151 cloneNode(node.fieldName), cloneToken(node.equals), 1237 cloneToken(node.thisKeyword),
1152 cloneNode(node.expression)); 1238 cloneToken(node.period),
1239 cloneNode(node.fieldName),
1240 cloneToken(node.equals),
1241 cloneNode(node.expression));
1153 1242
1154 @override 1243 @override
1155 ConstructorName visitConstructorName(ConstructorName node) => 1244 ConstructorName visitConstructorName(ConstructorName node) =>
1156 new ConstructorName( 1245 new ConstructorName(
1157 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name)); 1246 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name));
1158 1247
1159 @override 1248 @override
1160 ContinueStatement visitContinueStatement(ContinueStatement node) => 1249 ContinueStatement visitContinueStatement(ContinueStatement node) =>
1161 new ContinueStatement(cloneToken(node.continueKeyword), 1250 new ContinueStatement(cloneToken(node.continueKeyword),
1162 cloneNode(node.label), cloneToken(node.semicolon)); 1251 cloneNode(node.label), cloneToken(node.semicolon));
1163 1252
1164 @override 1253 @override
1165 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 1254 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
1166 new DeclaredIdentifier(cloneNode(node.documentationComment), 1255 new DeclaredIdentifier(
1167 cloneNodeList(node.metadata), cloneToken(node.keyword), 1256 cloneNode(node.documentationComment),
1168 cloneNode(node.type), cloneNode(node.identifier)); 1257 cloneNodeList(node.metadata),
1258 cloneToken(node.keyword),
1259 cloneNode(node.type),
1260 cloneNode(node.identifier));
1169 1261
1170 @override 1262 @override
1171 DefaultFormalParameter visitDefaultFormalParameter( 1263 DefaultFormalParameter visitDefaultFormalParameter(
1172 DefaultFormalParameter node) => new DefaultFormalParameter( 1264 DefaultFormalParameter node) =>
1173 cloneNode(node.parameter), node.kind, cloneToken(node.separator), 1265 new DefaultFormalParameter(cloneNode(node.parameter), node.kind,
1174 cloneNode(node.defaultValue)); 1266 cloneToken(node.separator), cloneNode(node.defaultValue));
1175 1267
1176 @override 1268 @override
1177 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 1269 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
1178 cloneToken(node.doKeyword), cloneNode(node.body), 1270 cloneToken(node.doKeyword),
1179 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1271 cloneNode(node.body),
1180 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1272 cloneToken(node.whileKeyword),
1273 cloneToken(node.leftParenthesis),
1274 cloneNode(node.condition),
1275 cloneToken(node.rightParenthesis),
1181 cloneToken(node.semicolon)); 1276 cloneToken(node.semicolon));
1182 1277
1183 @override 1278 @override
1184 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => 1279 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) =>
1185 new DoubleLiteral(cloneToken(node.literal), node.value); 1280 new DoubleLiteral(cloneToken(node.literal), node.value);
1186 1281
1187 @override 1282 @override
1188 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 1283 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
1189 new EmptyFunctionBody(cloneToken(node.semicolon)); 1284 new EmptyFunctionBody(cloneToken(node.semicolon));
1190 1285
1191 @override 1286 @override
1192 EmptyStatement visitEmptyStatement(EmptyStatement node) => 1287 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
1193 new EmptyStatement(cloneToken(node.semicolon)); 1288 new EmptyStatement(cloneToken(node.semicolon));
1194 1289
1195 @override 1290 @override
1196 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 1291 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
1197 new EnumConstantDeclaration(cloneNode(node.documentationComment), 1292 new EnumConstantDeclaration(cloneNode(node.documentationComment),
1198 cloneNodeList(node.metadata), cloneNode(node.name)); 1293 cloneNodeList(node.metadata), cloneNode(node.name));
1199 1294
1200 @override 1295 @override
1201 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) => 1296 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
1202 new EnumDeclaration(cloneNode(node.documentationComment), 1297 new EnumDeclaration(
1203 cloneNodeList(node.metadata), cloneToken(node.enumKeyword), 1298 cloneNode(node.documentationComment),
1204 cloneNode(node.name), cloneToken(node.leftBracket), 1299 cloneNodeList(node.metadata),
1205 cloneNodeList(node.constants), cloneToken(node.rightBracket)); 1300 cloneToken(node.enumKeyword),
1301 cloneNode(node.name),
1302 cloneToken(node.leftBracket),
1303 cloneNodeList(node.constants),
1304 cloneToken(node.rightBracket));
1206 1305
1207 @override 1306 @override
1208 ExportDirective visitExportDirective(ExportDirective node) { 1307 ExportDirective visitExportDirective(ExportDirective node) {
1209 ExportDirective directive = new ExportDirective( 1308 ExportDirective directive = new ExportDirective(
1210 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1309 cloneNode(node.documentationComment),
1211 cloneToken(node.keyword), cloneNode(node.uri), 1310 cloneNodeList(node.metadata),
1212 cloneNodeList(node.combinators), cloneToken(node.semicolon)); 1311 cloneToken(node.keyword),
1312 cloneNode(node.uri),
1313 cloneNodeList(node.combinators),
1314 cloneToken(node.semicolon));
1213 directive.source = node.source; 1315 directive.source = node.source;
1214 directive.uriContent = node.uriContent; 1316 directive.uriContent = node.uriContent;
1215 return directive; 1317 return directive;
1216 } 1318 }
1217 1319
1218 @override 1320 @override
1219 ExpressionFunctionBody visitExpressionFunctionBody( 1321 ExpressionFunctionBody visitExpressionFunctionBody(
1220 ExpressionFunctionBody node) => new ExpressionFunctionBody( 1322 ExpressionFunctionBody node) =>
1221 cloneToken(node.keyword), cloneToken(node.functionDefinition), 1323 new ExpressionFunctionBody(
1222 cloneNode(node.expression), cloneToken(node.semicolon)); 1324 cloneToken(node.keyword),
1325 cloneToken(node.functionDefinition),
1326 cloneNode(node.expression),
1327 cloneToken(node.semicolon));
1223 1328
1224 @override 1329 @override
1225 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 1330 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
1226 new ExpressionStatement( 1331 new ExpressionStatement(
1227 cloneNode(node.expression), cloneToken(node.semicolon)); 1332 cloneNode(node.expression), cloneToken(node.semicolon));
1228 1333
1229 @override 1334 @override
1230 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 1335 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
1231 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); 1336 cloneToken(node.extendsKeyword), cloneNode(node.superclass));
1232 1337
1233 @override 1338 @override
1234 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 1339 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
1235 new FieldDeclaration(cloneNode(node.documentationComment), 1340 new FieldDeclaration(
1236 cloneNodeList(node.metadata), cloneToken(node.staticKeyword), 1341 cloneNode(node.documentationComment),
1237 cloneNode(node.fields), cloneToken(node.semicolon)); 1342 cloneNodeList(node.metadata),
1343 cloneToken(node.staticKeyword),
1344 cloneNode(node.fields),
1345 cloneToken(node.semicolon));
1238 1346
1239 @override 1347 @override
1240 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 1348 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
1241 new FieldFormalParameter(cloneNode(node.documentationComment), 1349 new FieldFormalParameter(
1242 cloneNodeList(node.metadata), cloneToken(node.keyword), 1350 cloneNode(node.documentationComment),
1243 cloneNode(node.type), cloneToken(node.thisKeyword), 1351 cloneNodeList(node.metadata),
1244 cloneToken(node.period), cloneNode(node.identifier), 1352 cloneToken(node.keyword),
1245 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1353 cloneNode(node.type),
1354 cloneToken(node.thisKeyword),
1355 cloneToken(node.period),
1356 cloneNode(node.identifier),
1357 cloneNode(node.typeParameters),
1358 cloneNode(node.parameters));
1246 1359
1247 @override 1360 @override
1248 ForEachStatement visitForEachStatement(ForEachStatement node) { 1361 ForEachStatement visitForEachStatement(ForEachStatement node) {
1249 DeclaredIdentifier loopVariable = node.loopVariable; 1362 DeclaredIdentifier loopVariable = node.loopVariable;
1250 if (loopVariable == null) { 1363 if (loopVariable == null) {
1251 return new ForEachStatement.withReference(cloneToken(node.awaitKeyword), 1364 return new ForEachStatement.withReference(
1252 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1365 cloneToken(node.awaitKeyword),
1253 cloneNode(node.identifier), cloneToken(node.inKeyword), 1366 cloneToken(node.forKeyword),
1254 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1367 cloneToken(node.leftParenthesis),
1368 cloneNode(node.identifier),
1369 cloneToken(node.inKeyword),
1370 cloneNode(node.iterable),
1371 cloneToken(node.rightParenthesis),
1255 cloneNode(node.body)); 1372 cloneNode(node.body));
1256 } 1373 }
1257 return new ForEachStatement.withDeclaration(cloneToken(node.awaitKeyword), 1374 return new ForEachStatement.withDeclaration(
1258 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1375 cloneToken(node.awaitKeyword),
1259 cloneNode(loopVariable), cloneToken(node.inKeyword), 1376 cloneToken(node.forKeyword),
1260 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1377 cloneToken(node.leftParenthesis),
1378 cloneNode(loopVariable),
1379 cloneToken(node.inKeyword),
1380 cloneNode(node.iterable),
1381 cloneToken(node.rightParenthesis),
1261 cloneNode(node.body)); 1382 cloneNode(node.body));
1262 } 1383 }
1263 1384
1264 @override 1385 @override
1265 FormalParameterList visitFormalParameterList(FormalParameterList node) => 1386 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
1266 new FormalParameterList(cloneToken(node.leftParenthesis), 1387 new FormalParameterList(
1267 cloneNodeList(node.parameters), cloneToken(node.leftDelimiter), 1388 cloneToken(node.leftParenthesis),
1268 cloneToken(node.rightDelimiter), cloneToken(node.rightParenthesis)); 1389 cloneNodeList(node.parameters),
1390 cloneToken(node.leftDelimiter),
1391 cloneToken(node.rightDelimiter),
1392 cloneToken(node.rightParenthesis));
1269 1393
1270 @override 1394 @override
1271 ForStatement visitForStatement(ForStatement node) => new ForStatement( 1395 ForStatement visitForStatement(ForStatement node) => new ForStatement(
1272 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1396 cloneToken(node.forKeyword),
1273 cloneNode(node.variables), cloneNode(node.initialization), 1397 cloneToken(node.leftParenthesis),
1274 cloneToken(node.leftSeparator), cloneNode(node.condition), 1398 cloneNode(node.variables),
1275 cloneToken(node.rightSeparator), cloneNodeList(node.updaters), 1399 cloneNode(node.initialization),
1276 cloneToken(node.rightParenthesis), cloneNode(node.body)); 1400 cloneToken(node.leftSeparator),
1401 cloneNode(node.condition),
1402 cloneToken(node.rightSeparator),
1403 cloneNodeList(node.updaters),
1404 cloneToken(node.rightParenthesis),
1405 cloneNode(node.body));
1277 1406
1278 @override 1407 @override
1279 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 1408 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
1280 new FunctionDeclaration(cloneNode(node.documentationComment), 1409 new FunctionDeclaration(
1281 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1410 cloneNode(node.documentationComment),
1282 cloneNode(node.returnType), cloneToken(node.propertyKeyword), 1411 cloneNodeList(node.metadata),
1283 cloneNode(node.name), cloneNode(node.functionExpression)); 1412 cloneToken(node.externalKeyword),
1413 cloneNode(node.returnType),
1414 cloneToken(node.propertyKeyword),
1415 cloneNode(node.name),
1416 cloneNode(node.functionExpression));
1284 1417
1285 @override 1418 @override
1286 FunctionDeclarationStatement visitFunctionDeclarationStatement( 1419 FunctionDeclarationStatement visitFunctionDeclarationStatement(
1287 FunctionDeclarationStatement node) => 1420 FunctionDeclarationStatement node) =>
1288 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration)); 1421 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
1289 1422
1290 @override 1423 @override
1291 FunctionExpression visitFunctionExpression(FunctionExpression node) => 1424 FunctionExpression visitFunctionExpression(FunctionExpression node) =>
1292 new FunctionExpression(cloneNode(node.typeParameters), 1425 new FunctionExpression(cloneNode(node.typeParameters),
1293 cloneNode(node.parameters), cloneNode(node.body)); 1426 cloneNode(node.parameters), cloneNode(node.body));
1294 1427
1295 @override 1428 @override
1296 FunctionExpressionInvocation visitFunctionExpressionInvocation( 1429 FunctionExpressionInvocation visitFunctionExpressionInvocation(
1297 FunctionExpressionInvocation node) => new FunctionExpressionInvocation( 1430 FunctionExpressionInvocation node) =>
1298 cloneNode(node.function), cloneNode(node.typeArguments), 1431 new FunctionExpressionInvocation(cloneNode(node.function),
1299 cloneNode(node.argumentList)); 1432 cloneNode(node.typeArguments), cloneNode(node.argumentList));
1300 1433
1301 @override 1434 @override
1302 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 1435 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
1303 new FunctionTypeAlias(cloneNode(node.documentationComment), 1436 new FunctionTypeAlias(
1304 cloneNodeList(node.metadata), cloneToken(node.typedefKeyword), 1437 cloneNode(node.documentationComment),
1305 cloneNode(node.returnType), cloneNode(node.name), 1438 cloneNodeList(node.metadata),
1306 cloneNode(node.typeParameters), cloneNode(node.parameters), 1439 cloneToken(node.typedefKeyword),
1440 cloneNode(node.returnType),
1441 cloneNode(node.name),
1442 cloneNode(node.typeParameters),
1443 cloneNode(node.parameters),
1307 cloneToken(node.semicolon)); 1444 cloneToken(node.semicolon));
1308 1445
1309 @override 1446 @override
1310 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 1447 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
1311 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 1448 FunctionTypedFormalParameter node) =>
1312 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1449 new FunctionTypedFormalParameter(
1313 cloneNode(node.returnType), cloneNode(node.identifier), 1450 cloneNode(node.documentationComment),
1314 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1451 cloneNodeList(node.metadata),
1452 cloneNode(node.returnType),
1453 cloneNode(node.identifier),
1454 cloneNode(node.typeParameters),
1455 cloneNode(node.parameters));
1315 1456
1316 @override 1457 @override
1317 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 1458 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
1318 cloneToken(node.keyword), cloneNodeList(node.hiddenNames)); 1459 cloneToken(node.keyword), cloneNodeList(node.hiddenNames));
1319 1460
1320 @override 1461 @override
1321 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 1462 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
1322 cloneToken(node.ifKeyword), cloneToken(node.leftParenthesis), 1463 cloneToken(node.ifKeyword),
1323 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1464 cloneToken(node.leftParenthesis),
1324 cloneNode(node.thenStatement), cloneToken(node.elseKeyword), 1465 cloneNode(node.condition),
1466 cloneToken(node.rightParenthesis),
1467 cloneNode(node.thenStatement),
1468 cloneToken(node.elseKeyword),
1325 cloneNode(node.elseStatement)); 1469 cloneNode(node.elseStatement));
1326 1470
1327 @override 1471 @override
1328 ImplementsClause visitImplementsClause(ImplementsClause node) => 1472 ImplementsClause visitImplementsClause(ImplementsClause node) =>
1329 new ImplementsClause( 1473 new ImplementsClause(
1330 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); 1474 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces));
1331 1475
1332 @override 1476 @override
1333 ImportDirective visitImportDirective(ImportDirective node) { 1477 ImportDirective visitImportDirective(ImportDirective node) {
1334 ImportDirective directive = new ImportDirective( 1478 ImportDirective directive = new ImportDirective(
1335 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1479 cloneNode(node.documentationComment),
1336 cloneToken(node.keyword), cloneNode(node.uri), 1480 cloneNodeList(node.metadata),
1337 cloneToken(node.deferredKeyword), cloneToken(node.asKeyword), 1481 cloneToken(node.keyword),
1338 cloneNode(node.prefix), cloneNodeList(node.combinators), 1482 cloneNode(node.uri),
1483 cloneToken(node.deferredKeyword),
1484 cloneToken(node.asKeyword),
1485 cloneNode(node.prefix),
1486 cloneNodeList(node.combinators),
1339 cloneToken(node.semicolon)); 1487 cloneToken(node.semicolon));
1340 directive.source = node.source; 1488 directive.source = node.source;
1341 directive.uriContent = node.uriContent; 1489 directive.uriContent = node.uriContent;
1342 return directive; 1490 return directive;
1343 } 1491 }
1344 1492
1345 @override 1493 @override
1346 IndexExpression visitIndexExpression(IndexExpression node) { 1494 IndexExpression visitIndexExpression(IndexExpression node) {
1347 Token period = node.period; 1495 Token period = node.period;
1348 if (period == null) { 1496 if (period == null) {
1349 return new IndexExpression.forTarget(cloneNode(node.target), 1497 return new IndexExpression.forTarget(
1350 cloneToken(node.leftBracket), cloneNode(node.index), 1498 cloneNode(node.target),
1499 cloneToken(node.leftBracket),
1500 cloneNode(node.index),
1351 cloneToken(node.rightBracket)); 1501 cloneToken(node.rightBracket));
1352 } else { 1502 } else {
1353 return new IndexExpression.forCascade(cloneToken(period), 1503 return new IndexExpression.forCascade(
1354 cloneToken(node.leftBracket), cloneNode(node.index), 1504 cloneToken(period),
1505 cloneToken(node.leftBracket),
1506 cloneNode(node.index),
1355 cloneToken(node.rightBracket)); 1507 cloneToken(node.rightBracket));
1356 } 1508 }
1357 } 1509 }
1358 1510
1359 @override 1511 @override
1360 InstanceCreationExpression visitInstanceCreationExpression( 1512 InstanceCreationExpression visitInstanceCreationExpression(
1361 InstanceCreationExpression node) => new InstanceCreationExpression( 1513 InstanceCreationExpression node) =>
1362 cloneToken(node.keyword), cloneNode(node.constructorName), 1514 new InstanceCreationExpression(cloneToken(node.keyword),
1363 cloneNode(node.argumentList)); 1515 cloneNode(node.constructorName), cloneNode(node.argumentList));
1364 1516
1365 @override 1517 @override
1366 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => 1518 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
1367 new IntegerLiteral(cloneToken(node.literal), node.value); 1519 new IntegerLiteral(cloneToken(node.literal), node.value);
1368 1520
1369 @override 1521 @override
1370 InterpolationExpression visitInterpolationExpression( 1522 InterpolationExpression visitInterpolationExpression(
1371 InterpolationExpression node) => new InterpolationExpression( 1523 InterpolationExpression node) =>
1372 cloneToken(node.leftBracket), cloneNode(node.expression), 1524 new InterpolationExpression(cloneToken(node.leftBracket),
1373 cloneToken(node.rightBracket)); 1525 cloneNode(node.expression), cloneToken(node.rightBracket));
1374 1526
1375 @override 1527 @override
1376 InterpolationString visitInterpolationString(InterpolationString node) => 1528 InterpolationString visitInterpolationString(InterpolationString node) =>
1377 new InterpolationString(cloneToken(node.contents), node.value); 1529 new InterpolationString(cloneToken(node.contents), node.value);
1378 1530
1379 @override 1531 @override
1380 IsExpression visitIsExpression(IsExpression node) => new IsExpression( 1532 IsExpression visitIsExpression(IsExpression node) => new IsExpression(
1381 cloneNode(node.expression), cloneToken(node.isOperator), 1533 cloneNode(node.expression),
1382 cloneToken(node.notOperator), cloneNode(node.type)); 1534 cloneToken(node.isOperator),
1535 cloneToken(node.notOperator),
1536 cloneNode(node.type));
1383 1537
1384 @override 1538 @override
1385 Label visitLabel(Label node) => 1539 Label visitLabel(Label node) =>
1386 new Label(cloneNode(node.label), cloneToken(node.colon)); 1540 new Label(cloneNode(node.label), cloneToken(node.colon));
1387 1541
1388 @override 1542 @override
1389 LabeledStatement visitLabeledStatement(LabeledStatement node) => 1543 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
1390 new LabeledStatement( 1544 new LabeledStatement(
1391 cloneNodeList(node.labels), cloneNode(node.statement)); 1545 cloneNodeList(node.labels), cloneNode(node.statement));
1392 1546
1393 @override 1547 @override
1394 LibraryDirective visitLibraryDirective(LibraryDirective node) => 1548 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
1395 new LibraryDirective(cloneNode(node.documentationComment), 1549 new LibraryDirective(
1396 cloneNodeList(node.metadata), cloneToken(node.libraryKeyword), 1550 cloneNode(node.documentationComment),
1397 cloneNode(node.name), cloneToken(node.semicolon)); 1551 cloneNodeList(node.metadata),
1552 cloneToken(node.libraryKeyword),
1553 cloneNode(node.name),
1554 cloneToken(node.semicolon));
1398 1555
1399 @override 1556 @override
1400 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => 1557 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
1401 new LibraryIdentifier(cloneNodeList(node.components)); 1558 new LibraryIdentifier(cloneNodeList(node.components));
1402 1559
1403 @override 1560 @override
1404 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral( 1561 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(
1405 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1562 cloneToken(node.constKeyword),
1406 cloneToken(node.leftBracket), cloneNodeList(node.elements), 1563 cloneNode(node.typeArguments),
1564 cloneToken(node.leftBracket),
1565 cloneNodeList(node.elements),
1407 cloneToken(node.rightBracket)); 1566 cloneToken(node.rightBracket));
1408 1567
1409 @override 1568 @override
1410 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral( 1569 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(
1411 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1570 cloneToken(node.constKeyword),
1412 cloneToken(node.leftBracket), cloneNodeList(node.entries), 1571 cloneNode(node.typeArguments),
1572 cloneToken(node.leftBracket),
1573 cloneNodeList(node.entries),
1413 cloneToken(node.rightBracket)); 1574 cloneToken(node.rightBracket));
1414 1575
1415 @override 1576 @override
1416 MapLiteralEntry visitMapLiteralEntry( 1577 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
1417 MapLiteralEntry node) => new MapLiteralEntry( 1578 new MapLiteralEntry(cloneNode(node.key), cloneToken(node.separator),
1418 cloneNode(node.key), cloneToken(node.separator), cloneNode(node.value)); 1579 cloneNode(node.value));
1419 1580
1420 @override 1581 @override
1421 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 1582 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
1422 new MethodDeclaration(cloneNode(node.documentationComment), 1583 new MethodDeclaration(
1423 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1584 cloneNode(node.documentationComment),
1424 cloneToken(node.modifierKeyword), cloneNode(node.returnType), 1585 cloneNodeList(node.metadata),
1425 cloneToken(node.propertyKeyword), cloneToken(node.operatorKeyword), 1586 cloneToken(node.externalKeyword),
1426 cloneNode(node.name), cloneNode(node.typeParameters), 1587 cloneToken(node.modifierKeyword),
1427 cloneNode(node.parameters), cloneNode(node.body)); 1588 cloneNode(node.returnType),
1589 cloneToken(node.propertyKeyword),
1590 cloneToken(node.operatorKeyword),
1591 cloneNode(node.name),
1592 cloneNode(node.typeParameters),
1593 cloneNode(node.parameters),
1594 cloneNode(node.body));
1428 1595
1429 @override 1596 @override
1430 MethodInvocation visitMethodInvocation(MethodInvocation node) => 1597 MethodInvocation visitMethodInvocation(MethodInvocation node) =>
1431 new MethodInvocation(cloneNode(node.target), cloneToken(node.operator), 1598 new MethodInvocation(
1432 cloneNode(node.methodName), cloneNode(node.typeArguments), 1599 cloneNode(node.target),
1600 cloneToken(node.operator),
1601 cloneNode(node.methodName),
1602 cloneNode(node.typeArguments),
1433 cloneNode(node.argumentList)); 1603 cloneNode(node.argumentList));
1434 1604
1435 @override 1605 @override
1436 NamedExpression visitNamedExpression(NamedExpression node) => 1606 NamedExpression visitNamedExpression(NamedExpression node) =>
1437 new NamedExpression(cloneNode(node.name), cloneNode(node.expression)); 1607 new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
1438 1608
1439 @override 1609 @override
1440 AstNode visitNativeClause(NativeClause node) => 1610 AstNode visitNativeClause(NativeClause node) =>
1441 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name)); 1611 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name));
1442 1612
1443 @override 1613 @override
1444 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => 1614 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
1445 new NativeFunctionBody(cloneToken(node.nativeKeyword), 1615 new NativeFunctionBody(cloneToken(node.nativeKeyword),
1446 cloneNode(node.stringLiteral), cloneToken(node.semicolon)); 1616 cloneNode(node.stringLiteral), cloneToken(node.semicolon));
1447 1617
1448 @override 1618 @override
1449 NullLiteral visitNullLiteral(NullLiteral node) => 1619 NullLiteral visitNullLiteral(NullLiteral node) =>
1450 new NullLiteral(cloneToken(node.literal)); 1620 new NullLiteral(cloneToken(node.literal));
1451 1621
1452 @override 1622 @override
1453 ParenthesizedExpression visitParenthesizedExpression( 1623 ParenthesizedExpression visitParenthesizedExpression(
1454 ParenthesizedExpression node) => new ParenthesizedExpression( 1624 ParenthesizedExpression node) =>
1455 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1625 new ParenthesizedExpression(cloneToken(node.leftParenthesis),
1456 cloneToken(node.rightParenthesis)); 1626 cloneNode(node.expression), cloneToken(node.rightParenthesis));
1457 1627
1458 @override 1628 @override
1459 PartDirective visitPartDirective(PartDirective node) { 1629 PartDirective visitPartDirective(PartDirective node) {
1460 PartDirective directive = new PartDirective( 1630 PartDirective directive = new PartDirective(
1461 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1631 cloneNode(node.documentationComment),
1462 cloneToken(node.partKeyword), cloneNode(node.uri), 1632 cloneNodeList(node.metadata),
1633 cloneToken(node.partKeyword),
1634 cloneNode(node.uri),
1463 cloneToken(node.semicolon)); 1635 cloneToken(node.semicolon));
1464 directive.source = node.source; 1636 directive.source = node.source;
1465 directive.uriContent = node.uriContent; 1637 directive.uriContent = node.uriContent;
1466 return directive; 1638 return directive;
1467 } 1639 }
1468 1640
1469 @override 1641 @override
1470 PartOfDirective visitPartOfDirective(PartOfDirective node) => 1642 PartOfDirective visitPartOfDirective(PartOfDirective node) =>
1471 new PartOfDirective(cloneNode(node.documentationComment), 1643 new PartOfDirective(
1472 cloneNodeList(node.metadata), cloneToken(node.partKeyword), 1644 cloneNode(node.documentationComment),
1473 cloneToken(node.ofKeyword), cloneNode(node.libraryName), 1645 cloneNodeList(node.metadata),
1646 cloneToken(node.partKeyword),
1647 cloneToken(node.ofKeyword),
1648 cloneNode(node.libraryName),
1474 cloneToken(node.semicolon)); 1649 cloneToken(node.semicolon));
1475 1650
1476 @override 1651 @override
1477 PostfixExpression visitPostfixExpression(PostfixExpression node) => 1652 PostfixExpression visitPostfixExpression(PostfixExpression node) =>
1478 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator)); 1653 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator));
1479 1654
1480 @override 1655 @override
1481 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => 1656 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) =>
1482 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period), 1657 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period),
1483 cloneNode(node.identifier)); 1658 cloneNode(node.identifier));
1484 1659
1485 @override 1660 @override
1486 PrefixExpression visitPrefixExpression(PrefixExpression node) => 1661 PrefixExpression visitPrefixExpression(PrefixExpression node) =>
1487 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand)); 1662 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand));
1488 1663
1489 @override 1664 @override
1490 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( 1665 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
1491 cloneNode(node.target), cloneToken(node.operator), 1666 cloneNode(node.target),
1667 cloneToken(node.operator),
1492 cloneNode(node.propertyName)); 1668 cloneNode(node.propertyName));
1493 1669
1494 @override 1670 @override
1495 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 1671 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
1496 RedirectingConstructorInvocation node) => 1672 RedirectingConstructorInvocation node) =>
1497 new RedirectingConstructorInvocation(cloneToken(node.thisKeyword), 1673 new RedirectingConstructorInvocation(
1498 cloneToken(node.period), cloneNode(node.constructorName), 1674 cloneToken(node.thisKeyword),
1675 cloneToken(node.period),
1676 cloneNode(node.constructorName),
1499 cloneNode(node.argumentList)); 1677 cloneNode(node.argumentList));
1500 1678
1501 @override 1679 @override
1502 RethrowExpression visitRethrowExpression(RethrowExpression node) => 1680 RethrowExpression visitRethrowExpression(RethrowExpression node) =>
1503 new RethrowExpression(cloneToken(node.rethrowKeyword)); 1681 new RethrowExpression(cloneToken(node.rethrowKeyword));
1504 1682
1505 @override 1683 @override
1506 ReturnStatement visitReturnStatement(ReturnStatement node) => 1684 ReturnStatement visitReturnStatement(ReturnStatement node) =>
1507 new ReturnStatement(cloneToken(node.returnKeyword), 1685 new ReturnStatement(cloneToken(node.returnKeyword),
1508 cloneNode(node.expression), cloneToken(node.semicolon)); 1686 cloneNode(node.expression), cloneToken(node.semicolon));
1509 1687
1510 @override 1688 @override
1511 ScriptTag visitScriptTag(ScriptTag node) => 1689 ScriptTag visitScriptTag(ScriptTag node) =>
1512 new ScriptTag(cloneToken(node.scriptTag)); 1690 new ScriptTag(cloneToken(node.scriptTag));
1513 1691
1514 @override 1692 @override
1515 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 1693 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
1516 cloneToken(node.keyword), cloneNodeList(node.shownNames)); 1694 cloneToken(node.keyword), cloneNodeList(node.shownNames));
1517 1695
1518 @override 1696 @override
1519 SimpleFormalParameter visitSimpleFormalParameter( 1697 SimpleFormalParameter visitSimpleFormalParameter(
1520 SimpleFormalParameter node) => new SimpleFormalParameter( 1698 SimpleFormalParameter node) =>
1521 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1699 new SimpleFormalParameter(
1522 cloneToken(node.keyword), cloneNode(node.type), 1700 cloneNode(node.documentationComment),
1523 cloneNode(node.identifier)); 1701 cloneNodeList(node.metadata),
1702 cloneToken(node.keyword),
1703 cloneNode(node.type),
1704 cloneNode(node.identifier));
1524 1705
1525 @override 1706 @override
1526 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => 1707 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
1527 new SimpleIdentifier(cloneToken(node.token)); 1708 new SimpleIdentifier(cloneToken(node.token));
1528 1709
1529 @override 1710 @override
1530 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => 1711 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) =>
1531 new SimpleStringLiteral(cloneToken(node.literal), node.value); 1712 new SimpleStringLiteral(cloneToken(node.literal), node.value);
1532 1713
1533 @override 1714 @override
1534 StringInterpolation visitStringInterpolation(StringInterpolation node) => 1715 StringInterpolation visitStringInterpolation(StringInterpolation node) =>
1535 new StringInterpolation(cloneNodeList(node.elements)); 1716 new StringInterpolation(cloneNodeList(node.elements));
1536 1717
1537 @override 1718 @override
1538 SuperConstructorInvocation visitSuperConstructorInvocation( 1719 SuperConstructorInvocation visitSuperConstructorInvocation(
1539 SuperConstructorInvocation node) => new SuperConstructorInvocation( 1720 SuperConstructorInvocation node) =>
1540 cloneToken(node.superKeyword), cloneToken(node.period), 1721 new SuperConstructorInvocation(
1541 cloneNode(node.constructorName), cloneNode(node.argumentList)); 1722 cloneToken(node.superKeyword),
1723 cloneToken(node.period),
1724 cloneNode(node.constructorName),
1725 cloneNode(node.argumentList));
1542 1726
1543 @override 1727 @override
1544 SuperExpression visitSuperExpression(SuperExpression node) => 1728 SuperExpression visitSuperExpression(SuperExpression node) =>
1545 new SuperExpression(cloneToken(node.superKeyword)); 1729 new SuperExpression(cloneToken(node.superKeyword));
1546 1730
1547 @override 1731 @override
1548 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 1732 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
1549 cloneNodeList(node.labels), cloneToken(node.keyword), 1733 cloneNodeList(node.labels),
1550 cloneNode(node.expression), cloneToken(node.colon), 1734 cloneToken(node.keyword),
1735 cloneNode(node.expression),
1736 cloneToken(node.colon),
1551 cloneNodeList(node.statements)); 1737 cloneNodeList(node.statements));
1552 1738
1553 @override 1739 @override
1554 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 1740 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
1555 cloneNodeList(node.labels), cloneToken(node.keyword), 1741 cloneNodeList(node.labels),
1556 cloneToken(node.colon), cloneNodeList(node.statements)); 1742 cloneToken(node.keyword),
1743 cloneToken(node.colon),
1744 cloneNodeList(node.statements));
1557 1745
1558 @override 1746 @override
1559 SwitchStatement visitSwitchStatement(SwitchStatement node) => 1747 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
1560 new SwitchStatement(cloneToken(node.switchKeyword), 1748 new SwitchStatement(
1561 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1749 cloneToken(node.switchKeyword),
1562 cloneToken(node.rightParenthesis), cloneToken(node.leftBracket), 1750 cloneToken(node.leftParenthesis),
1563 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1751 cloneNode(node.expression),
1752 cloneToken(node.rightParenthesis),
1753 cloneToken(node.leftBracket),
1754 cloneNodeList(node.members),
1755 cloneToken(node.rightBracket));
1564 1756
1565 @override 1757 @override
1566 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral( 1758 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(
1567 cloneToken(node.poundSign), cloneTokenList(node.components)); 1759 cloneToken(node.poundSign), cloneTokenList(node.components));
1568 1760
1569 @override 1761 @override
1570 ThisExpression visitThisExpression(ThisExpression node) => 1762 ThisExpression visitThisExpression(ThisExpression node) =>
1571 new ThisExpression(cloneToken(node.thisKeyword)); 1763 new ThisExpression(cloneToken(node.thisKeyword));
1572 1764
1573 @override 1765 @override
1574 ThrowExpression visitThrowExpression(ThrowExpression node) => 1766 ThrowExpression visitThrowExpression(ThrowExpression node) =>
1575 new ThrowExpression( 1767 new ThrowExpression(
1576 cloneToken(node.throwKeyword), cloneNode(node.expression)); 1768 cloneToken(node.throwKeyword), cloneNode(node.expression));
1577 1769
1578 @override 1770 @override
1579 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 1771 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
1580 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 1772 TopLevelVariableDeclaration node) =>
1581 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1773 new TopLevelVariableDeclaration(
1582 cloneNode(node.variables), cloneToken(node.semicolon)); 1774 cloneNode(node.documentationComment),
1775 cloneNodeList(node.metadata),
1776 cloneNode(node.variables),
1777 cloneToken(node.semicolon));
1583 1778
1584 @override 1779 @override
1585 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 1780 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
1586 cloneToken(node.tryKeyword), cloneNode(node.body), 1781 cloneToken(node.tryKeyword),
1587 cloneNodeList(node.catchClauses), cloneToken(node.finallyKeyword), 1782 cloneNode(node.body),
1783 cloneNodeList(node.catchClauses),
1784 cloneToken(node.finallyKeyword),
1588 cloneNode(node.finallyBlock)); 1785 cloneNode(node.finallyBlock));
1589 1786
1590 @override 1787 @override
1591 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 1788 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
1592 new TypeArgumentList(cloneToken(node.leftBracket), 1789 new TypeArgumentList(cloneToken(node.leftBracket),
1593 cloneNodeList(node.arguments), cloneToken(node.rightBracket)); 1790 cloneNodeList(node.arguments), cloneToken(node.rightBracket));
1594 1791
1595 @override 1792 @override
1596 TypeName visitTypeName(TypeName node) => 1793 TypeName visitTypeName(TypeName node) =>
1597 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments)); 1794 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
1598 1795
1599 @override 1796 @override
1600 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 1797 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
1601 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1798 cloneNode(node.documentationComment),
1602 cloneNode(node.name), cloneToken(node.extendsKeyword), 1799 cloneNodeList(node.metadata),
1800 cloneNode(node.name),
1801 cloneToken(node.extendsKeyword),
1603 cloneNode(node.bound)); 1802 cloneNode(node.bound));
1604 1803
1605 @override 1804 @override
1606 TypeParameterList visitTypeParameterList(TypeParameterList node) => 1805 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
1607 new TypeParameterList(cloneToken(node.leftBracket), 1806 new TypeParameterList(cloneToken(node.leftBracket),
1608 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); 1807 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket));
1609 1808
1610 @override 1809 @override
1611 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 1810 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
1612 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals), 1811 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals),
1613 cloneNode(node.initializer)); 1812 cloneNode(node.initializer));
1614 1813
1615 @override 1814 @override
1616 VariableDeclarationList visitVariableDeclarationList( 1815 VariableDeclarationList visitVariableDeclarationList(
1617 VariableDeclarationList node) => new VariableDeclarationList( 1816 VariableDeclarationList node) =>
1618 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1817 new VariableDeclarationList(
1619 cloneToken(node.keyword), cloneNode(node.type), 1818 cloneNode(node.documentationComment),
1620 cloneNodeList(node.variables)); 1819 cloneNodeList(node.metadata),
1820 cloneToken(node.keyword),
1821 cloneNode(node.type),
1822 cloneNodeList(node.variables));
1621 1823
1622 @override 1824 @override
1623 VariableDeclarationStatement visitVariableDeclarationStatement( 1825 VariableDeclarationStatement visitVariableDeclarationStatement(
1624 VariableDeclarationStatement node) => new VariableDeclarationStatement( 1826 VariableDeclarationStatement node) =>
1625 cloneNode(node.variables), cloneToken(node.semicolon)); 1827 new VariableDeclarationStatement(
1828 cloneNode(node.variables), cloneToken(node.semicolon));
1626 1829
1627 @override 1830 @override
1628 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 1831 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
1629 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1832 cloneToken(node.whileKeyword),
1630 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1833 cloneToken(node.leftParenthesis),
1834 cloneNode(node.condition),
1835 cloneToken(node.rightParenthesis),
1631 cloneNode(node.body)); 1836 cloneNode(node.body));
1632 1837
1633 @override 1838 @override
1634 WithClause visitWithClause(WithClause node) => new WithClause( 1839 WithClause visitWithClause(WithClause node) => new WithClause(
1635 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes)); 1840 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes));
1636 1841
1637 @override 1842 @override
1638 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 1843 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
1639 cloneToken(node.yieldKeyword), cloneToken(node.star), 1844 cloneToken(node.yieldKeyword),
1640 cloneNode(node.expression), cloneToken(node.semicolon)); 1845 cloneToken(node.star),
1846 cloneNode(node.expression),
1847 cloneToken(node.semicolon));
1641 1848
1642 /** 1849 /**
1643 * Return a clone of the given [node]. 1850 * Return a clone of the given [node].
1644 */ 1851 */
1645 static AstNode clone(AstNode node) { 1852 static AstNode clone(AstNode node) {
1646 return node.accept(new AstCloner()); 1853 return node.accept(new AstCloner());
1647 } 1854 }
1648 } 1855 }
1649 1856
1650 /** 1857 /**
(...skipping 78 matching lines...)
1729 isEqualTokens(node.asOperator, other.asOperator) && 1936 isEqualTokens(node.asOperator, other.asOperator) &&
1730 isEqualNodes(node.type, other.type); 1937 isEqualNodes(node.type, other.type);
1731 } 1938 }
1732 1939
1733 @override 1940 @override
1734 bool visitAssertStatement(AssertStatement node) { 1941 bool visitAssertStatement(AssertStatement node) {
1735 AssertStatement other = _other as AssertStatement; 1942 AssertStatement other = _other as AssertStatement;
1736 return isEqualTokens(node.assertKeyword, other.assertKeyword) && 1943 return isEqualTokens(node.assertKeyword, other.assertKeyword) &&
1737 isEqualTokens(node.leftParenthesis, other.leftParenthesis) && 1944 isEqualTokens(node.leftParenthesis, other.leftParenthesis) &&
1738 isEqualNodes(node.condition, other.condition) && 1945 isEqualNodes(node.condition, other.condition) &&
1946 isEqualTokens(node.comma, other.comma) &&
1947 isEqualNodes(node.message, other.message) &&
1739 isEqualTokens(node.rightParenthesis, other.rightParenthesis) && 1948 isEqualTokens(node.rightParenthesis, other.rightParenthesis) &&
1740 isEqualTokens(node.semicolon, other.semicolon); 1949 isEqualTokens(node.semicolon, other.semicolon);
1741 } 1950 }
1742 1951
1743 @override 1952 @override
1744 bool visitAssignmentExpression(AssignmentExpression node) { 1953 bool visitAssignmentExpression(AssignmentExpression node) {
1745 AssignmentExpression other = _other as AssignmentExpression; 1954 AssignmentExpression other = _other as AssignmentExpression;
1746 return isEqualNodes(node.leftHandSide, other.leftHandSide) && 1955 return isEqualNodes(node.leftHandSide, other.leftHandSide) &&
1747 isEqualTokens(node.operator, other.operator) && 1956 isEqualTokens(node.operator, other.operator) &&
1748 isEqualNodes(node.rightHandSide, other.rightHandSide); 1957 isEqualNodes(node.rightHandSide, other.rightHandSide);
(...skipping 970 matching lines...)
2719 */ 2928 */
2720 static const List<AstNode> EMPTY_LIST = const <AstNode>[]; 2929 static const List<AstNode> EMPTY_LIST = const <AstNode>[];
2721 2930
2722 /** 2931 /**
2723 * A comparator that can be used to sort AST nodes in lexical order. In other 2932 * 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 2933 * 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 2934 * 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 2935 * the same offset, and a positive value if the offset of the first node is
2727 * greater than the offset of the second node. 2936 * greater than the offset of the second node.
2728 */ 2937 */
2729 static Comparator<AstNode> LEXICAL_ORDER = 2938 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) =>
2730 (AstNode first, AstNode second) => first.offset - second.offset; 2939 first.offset - second.offset;
2731 2940
2732 /** 2941 /**
2733 * The parent of the node, or `null` if the node is the root of an AST 2942 * The parent of the node, or `null` if the node is the root of an AST
2734 * structure. 2943 * structure.
2735 */ 2944 */
2736 AstNode _parent; 2945 AstNode _parent;
2737 2946
2738 /** 2947 /**
2739 * A table mapping the names of properties to their values, or `null` if this 2948 * A table mapping the names of properties to their values, or `null` if this
2740 * node does not have any properties associated with it. 2949 * node does not have any properties associated with it.
(...skipping 1103 matching lines...)
3844 * The body of the catch block. 4053 * The body of the catch block.
3845 */ 4054 */
3846 Block _body; 4055 Block _body;
3847 4056
3848 /** 4057 /**
3849 * Initialize a newly created catch clause. The [onKeyword] and 4058 * Initialize a newly created catch clause. The [onKeyword] and
3850 * [exceptionType] can be `null` if the clause will catch all exceptions. The 4059 * [exceptionType] can be `null` if the clause will catch all exceptions. The
3851 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not 4060 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not
3852 * referencable within the body. 4061 * referencable within the body.
3853 */ 4062 */
3854 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, 4063 CatchClause(
3855 this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, 4064 this.onKeyword,
3856 SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) { 4065 TypeName exceptionType,
4066 this.catchKeyword,
4067 this.leftParenthesis,
4068 SimpleIdentifier exceptionParameter,
4069 this.comma,
4070 SimpleIdentifier stackTraceParameter,
4071 this.rightParenthesis,
4072 Block body) {
3857 _exceptionType = _becomeParentOf(exceptionType); 4073 _exceptionType = _becomeParentOf(exceptionType);
3858 _exceptionParameter = _becomeParentOf(exceptionParameter); 4074 _exceptionParameter = _becomeParentOf(exceptionParameter);
3859 _stackTraceParameter = _becomeParentOf(stackTraceParameter); 4075 _stackTraceParameter = _becomeParentOf(stackTraceParameter);
3860 _body = _becomeParentOf(body); 4076 _body = _becomeParentOf(body);
3861 } 4077 }
3862 4078
3863 @override 4079 @override
3864 Token get beginToken { 4080 Token get beginToken {
3865 if (onKeyword != null) { 4081 if (onKeyword != null) {
3866 return onKeyword; 4082 return onKeyword;
(...skipping 182 matching lines...)
4049 /** 4265 /**
4050 * Initialize a newly created class declaration. Either or both of the 4266 * Initialize a newly created class declaration. Either or both of the
4051 * [comment] and [metadata] can be `null` if the class does not have the 4267 * [comment] and [metadata] can be `null` if the class does not have the
4052 * corresponding attribute. The [abstractKeyword] can be `null` if the class 4268 * corresponding attribute. The [abstractKeyword] can be `null` if the class
4053 * is not abstract. The [typeParameters] can be `null` if the class does not 4269 * is not abstract. The [typeParameters] can be `null` if the class does not
4054 * have any type parameters. Any or all of the [extendsClause], [withClause], 4270 * have any type parameters. Any or all of the [extendsClause], [withClause],
4055 * and [implementsClause] can be `null` if the class does not have the 4271 * and [implementsClause] can be `null` if the class does not have the
4056 * corresponding clause. The list of [members] can be `null` if the class does 4272 * corresponding clause. The list of [members] can be `null` if the class does
4057 * not have any members. 4273 * not have any members.
4058 */ 4274 */
4059 ClassDeclaration(Comment comment, List<Annotation> metadata, 4275 ClassDeclaration(
4060 this.abstractKeyword, this.classKeyword, SimpleIdentifier name, 4276 Comment comment,
4061 TypeParameterList typeParameters, ExtendsClause extendsClause, 4277 List<Annotation> metadata,
4062 WithClause withClause, ImplementsClause implementsClause, 4278 this.abstractKeyword,
4063 this.leftBracket, List<ClassMember> members, this.rightBracket) 4279 this.classKeyword,
4280 SimpleIdentifier name,
4281 TypeParameterList typeParameters,
4282 ExtendsClause extendsClause,
4283 WithClause withClause,
4284 ImplementsClause implementsClause,
4285 this.leftBracket,
4286 List<ClassMember> members,
4287 this.rightBracket)
4064 : super(comment, metadata, name) { 4288 : super(comment, metadata, name) {
4065 _typeParameters = _becomeParentOf(typeParameters); 4289 _typeParameters = _becomeParentOf(typeParameters);
4066 _extendsClause = _becomeParentOf(extendsClause); 4290 _extendsClause = _becomeParentOf(extendsClause);
4067 _withClause = _becomeParentOf(withClause); 4291 _withClause = _becomeParentOf(withClause);
4068 _implementsClause = _becomeParentOf(implementsClause); 4292 _implementsClause = _becomeParentOf(implementsClause);
4069 _members = new NodeList<ClassMember>(this, members); 4293 _members = new NodeList<ClassMember>(this, members);
4070 } 4294 }
4071 4295
4072 @override 4296 @override
4073 Iterable get childEntities => super._childEntities 4297 Iterable get childEntities => super._childEntities
(...skipping 231 matching lines...)
4305 ImplementsClause _implementsClause; 4529 ImplementsClause _implementsClause;
4306 4530
4307 /** 4531 /**
4308 * Initialize a newly created class type alias. Either or both of the 4532 * Initialize a newly created class type alias. Either or both of the
4309 * [comment] and [metadata] can be `null` if the class type alias does not 4533 * [comment] and [metadata] can be `null` if the class type alias does not
4310 * have the corresponding attribute. The [typeParameters] can be `null` if the 4534 * have the corresponding attribute. The [typeParameters] can be `null` if the
4311 * class does not have any type parameters. The [abstractKeyword] can be 4535 * class does not have any type parameters. The [abstractKeyword] can be
4312 * `null` if the class is not abstract. The [implementsClause] can be `null` 4536 * `null` if the class is not abstract. The [implementsClause] can be `null`
4313 * if the class does not implement any interfaces. 4537 * if the class does not implement any interfaces.
4314 */ 4538 */
4315 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 4539 ClassTypeAlias(
4316 SimpleIdentifier name, TypeParameterList typeParameters, this.equals, 4540 Comment comment,
4317 this.abstractKeyword, TypeName superclass, WithClause withClause, 4541 List<Annotation> metadata,
4318 ImplementsClause implementsClause, Token semicolon) 4542 Token keyword,
4543 SimpleIdentifier name,
4544 TypeParameterList typeParameters,
4545 this.equals,
4546 this.abstractKeyword,
4547 TypeName superclass,
4548 WithClause withClause,
4549 ImplementsClause implementsClause,
4550 Token semicolon)
4319 : super(comment, metadata, keyword, name, semicolon) { 4551 : super(comment, metadata, keyword, name, semicolon) {
4320 _typeParameters = _becomeParentOf(typeParameters); 4552 _typeParameters = _becomeParentOf(typeParameters);
4321 _superclass = _becomeParentOf(superclass); 4553 _superclass = _becomeParentOf(superclass);
4322 _withClause = _becomeParentOf(withClause); 4554 _withClause = _becomeParentOf(withClause);
4323 _implementsClause = _becomeParentOf(implementsClause); 4555 _implementsClause = _becomeParentOf(implementsClause);
4324 } 4556 }
4325 4557
4326 @override 4558 @override
4327 Iterable get childEntities => super._childEntities 4559 Iterable get childEntities => super._childEntities
4328 ..add(typedefKeyword) 4560 ..add(typedefKeyword)
(...skipping 366 matching lines...)
4695 */ 4927 */
4696 LineInfo lineInfo; 4928 LineInfo lineInfo;
4697 4929
4698 /** 4930 /**
4699 * Initialize a newly created compilation unit to have the given directives 4931 * Initialize a newly created compilation unit to have the given directives
4700 * and declarations. The [scriptTag] can be `null` if there is no script tag 4932 * and declarations. The [scriptTag] can be `null` if there is no script tag
4701 * in the compilation unit. The list of [directives] can be `null` if there 4933 * in the compilation unit. The list of [directives] can be `null` if there
4702 * are no directives in the compilation unit. The list of [declarations] can 4934 * are no directives in the compilation unit. The list of [declarations] can
4703 * be `null` if there are no declarations in the compilation unit. 4935 * be `null` if there are no declarations in the compilation unit.
4704 */ 4936 */
4705 CompilationUnit(this.beginToken, ScriptTag scriptTag, 4937 CompilationUnit(
4706 List<Directive> directives, List<CompilationUnitMember> declarations, 4938 this.beginToken,
4939 ScriptTag scriptTag,
4940 List<Directive> directives,
4941 List<CompilationUnitMember> declarations,
4707 this.endToken) { 4942 this.endToken) {
4708 _scriptTag = _becomeParentOf(scriptTag); 4943 _scriptTag = _becomeParentOf(scriptTag);
4709 _directives = new NodeList<Directive>(this, directives); 4944 _directives = new NodeList<Directive>(this, directives);
4710 _declarations = new NodeList<CompilationUnitMember>(this, declarations); 4945 _declarations = new NodeList<CompilationUnitMember>(this, declarations);
4711 } 4946 }
4712 4947
4713 @override 4948 @override
4714 Iterable get childEntities { 4949 Iterable get childEntities {
4715 ChildEntities result = new ChildEntities()..add(_scriptTag); 4950 ChildEntities result = new ChildEntities()..add(_scriptTag);
4716 if (_directivesAreBeforeDeclarations) { 4951 if (_directivesAreBeforeDeclarations) {
(...skipping 650 matching lines...)
5367 * constructor cannot be used to create a constant. The [factoryKeyword] can 5602 * constructor cannot be used to create a constant. The [factoryKeyword] can
5368 * be `null` if the constructor is not a factory. The [period] and [name] can 5603 * be `null` if the constructor is not a factory. The [period] and [name] can
5369 * both be `null` if the constructor is not a named constructor. The 5604 * both be `null` if the constructor is not a named constructor. The
5370 * [separator] can be `null` if the constructor does not have any initializers 5605 * [separator] can be `null` if the constructor does not have any initializers
5371 * and does not redirect to a different constructor. The list of 5606 * and does not redirect to a different constructor. The list of
5372 * [initializers] can be `null` if the constructor does not have any 5607 * [initializers] can be `null` if the constructor does not have any
5373 * initializers. The [redirectedConstructor] can be `null` if the constructor 5608 * initializers. The [redirectedConstructor] can be `null` if the constructor
5374 * does not redirect to a different constructor. The [body] can be `null` if 5609 * does not redirect to a different constructor. The [body] can be `null` if
5375 * the constructor does not have a body. 5610 * the constructor does not have a body.
5376 */ 5611 */
5377 ConstructorDeclaration(Comment comment, List<Annotation> metadata, 5612 ConstructorDeclaration(
5378 this.externalKeyword, this.constKeyword, this.factoryKeyword, 5613 Comment comment,
5379 Identifier returnType, this.period, SimpleIdentifier name, 5614 List<Annotation> metadata,
5380 FormalParameterList parameters, this.separator, 5615 this.externalKeyword,
5616 this.constKeyword,
5617 this.factoryKeyword,
5618 Identifier returnType,
5619 this.period,
5620 SimpleIdentifier name,
5621 FormalParameterList parameters,
5622 this.separator,
5381 List<ConstructorInitializer> initializers, 5623 List<ConstructorInitializer> initializers,
5382 ConstructorName redirectedConstructor, FunctionBody body) 5624 ConstructorName redirectedConstructor,
5625 FunctionBody body)
5383 : super(comment, metadata) { 5626 : super(comment, metadata) {
5384 _returnType = _becomeParentOf(returnType); 5627 _returnType = _becomeParentOf(returnType);
5385 _name = _becomeParentOf(name); 5628 _name = _becomeParentOf(name);
5386 _parameters = _becomeParentOf(parameters); 5629 _parameters = _becomeParentOf(parameters);
5387 _initializers = new NodeList<ConstructorInitializer>(this, initializers); 5630 _initializers = new NodeList<ConstructorInitializer>(this, initializers);
5388 _redirectedConstructor = _becomeParentOf(redirectedConstructor); 5631 _redirectedConstructor = _becomeParentOf(redirectedConstructor);
5389 _body = _becomeParentOf(body); 5632 _body = _becomeParentOf(body);
5390 } 5633 }
5391 5634
5392 /** 5635 /**
(...skipping 760 matching lines...)
6153 Token rightParenthesis; 6396 Token rightParenthesis;
6154 6397
6155 /** 6398 /**
6156 * The semicolon terminating the statement. 6399 * The semicolon terminating the statement.
6157 */ 6400 */
6158 Token semicolon; 6401 Token semicolon;
6159 6402
6160 /** 6403 /**
6161 * Initialize a newly created do loop. 6404 * Initialize a newly created do loop.
6162 */ 6405 */
6163 DoStatement(this.doKeyword, Statement body, this.whileKeyword, 6406 DoStatement(
6164 this.leftParenthesis, Expression condition, this.rightParenthesis, 6407 this.doKeyword,
6408 Statement body,
6409 this.whileKeyword,
6410 this.leftParenthesis,
6411 Expression condition,
6412 this.rightParenthesis,
6165 this.semicolon) { 6413 this.semicolon) {
6166 _body = _becomeParentOf(body); 6414 _body = _becomeParentOf(body);
6167 _condition = _becomeParentOf(condition); 6415 _condition = _becomeParentOf(condition);
6168 } 6416 }
6169 6417
6170 @override 6418 @override
6171 Token get beginToken => doKeyword; 6419 Token get beginToken => doKeyword;
6172 6420
6173 /** 6421 /**
6174 * Return the body of the loop. 6422 * Return the body of the loop.
(...skipping 385 matching lines...)
6560 * The right curly bracket. 6808 * The right curly bracket.
6561 */ 6809 */
6562 Token rightBracket; 6810 Token rightBracket;
6563 6811
6564 /** 6812 /**
6565 * Initialize a newly created enumeration declaration. Either or both of the 6813 * Initialize a newly created enumeration declaration. Either or both of the
6566 * [comment] and [metadata] can be `null` if the declaration does not have the 6814 * [comment] and [metadata] can be `null` if the declaration does not have the
6567 * corresponding attribute. The list of [constants] must contain at least one 6815 * corresponding attribute. The list of [constants] must contain at least one
6568 * value. 6816 * value.
6569 */ 6817 */
6570 EnumDeclaration(Comment comment, List<Annotation> metadata, this.enumKeyword, 6818 EnumDeclaration(
6571 SimpleIdentifier name, this.leftBracket, 6819 Comment comment,
6572 List<EnumConstantDeclaration> constants, this.rightBracket) 6820 List<Annotation> metadata,
6821 this.enumKeyword,
6822 SimpleIdentifier name,
6823 this.leftBracket,
6824 List<EnumConstantDeclaration> constants,
6825 this.rightBracket)
6573 : super(comment, metadata, name) { 6826 : super(comment, metadata, name) {
6574 _constants = new NodeList<EnumConstantDeclaration>(this, constants); 6827 _constants = new NodeList<EnumConstantDeclaration>(this, constants);
6575 } 6828 }
6576 6829
6577 @override 6830 @override
6578 // TODO(brianwilkerson) Add commas? 6831 // TODO(brianwilkerson) Add commas?
6579 Iterable get childEntities => super._childEntities 6832 Iterable get childEntities => super._childEntities
6580 ..add(enumKeyword) 6833 ..add(enumKeyword)
6581 ..add(_name) 6834 ..add(_name)
6582 ..add(leftBracket) 6835 ..add(leftBracket)
(...skipping 594 matching lines...)
7177 7430
7178 /** 7431 /**
7179 * Initialize a newly created formal parameter. Either or both of the 7432 * Initialize a newly created formal parameter. Either or both of the
7180 * [comment] and [metadata] can be `null` if the parameter does not have the 7433 * [comment] and [metadata] can be `null` if the parameter does not have the
7181 * corresponding attribute. The [keyword] can be `null` if there is a type. 7434 * corresponding attribute. The [keyword] can be `null` if there is a type.
7182 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and 7435 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
7183 * [period] can be `null` if the keyword 'this' was not provided. The 7436 * [period] can be `null` if the keyword 'this' was not provided. The
7184 * [parameters] can be `null` if this is not a function-typed field formal 7437 * [parameters] can be `null` if this is not a function-typed field formal
7185 * parameter. 7438 * parameter.
7186 */ 7439 */
7187 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, 7440 FieldFormalParameter(
7188 TypeName type, this.thisKeyword, this.period, SimpleIdentifier identifier, 7441 Comment comment,
7189 TypeParameterList typeParameters, FormalParameterList parameters) 7442 List<Annotation> metadata,
7443 this.keyword,
7444 TypeName type,
7445 this.thisKeyword,
7446 this.period,
7447 SimpleIdentifier identifier,
7448 TypeParameterList typeParameters,
7449 FormalParameterList parameters)
7190 : super(comment, metadata, identifier) { 7450 : super(comment, metadata, identifier) {
7191 _type = _becomeParentOf(type); 7451 _type = _becomeParentOf(type);
7192 _typeParameters = _becomeParentOf(typeParameters); 7452 _typeParameters = _becomeParentOf(typeParameters);
7193 _parameters = _becomeParentOf(parameters); 7453 _parameters = _becomeParentOf(parameters);
7194 } 7454 }
7195 7455
7196 @override 7456 @override
7197 Token get beginToken { 7457 Token get beginToken {
7198 if (keyword != null) { 7458 if (keyword != null) {
7199 return keyword; 7459 return keyword;
(...skipping 151 matching lines...)
7351 /** 7611 /**
7352 * The body of the loop. 7612 * The body of the loop.
7353 */ 7613 */
7354 Statement _body; 7614 Statement _body;
7355 7615
7356 /** 7616 /**
7357 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7617 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7358 * `null` if this is not an asynchronous for loop. 7618 * `null` if this is not an asynchronous for loop.
7359 */ 7619 */
7360 @deprecated // Use new ForEachStatement.withDeclaration(...) 7620 @deprecated // Use new ForEachStatement.withDeclaration(...)
7361 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, 7621 ForEachStatement.con1(
7362 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7622 this.awaitKeyword,
7363 Expression iterator, this.rightParenthesis, Statement body) { 7623 this.forKeyword,
7624 this.leftParenthesis,
7625 DeclaredIdentifier loopVariable,
7626 this.inKeyword,
7627 Expression iterator,
7628 this.rightParenthesis,
7629 Statement body) {
7364 _loopVariable = _becomeParentOf(loopVariable); 7630 _loopVariable = _becomeParentOf(loopVariable);
7365 _iterable = _becomeParentOf(iterator); 7631 _iterable = _becomeParentOf(iterator);
7366 _body = _becomeParentOf(body); 7632 _body = _becomeParentOf(body);
7367 } 7633 }
7368 7634
7369 /** 7635 /**
7370 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7636 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7371 * `null` if this is not an asynchronous for loop. 7637 * `null` if this is not an asynchronous for loop.
7372 */ 7638 */
7373 @deprecated // Use new ForEachStatement.withReference(...) 7639 @deprecated // Use new ForEachStatement.withReference(...)
7374 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, 7640 ForEachStatement.con2(
7375 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7641 this.awaitKeyword,
7376 Expression iterator, this.rightParenthesis, Statement body) { 7642 this.forKeyword,
7643 this.leftParenthesis,
7644 SimpleIdentifier identifier,
7645 this.inKeyword,
7646 Expression iterator,
7647 this.rightParenthesis,
7648 Statement body) {
7377 _identifier = _becomeParentOf(identifier); 7649 _identifier = _becomeParentOf(identifier);
7378 _iterable = _becomeParentOf(iterator); 7650 _iterable = _becomeParentOf(iterator);
7379 _body = _becomeParentOf(body); 7651 _body = _becomeParentOf(body);
7380 } 7652 }
7381 7653
7382 /** 7654 /**
7383 * Initialize a newly created for-each statement whose loop control variable 7655 * Initialize a newly created for-each statement whose loop control variable
7384 * is declared internally (in the for-loop part). The [awaitKeyword] can be 7656 * is declared internally (in the for-loop part). The [awaitKeyword] can be
7385 * `null` if this is not an asynchronous for loop. 7657 * `null` if this is not an asynchronous for loop.
7386 */ 7658 */
7387 ForEachStatement.withDeclaration(this.awaitKeyword, this.forKeyword, 7659 ForEachStatement.withDeclaration(
7388 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7660 this.awaitKeyword,
7389 Expression iterator, this.rightParenthesis, Statement body) { 7661 this.forKeyword,
7662 this.leftParenthesis,
7663 DeclaredIdentifier loopVariable,
7664 this.inKeyword,
7665 Expression iterator,
7666 this.rightParenthesis,
7667 Statement body) {
7390 _loopVariable = _becomeParentOf(loopVariable); 7668 _loopVariable = _becomeParentOf(loopVariable);
7391 _iterable = _becomeParentOf(iterator); 7669 _iterable = _becomeParentOf(iterator);
7392 _body = _becomeParentOf(body); 7670 _body = _becomeParentOf(body);
7393 } 7671 }
7394 7672
7395 /** 7673 /**
7396 * Initialize a newly created for-each statement whose loop control variable 7674 * Initialize a newly created for-each statement whose loop control variable
7397 * is declared outside the for loop. The [awaitKeyword] can be `null` if this 7675 * is declared outside the for loop. The [awaitKeyword] can be `null` if this
7398 * is not an asynchronous for loop. 7676 * is not an asynchronous for loop.
7399 */ 7677 */
7400 ForEachStatement.withReference(this.awaitKeyword, this.forKeyword, 7678 ForEachStatement.withReference(
7401 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7679 this.awaitKeyword,
7402 Expression iterator, this.rightParenthesis, Statement body) { 7680 this.forKeyword,
7681 this.leftParenthesis,
7682 SimpleIdentifier identifier,
7683 this.inKeyword,
7684 Expression iterator,
7685 this.rightParenthesis,
7686 Statement body) {
7403 _identifier = _becomeParentOf(identifier); 7687 _identifier = _becomeParentOf(identifier);
7404 _iterable = _becomeParentOf(iterator); 7688 _iterable = _becomeParentOf(iterator);
7405 _body = _becomeParentOf(body); 7689 _body = _becomeParentOf(body);
7406 } 7690 }
7407 7691
7408 @override 7692 @override
7409 Token get beginToken => forKeyword; 7693 Token get beginToken => forKeyword;
7410 7694
7411 /** 7695 /**
7412 * Return the body of the loop. 7696 * Return the body of the loop.
(...skipping 310 matching lines...)
7723 * The body of the loop. 8007 * The body of the loop.
7724 */ 8008 */
7725 Statement _body; 8009 Statement _body;
7726 8010
7727 /** 8011 /**
7728 * Initialize a newly created for statement. Either the [variableList] or the 8012 * Initialize a newly created for statement. Either the [variableList] or the
7729 * [initialization] must be `null`. Either the [condition] and the list of 8013 * [initialization] must be `null`. Either the [condition] and the list of
7730 * [updaters] can be `null` if the loop does not have the corresponding 8014 * [updaters] can be `null` if the loop does not have the corresponding
7731 * attribute. 8015 * attribute.
7732 */ 8016 */
7733 ForStatement(this.forKeyword, this.leftParenthesis, 8017 ForStatement(
7734 VariableDeclarationList variableList, Expression initialization, 8018 this.forKeyword,
7735 this.leftSeparator, Expression condition, this.rightSeparator, 8019 this.leftParenthesis,
7736 List<Expression> updaters, this.rightParenthesis, Statement body) { 8020 VariableDeclarationList variableList,
8021 Expression initialization,
8022 this.leftSeparator,
8023 Expression condition,
8024 this.rightSeparator,
8025 List<Expression> updaters,
8026 this.rightParenthesis,
8027 Statement body) {
7737 _variableList = _becomeParentOf(variableList); 8028 _variableList = _becomeParentOf(variableList);
7738 _initialization = _becomeParentOf(initialization); 8029 _initialization = _becomeParentOf(initialization);
7739 _condition = _becomeParentOf(condition); 8030 _condition = _becomeParentOf(condition);
7740 _updaters = new NodeList<Expression>(this, updaters); 8031 _updaters = new NodeList<Expression>(this, updaters);
7741 _body = _becomeParentOf(body); 8032 _body = _becomeParentOf(body);
7742 } 8033 }
7743 8034
7744 @override 8035 @override
7745 Token get beginToken => forKeyword; 8036 Token get beginToken => forKeyword;
7746 8037
(...skipping 154 matching lines...)
7901 FunctionExpression _functionExpression; 8192 FunctionExpression _functionExpression;
7902 8193
7903 /** 8194 /**
7904 * Initialize a newly created function declaration. Either or both of the 8195 * Initialize a newly created function declaration. Either or both of the
7905 * [comment] and [metadata] can be `null` if the function does not have the 8196 * [comment] and [metadata] can be `null` if the function does not have the
7906 * corresponding attribute. The [externalKeyword] can be `null` if the 8197 * corresponding attribute. The [externalKeyword] can be `null` if the
7907 * function is not an external function. The [returnType] can be `null` if no 8198 * function is not an external function. The [returnType] can be `null` if no
7908 * return type was specified. The [propertyKeyword] can be `null` if the 8199 * return type was specified. The [propertyKeyword] can be `null` if the
7909 * function is neither a getter or a setter. 8200 * function is neither a getter or a setter.
7910 */ 8201 */
7911 FunctionDeclaration(Comment comment, List<Annotation> metadata, 8202 FunctionDeclaration(
7912 this.externalKeyword, TypeName returnType, this.propertyKeyword, 8203 Comment comment,
7913 SimpleIdentifier name, FunctionExpression functionExpression) 8204 List<Annotation> metadata,
8205 this.externalKeyword,
8206 TypeName returnType,
8207 this.propertyKeyword,
8208 SimpleIdentifier name,
8209 FunctionExpression functionExpression)
7914 : super(comment, metadata, name) { 8210 : super(comment, metadata, name) {
7915 _returnType = _becomeParentOf(returnType); 8211 _returnType = _becomeParentOf(returnType);
7916 _functionExpression = _becomeParentOf(functionExpression); 8212 _functionExpression = _becomeParentOf(functionExpression);
7917 } 8213 }
7918 8214
7919 @override 8215 @override
7920 Iterable get childEntities => super._childEntities 8216 Iterable get childEntities => super._childEntities
7921 ..add(externalKeyword) 8217 ..add(externalKeyword)
7922 ..add(_returnType) 8218 ..add(_returnType)
7923 ..add(propertyKeyword) 8219 ..add(propertyKeyword)
(...skipping 395 matching lines...)
8319 */ 8615 */
8320 FormalParameterList _parameters; 8616 FormalParameterList _parameters;
8321 8617
8322 /** 8618 /**
8323 * Initialize a newly created function type alias. Either or both of the 8619 * Initialize a newly created function type alias. Either or both of the
8324 * [comment] and [metadata] can be `null` if the function does not have the 8620 * [comment] and [metadata] can be `null` if the function does not have the
8325 * corresponding attribute. The [returnType] can be `null` if no return type 8621 * corresponding attribute. The [returnType] can be `null` if no return type
8326 * was specified. The [typeParameters] can be `null` if the function has no 8622 * was specified. The [typeParameters] can be `null` if the function has no
8327 * type parameters. 8623 * type parameters.
8328 */ 8624 */
8329 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 8625 FunctionTypeAlias(
8330 TypeName returnType, SimpleIdentifier name, 8626 Comment comment,
8331 TypeParameterList typeParameters, FormalParameterList parameters, 8627 List<Annotation> metadata,
8628 Token keyword,
8629 TypeName returnType,
8630 SimpleIdentifier name,
8631 TypeParameterList typeParameters,
8632 FormalParameterList parameters,
8332 Token semicolon) 8633 Token semicolon)
8333 : super(comment, metadata, keyword, name, semicolon) { 8634 : super(comment, metadata, keyword, name, semicolon) {
8334 _returnType = _becomeParentOf(returnType); 8635 _returnType = _becomeParentOf(returnType);
8335 _typeParameters = _becomeParentOf(typeParameters); 8636 _typeParameters = _becomeParentOf(typeParameters);
8336 _parameters = _becomeParentOf(parameters); 8637 _parameters = _becomeParentOf(parameters);
8337 } 8638 }
8338 8639
8339 @override 8640 @override
8340 Iterable get childEntities => super._childEntities 8641 Iterable get childEntities => super._childEntities
8341 ..add(typedefKeyword) 8642 ..add(typedefKeyword)
(...skipping 84 matching lines...)
8426 * The parameters of the function-typed parameter. 8727 * The parameters of the function-typed parameter.
8427 */ 8728 */
8428 FormalParameterList _parameters; 8729 FormalParameterList _parameters;
8429 8730
8430 /** 8731 /**
8431 * Initialize a newly created formal parameter. Either or both of the 8732 * Initialize a newly created formal parameter. Either or both of the
8432 * [comment] and [metadata] can be `null` if the parameter does not have the 8733 * [comment] and [metadata] can be `null` if the parameter does not have the
8433 * corresponding attribute. The [returnType] can be `null` if no return type 8734 * corresponding attribute. The [returnType] can be `null` if no return type
8434 * was specified. 8735 * was specified.
8435 */ 8736 */
8436 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, 8737 FunctionTypedFormalParameter(
8437 TypeName returnType, SimpleIdentifier identifier, 8738 Comment comment,
8438 TypeParameterList typeParameters, FormalParameterList parameters) 8739 List<Annotation> metadata,
8740 TypeName returnType,
8741 SimpleIdentifier identifier,
8742 TypeParameterList typeParameters,
8743 FormalParameterList parameters)
8439 : super(comment, metadata, identifier) { 8744 : super(comment, metadata, identifier) {
8440 _returnType = _becomeParentOf(returnType); 8745 _returnType = _becomeParentOf(returnType);
8441 _typeParameters = _becomeParentOf(typeParameters); 8746 _typeParameters = _becomeParentOf(typeParameters);
8442 _parameters = _becomeParentOf(parameters); 8747 _parameters = _becomeParentOf(parameters);
8443 } 8748 }
8444 8749
8445 @override 8750 @override
8446 Token get beginToken { 8751 Token get beginToken {
8447 if (_returnType != null) { 8752 if (_returnType != null) {
8448 return _returnType.beginToken; 8753 return _returnType.beginToken;
(...skipping 636 matching lines...)
9085 /** 9390 /**
9086 * The statement that is executed if the condition evaluates to `false`, or 9391 * The statement that is executed if the condition evaluates to `false`, or
9087 * `null` if there is no else statement. 9392 * `null` if there is no else statement.
9088 */ 9393 */
9089 Statement _elseStatement; 9394 Statement _elseStatement;
9090 9395
9091 /** 9396 /**
9092 * Initialize a newly created if statement. The [elseKeyword] and 9397 * Initialize a newly created if statement. The [elseKeyword] and
9093 * [elseStatement] can be `null` if there is no else clause. 9398 * [elseStatement] can be `null` if there is no else clause.
9094 */ 9399 */
9095 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, 9400 IfStatement(
9096 this.rightParenthesis, Statement thenStatement, this.elseKeyword, 9401 this.ifKeyword,
9402 this.leftParenthesis,
9403 Expression condition,
9404 this.rightParenthesis,
9405 Statement thenStatement,
9406 this.elseKeyword,
9097 Statement elseStatement) { 9407 Statement elseStatement) {
9098 _condition = _becomeParentOf(condition); 9408 _condition = _becomeParentOf(condition);
9099 _thenStatement = _becomeParentOf(thenStatement); 9409 _thenStatement = _becomeParentOf(thenStatement);
9100 _elseStatement = _becomeParentOf(elseStatement); 9410 _elseStatement = _becomeParentOf(elseStatement);
9101 } 9411 }
9102 9412
9103 @override 9413 @override
9104 Token get beginToken => ifKeyword; 9414 Token get beginToken => ifKeyword;
9105 9415
9106 @override 9416 @override
(...skipping 133 matching lines...)
9240 } 9550 }
9241 9551
9242 /** 9552 /**
9243 * An import directive. 9553 * An import directive.
9244 * 9554 *
9245 * > importDirective ::= 9555 * > importDirective ::=
9246 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';' 9556 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';'
9247 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';' 9557 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';'
9248 */ 9558 */
9249 class ImportDirective extends NamespaceDirective { 9559 class ImportDirective extends NamespaceDirective {
9250 static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1, 9560 static Comparator<ImportDirective> COMPARATOR =
9251 ImportDirective import2) { 9561 (ImportDirective import1, ImportDirective import2) {
9252 // 9562 //
9253 // uri 9563 // uri
9254 // 9564 //
9255 StringLiteral uri1 = import1.uri; 9565 StringLiteral uri1 = import1.uri;
9256 StringLiteral uri2 = import2.uri; 9566 StringLiteral uri2 = import2.uri;
9257 String uriStr1 = uri1.stringValue; 9567 String uriStr1 = uri1.stringValue;
9258 String uriStr2 = uri2.stringValue; 9568 String uriStr2 = uri2.stringValue;
9259 if (uriStr1 != null || uriStr2 != null) { 9569 if (uriStr1 != null || uriStr2 != null) {
9260 if (uriStr1 == null) { 9570 if (uriStr1 == null) {
9261 return -1; 9571 return -1;
(...skipping 98 matching lines...)
9360 SimpleIdentifier _prefix; 9670 SimpleIdentifier _prefix;
9361 9671
9362 /** 9672 /**
9363 * Initialize a newly created import directive. Either or both of the 9673 * Initialize a newly created import directive. Either or both of the
9364 * [comment] and [metadata] can be `null` if the function does not have the 9674 * [comment] and [metadata] can be `null` if the function does not have the
9365 * corresponding attribute. The [deferredKeyword] can be `null` if the import 9675 * corresponding attribute. The [deferredKeyword] can be `null` if the import
9366 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import 9676 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import
9367 * does not specify a prefix. The list of [combinators] can be `null` if there 9677 * does not specify a prefix. The list of [combinators] can be `null` if there
9368 * are no combinators. 9678 * are no combinators.
9369 */ 9679 */
9370 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, 9680 ImportDirective(
9371 StringLiteral libraryUri, this.deferredKeyword, this.asKeyword, 9681 Comment comment,
9372 SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) 9682 List<Annotation> metadata,
9683 Token keyword,
9684 StringLiteral libraryUri,
9685 this.deferredKeyword,
9686 this.asKeyword,
9687 SimpleIdentifier prefix,
9688 List<Combinator> combinators,
9689 Token semicolon)
9373 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { 9690 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
9374 _prefix = _becomeParentOf(prefix); 9691 _prefix = _becomeParentOf(prefix);
9375 } 9692 }
9376 9693
9377 /** 9694 /**
9378 * The token representing the 'as' token, or `null` if the imported names are 9695 * The token representing the 'as' token, or `null` if the imported names are
9379 * not prefixed. 9696 * not prefixed.
9380 */ 9697 */
9381 @deprecated // Use "this.asKeyword" 9698 @deprecated // Use "this.asKeyword"
9382 Token get asToken => asKeyword; 9699 Token get asToken => asKeyword;
(...skipping 94 matching lines...)
9477 * mapping of old tokens to new tokens. 9794 * mapping of old tokens to new tokens.
9478 */ 9795 */
9479 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); 9796 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap);
9480 9797
9481 @override 9798 @override
9482 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 9799 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
9483 new AdjacentStrings(_cloneNodeList(node.strings)); 9800 new AdjacentStrings(_cloneNodeList(node.strings));
9484 9801
9485 @override 9802 @override
9486 Annotation visitAnnotation(Annotation node) { 9803 Annotation visitAnnotation(Annotation node) {
9487 Annotation copy = new Annotation(_mapToken(node.atSign), 9804 Annotation copy = new Annotation(
9488 _cloneNode(node.name), _mapToken(node.period), 9805 _mapToken(node.atSign),
9489 _cloneNode(node.constructorName), _cloneNode(node.arguments)); 9806 _cloneNode(node.name),
9807 _mapToken(node.period),
9808 _cloneNode(node.constructorName),
9809 _cloneNode(node.arguments));
9490 copy.element = node.element; 9810 copy.element = node.element;
9491 return copy; 9811 return copy;
9492 } 9812 }
9493 9813
9494 @override 9814 @override
9495 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 9815 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
9496 _mapToken(node.leftParenthesis), _cloneNodeList(node.arguments), 9816 _mapToken(node.leftParenthesis),
9817 _cloneNodeList(node.arguments),
9497 _mapToken(node.rightParenthesis)); 9818 _mapToken(node.rightParenthesis));
9498 9819
9499 @override 9820 @override
9500 AsExpression visitAsExpression(AsExpression node) { 9821 AsExpression visitAsExpression(AsExpression node) {
9501 AsExpression copy = new AsExpression(_cloneNode(node.expression), 9822 AsExpression copy = new AsExpression(_cloneNode(node.expression),
9502 _mapToken(node.asOperator), _cloneNode(node.type)); 9823 _mapToken(node.asOperator), _cloneNode(node.type));
9503 copy.propagatedType = node.propagatedType; 9824 copy.propagatedType = node.propagatedType;
9504 copy.staticType = node.staticType; 9825 copy.staticType = node.staticType;
9505 return copy; 9826 return copy;
9506 } 9827 }
9507 9828
9508 @override 9829 @override
9509 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 9830 AstNode visitAssertStatement(AssertStatement node) =>
9510 _mapToken(node.assertKeyword), _mapToken(node.leftParenthesis), 9831 new AssertStatement.withOptionalMessage(
9511 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 9832 _mapToken(node.assertKeyword),
9512 _mapToken(node.semicolon)); 9833 _mapToken(node.leftParenthesis),
9834 _cloneNode(node.condition),
9835 _mapToken(node.comma),
9836 _cloneNode(node.message),
9837 _mapToken(node.rightParenthesis),
9838 _mapToken(node.semicolon));
9513 9839
9514 @override 9840 @override
9515 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 9841 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
9516 AssignmentExpression copy = new AssignmentExpression( 9842 AssignmentExpression copy = new AssignmentExpression(
9517 _cloneNode(node.leftHandSide), _mapToken(node.operator), 9843 _cloneNode(node.leftHandSide),
9844 _mapToken(node.operator),
9518 _cloneNode(node.rightHandSide)); 9845 _cloneNode(node.rightHandSide));
9519 copy.propagatedElement = node.propagatedElement; 9846 copy.propagatedElement = node.propagatedElement;
9520 copy.propagatedType = node.propagatedType; 9847 copy.propagatedType = node.propagatedType;
9521 copy.staticElement = node.staticElement; 9848 copy.staticElement = node.staticElement;
9522 copy.staticType = node.staticType; 9849 copy.staticType = node.staticType;
9523 return copy; 9850 return copy;
9524 } 9851 }
9525 9852
9526 @override 9853 @override
9527 AwaitExpression visitAwaitExpression(AwaitExpression node) => 9854 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
9528 new AwaitExpression( 9855 new AwaitExpression(
9529 _mapToken(node.awaitKeyword), _cloneNode(node.expression)); 9856 _mapToken(node.awaitKeyword), _cloneNode(node.expression));
9530 9857
9531 @override 9858 @override
9532 BinaryExpression visitBinaryExpression(BinaryExpression node) { 9859 BinaryExpression visitBinaryExpression(BinaryExpression node) {
9533 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), 9860 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand),
9534 _mapToken(node.operator), _cloneNode(node.rightOperand)); 9861 _mapToken(node.operator), _cloneNode(node.rightOperand));
9535 copy.propagatedElement = node.propagatedElement; 9862 copy.propagatedElement = node.propagatedElement;
9536 copy.propagatedType = node.propagatedType; 9863 copy.propagatedType = node.propagatedType;
9537 copy.staticElement = node.staticElement; 9864 copy.staticElement = node.staticElement;
9538 copy.staticType = node.staticType; 9865 copy.staticType = node.staticType;
9539 return copy; 9866 return copy;
9540 } 9867 }
9541 9868
9542 @override 9869 @override
9543 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), 9870 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket),
9544 _cloneNodeList(node.statements), _mapToken(node.rightBracket)); 9871 _cloneNodeList(node.statements), _mapToken(node.rightBracket));
9545 9872
9546 @override 9873 @override
9547 BlockFunctionBody visitBlockFunctionBody( 9874 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
9548 BlockFunctionBody node) => new BlockFunctionBody( 9875 new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star),
9549 _mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block)); 9876 _cloneNode(node.block));
9550 9877
9551 @override 9878 @override
9552 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 9879 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
9553 BooleanLiteral copy = 9880 BooleanLiteral copy =
9554 new BooleanLiteral(_mapToken(node.literal), node.value); 9881 new BooleanLiteral(_mapToken(node.literal), node.value);
9555 copy.propagatedType = node.propagatedType; 9882 copy.propagatedType = node.propagatedType;
9556 copy.staticType = node.staticType; 9883 copy.staticType = node.staticType;
9557 return copy; 9884 return copy;
9558 } 9885 }
9559 9886
9560 @override 9887 @override
9561 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 9888 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
9562 _mapToken(node.breakKeyword), _cloneNode(node.label), 9889 _mapToken(node.breakKeyword),
9890 _cloneNode(node.label),
9563 _mapToken(node.semicolon)); 9891 _mapToken(node.semicolon));
9564 9892
9565 @override 9893 @override
9566 CascadeExpression visitCascadeExpression(CascadeExpression node) { 9894 CascadeExpression visitCascadeExpression(CascadeExpression node) {
9567 CascadeExpression copy = new CascadeExpression( 9895 CascadeExpression copy = new CascadeExpression(
9568 _cloneNode(node.target), _cloneNodeList(node.cascadeSections)); 9896 _cloneNode(node.target), _cloneNodeList(node.cascadeSections));
9569 copy.propagatedType = node.propagatedType; 9897 copy.propagatedType = node.propagatedType;
9570 copy.staticType = node.staticType; 9898 copy.staticType = node.staticType;
9571 return copy; 9899 return copy;
9572 } 9900 }
9573 9901
9574 @override 9902 @override
9575 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 9903 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
9576 _mapToken(node.onKeyword), _cloneNode(node.exceptionType), 9904 _mapToken(node.onKeyword),
9577 _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis), 9905 _cloneNode(node.exceptionType),
9578 _cloneNode(node.exceptionParameter), _mapToken(node.comma), 9906 _mapToken(node.catchKeyword),
9579 _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis), 9907 _mapToken(node.leftParenthesis),
9908 _cloneNode(node.exceptionParameter),
9909 _mapToken(node.comma),
9910 _cloneNode(node.stackTraceParameter),
9911 _mapToken(node.rightParenthesis),
9580 _cloneNode(node.body)); 9912 _cloneNode(node.body));
9581 9913
9582 @override 9914 @override
9583 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 9915 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
9584 ClassDeclaration copy = new ClassDeclaration( 9916 ClassDeclaration copy = new ClassDeclaration(
9585 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9917 _cloneNode(node.documentationComment),
9586 _mapToken(node.abstractKeyword), _mapToken(node.classKeyword), 9918 _cloneNodeList(node.metadata),
9587 _cloneNode(node.name), _cloneNode(node.typeParameters), 9919 _mapToken(node.abstractKeyword),
9588 _cloneNode(node.extendsClause), _cloneNode(node.withClause), 9920 _mapToken(node.classKeyword),
9589 _cloneNode(node.implementsClause), _mapToken(node.leftBracket), 9921 _cloneNode(node.name),
9590 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 9922 _cloneNode(node.typeParameters),
9923 _cloneNode(node.extendsClause),
9924 _cloneNode(node.withClause),
9925 _cloneNode(node.implementsClause),
9926 _mapToken(node.leftBracket),
9927 _cloneNodeList(node.members),
9928 _mapToken(node.rightBracket));
9591 copy.nativeClause = _cloneNode(node.nativeClause); 9929 copy.nativeClause = _cloneNode(node.nativeClause);
9592 return copy; 9930 return copy;
9593 } 9931 }
9594 9932
9595 @override 9933 @override
9596 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 9934 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
9597 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9935 _cloneNode(node.documentationComment),
9598 _mapToken(node.typedefKeyword), _cloneNode(node.name), 9936 _cloneNodeList(node.metadata),
9599 _cloneNode(node.typeParameters), _mapToken(node.equals), 9937 _mapToken(node.typedefKeyword),
9600 _mapToken(node.abstractKeyword), _cloneNode(node.superclass), 9938 _cloneNode(node.name),
9601 _cloneNode(node.withClause), _cloneNode(node.implementsClause), 9939 _cloneNode(node.typeParameters),
9940 _mapToken(node.equals),
9941 _mapToken(node.abstractKeyword),
9942 _cloneNode(node.superclass),
9943 _cloneNode(node.withClause),
9944 _cloneNode(node.implementsClause),
9602 _mapToken(node.semicolon)); 9945 _mapToken(node.semicolon));
9603 9946
9604 @override 9947 @override
9605 Comment visitComment(Comment node) { 9948 Comment visitComment(Comment node) {
9606 if (node.isDocumentation) { 9949 if (node.isDocumentation) {
9607 return Comment.createDocumentationCommentWithReferences( 9950 return Comment.createDocumentationCommentWithReferences(
9608 _mapTokens(node.tokens), _cloneNodeList(node.references)); 9951 _mapTokens(node.tokens), _cloneNodeList(node.references));
9609 } else if (node.isBlock) { 9952 } else if (node.isBlock) {
9610 return Comment.createBlockComment(_mapTokens(node.tokens)); 9953 return Comment.createBlockComment(_mapTokens(node.tokens));
9611 } 9954 }
9612 return Comment.createEndOfLineComment(_mapTokens(node.tokens)); 9955 return Comment.createEndOfLineComment(_mapTokens(node.tokens));
9613 } 9956 }
9614 9957
9615 @override 9958 @override
9616 CommentReference visitCommentReference(CommentReference node) => 9959 CommentReference visitCommentReference(CommentReference node) =>
9617 new CommentReference( 9960 new CommentReference(
9618 _mapToken(node.newKeyword), _cloneNode(node.identifier)); 9961 _mapToken(node.newKeyword), _cloneNode(node.identifier));
9619 9962
9620 @override 9963 @override
9621 CompilationUnit visitCompilationUnit(CompilationUnit node) { 9964 CompilationUnit visitCompilationUnit(CompilationUnit node) {
9622 CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken), 9965 CompilationUnit copy = new CompilationUnit(
9623 _cloneNode(node.scriptTag), _cloneNodeList(node.directives), 9966 _mapToken(node.beginToken),
9624 _cloneNodeList(node.declarations), _mapToken(node.endToken)); 9967 _cloneNode(node.scriptTag),
9968 _cloneNodeList(node.directives),
9969 _cloneNodeList(node.declarations),
9970 _mapToken(node.endToken));
9625 copy.lineInfo = node.lineInfo; 9971 copy.lineInfo = node.lineInfo;
9626 copy.element = node.element; 9972 copy.element = node.element;
9627 return copy; 9973 return copy;
9628 } 9974 }
9629 9975
9630 @override 9976 @override
9631 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 9977 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
9632 ConditionalExpression copy = new ConditionalExpression( 9978 ConditionalExpression copy = new ConditionalExpression(
9633 _cloneNode(node.condition), _mapToken(node.question), 9979 _cloneNode(node.condition),
9634 _cloneNode(node.thenExpression), _mapToken(node.colon), 9980 _mapToken(node.question),
9981 _cloneNode(node.thenExpression),
9982 _mapToken(node.colon),
9635 _cloneNode(node.elseExpression)); 9983 _cloneNode(node.elseExpression));
9636 copy.propagatedType = node.propagatedType; 9984 copy.propagatedType = node.propagatedType;
9637 copy.staticType = node.staticType; 9985 copy.staticType = node.staticType;
9638 return copy; 9986 return copy;
9639 } 9987 }
9640 9988
9641 @override 9989 @override
9642 ConstructorDeclaration visitConstructorDeclaration( 9990 ConstructorDeclaration visitConstructorDeclaration(
9643 ConstructorDeclaration node) { 9991 ConstructorDeclaration node) {
9644 ConstructorDeclaration copy = new ConstructorDeclaration( 9992 ConstructorDeclaration copy = new ConstructorDeclaration(
9645 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9993 _cloneNode(node.documentationComment),
9646 _mapToken(node.externalKeyword), _mapToken(node.constKeyword), 9994 _cloneNodeList(node.metadata),
9647 _mapToken(node.factoryKeyword), _cloneNode(node.returnType), 9995 _mapToken(node.externalKeyword),
9648 _mapToken(node.period), _cloneNode(node.name), 9996 _mapToken(node.constKeyword),
9649 _cloneNode(node.parameters), _mapToken(node.separator), 9997 _mapToken(node.factoryKeyword),
9998 _cloneNode(node.returnType),
9999 _mapToken(node.period),
10000 _cloneNode(node.name),
10001 _cloneNode(node.parameters),
10002 _mapToken(node.separator),
9650 _cloneNodeList(node.initializers), 10003 _cloneNodeList(node.initializers),
9651 _cloneNode(node.redirectedConstructor), _cloneNode(node.body)); 10004 _cloneNode(node.redirectedConstructor),
10005 _cloneNode(node.body));
9652 copy.element = node.element; 10006 copy.element = node.element;
9653 return copy; 10007 return copy;
9654 } 10008 }
9655 10009
9656 @override 10010 @override
9657 ConstructorFieldInitializer visitConstructorFieldInitializer( 10011 ConstructorFieldInitializer visitConstructorFieldInitializer(
9658 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 10012 ConstructorFieldInitializer node) =>
9659 _mapToken(node.thisKeyword), _mapToken(node.period), 10013 new ConstructorFieldInitializer(
9660 _cloneNode(node.fieldName), _mapToken(node.equals), 10014 _mapToken(node.thisKeyword),
9661 _cloneNode(node.expression)); 10015 _mapToken(node.period),
10016 _cloneNode(node.fieldName),
10017 _mapToken(node.equals),
10018 _cloneNode(node.expression));
9662 10019
9663 @override 10020 @override
9664 ConstructorName visitConstructorName(ConstructorName node) { 10021 ConstructorName visitConstructorName(ConstructorName node) {
9665 ConstructorName copy = new ConstructorName( 10022 ConstructorName copy = new ConstructorName(
9666 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name)); 10023 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name));
9667 copy.staticElement = node.staticElement; 10024 copy.staticElement = node.staticElement;
9668 return copy; 10025 return copy;
9669 } 10026 }
9670 10027
9671 @override 10028 @override
9672 ContinueStatement visitContinueStatement(ContinueStatement node) => 10029 ContinueStatement visitContinueStatement(ContinueStatement node) =>
9673 new ContinueStatement(_mapToken(node.continueKeyword), 10030 new ContinueStatement(_mapToken(node.continueKeyword),
9674 _cloneNode(node.label), _mapToken(node.semicolon)); 10031 _cloneNode(node.label), _mapToken(node.semicolon));
9675 10032
9676 @override 10033 @override
9677 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 10034 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
9678 new DeclaredIdentifier(_cloneNode(node.documentationComment), 10035 new DeclaredIdentifier(
9679 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10036 _cloneNode(node.documentationComment),
9680 _cloneNode(node.type), _cloneNode(node.identifier)); 10037 _cloneNodeList(node.metadata),
10038 _mapToken(node.keyword),
10039 _cloneNode(node.type),
10040 _cloneNode(node.identifier));
9681 10041
9682 @override 10042 @override
9683 DefaultFormalParameter visitDefaultFormalParameter( 10043 DefaultFormalParameter visitDefaultFormalParameter(
9684 DefaultFormalParameter node) => new DefaultFormalParameter( 10044 DefaultFormalParameter node) =>
9685 _cloneNode(node.parameter), node.kind, _mapToken(node.separator), 10045 new DefaultFormalParameter(_cloneNode(node.parameter), node.kind,
9686 _cloneNode(node.defaultValue)); 10046 _mapToken(node.separator), _cloneNode(node.defaultValue));
9687 10047
9688 @override 10048 @override
9689 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 10049 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
9690 _mapToken(node.doKeyword), _cloneNode(node.body), 10050 _mapToken(node.doKeyword),
9691 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10051 _cloneNode(node.body),
9692 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10052 _mapToken(node.whileKeyword),
10053 _mapToken(node.leftParenthesis),
10054 _cloneNode(node.condition),
10055 _mapToken(node.rightParenthesis),
9693 _mapToken(node.semicolon)); 10056 _mapToken(node.semicolon));
9694 10057
9695 @override 10058 @override
9696 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 10059 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
9697 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); 10060 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value);
9698 copy.propagatedType = node.propagatedType; 10061 copy.propagatedType = node.propagatedType;
9699 copy.staticType = node.staticType; 10062 copy.staticType = node.staticType;
9700 return copy; 10063 return copy;
9701 } 10064 }
9702 10065
9703 @override 10066 @override
9704 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 10067 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
9705 new EmptyFunctionBody(_mapToken(node.semicolon)); 10068 new EmptyFunctionBody(_mapToken(node.semicolon));
9706 10069
9707 @override 10070 @override
9708 EmptyStatement visitEmptyStatement(EmptyStatement node) => 10071 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
9709 new EmptyStatement(_mapToken(node.semicolon)); 10072 new EmptyStatement(_mapToken(node.semicolon));
9710 10073
9711 @override 10074 @override
9712 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 10075 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
9713 new EnumConstantDeclaration(_cloneNode(node.documentationComment), 10076 new EnumConstantDeclaration(_cloneNode(node.documentationComment),
9714 _cloneNodeList(node.metadata), _cloneNode(node.name)); 10077 _cloneNodeList(node.metadata), _cloneNode(node.name));
9715 10078
9716 @override 10079 @override
9717 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration( 10080 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(
9718 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10081 _cloneNode(node.documentationComment),
9719 _mapToken(node.enumKeyword), _cloneNode(node.name), 10082 _cloneNodeList(node.metadata),
9720 _mapToken(node.leftBracket), _cloneNodeList(node.constants), 10083 _mapToken(node.enumKeyword),
10084 _cloneNode(node.name),
10085 _mapToken(node.leftBracket),
10086 _cloneNodeList(node.constants),
9721 _mapToken(node.rightBracket)); 10087 _mapToken(node.rightBracket));
9722 10088
9723 @override 10089 @override
9724 ExportDirective visitExportDirective(ExportDirective node) { 10090 ExportDirective visitExportDirective(ExportDirective node) {
9725 ExportDirective copy = new ExportDirective( 10091 ExportDirective copy = new ExportDirective(
9726 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10092 _cloneNode(node.documentationComment),
9727 _mapToken(node.keyword), _cloneNode(node.uri), 10093 _cloneNodeList(node.metadata),
9728 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10094 _mapToken(node.keyword),
10095 _cloneNode(node.uri),
10096 _cloneNodeList(node.combinators),
10097 _mapToken(node.semicolon));
9729 copy.element = node.element; 10098 copy.element = node.element;
9730 return copy; 10099 return copy;
9731 } 10100 }
9732 10101
9733 @override 10102 @override
9734 ExpressionFunctionBody visitExpressionFunctionBody( 10103 ExpressionFunctionBody visitExpressionFunctionBody(
9735 ExpressionFunctionBody node) => new ExpressionFunctionBody( 10104 ExpressionFunctionBody node) =>
9736 _mapToken(node.keyword), _mapToken(node.functionDefinition), 10105 new ExpressionFunctionBody(
9737 _cloneNode(node.expression), _mapToken(node.semicolon)); 10106 _mapToken(node.keyword),
10107 _mapToken(node.functionDefinition),
10108 _cloneNode(node.expression),
10109 _mapToken(node.semicolon));
9738 10110
9739 @override 10111 @override
9740 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 10112 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
9741 new ExpressionStatement( 10113 new ExpressionStatement(
9742 _cloneNode(node.expression), _mapToken(node.semicolon)); 10114 _cloneNode(node.expression), _mapToken(node.semicolon));
9743 10115
9744 @override 10116 @override
9745 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 10117 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
9746 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); 10118 _mapToken(node.extendsKeyword), _cloneNode(node.superclass));
9747 10119
9748 @override 10120 @override
9749 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 10121 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
9750 new FieldDeclaration(_cloneNode(node.documentationComment), 10122 new FieldDeclaration(
9751 _cloneNodeList(node.metadata), _mapToken(node.staticKeyword), 10123 _cloneNode(node.documentationComment),
9752 _cloneNode(node.fields), _mapToken(node.semicolon)); 10124 _cloneNodeList(node.metadata),
10125 _mapToken(node.staticKeyword),
10126 _cloneNode(node.fields),
10127 _mapToken(node.semicolon));
9753 10128
9754 @override 10129 @override
9755 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 10130 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
9756 new FieldFormalParameter(_cloneNode(node.documentationComment), 10131 new FieldFormalParameter(
9757 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10132 _cloneNode(node.documentationComment),
9758 _cloneNode(node.type), _mapToken(node.thisKeyword), 10133 _cloneNodeList(node.metadata),
9759 _mapToken(node.period), _cloneNode(node.identifier), 10134 _mapToken(node.keyword),
9760 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10135 _cloneNode(node.type),
10136 _mapToken(node.thisKeyword),
10137 _mapToken(node.period),
10138 _cloneNode(node.identifier),
10139 _cloneNode(node.typeParameters),
10140 _cloneNode(node.parameters));
9761 10141
9762 @override 10142 @override
9763 ForEachStatement visitForEachStatement(ForEachStatement node) { 10143 ForEachStatement visitForEachStatement(ForEachStatement node) {
9764 DeclaredIdentifier loopVariable = node.loopVariable; 10144 DeclaredIdentifier loopVariable = node.loopVariable;
9765 if (loopVariable == null) { 10145 if (loopVariable == null) {
9766 return new ForEachStatement.withReference(_mapToken(node.awaitKeyword), 10146 return new ForEachStatement.withReference(
9767 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10147 _mapToken(node.awaitKeyword),
9768 _cloneNode(node.identifier), _mapToken(node.inKeyword), 10148 _mapToken(node.forKeyword),
9769 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10149 _mapToken(node.leftParenthesis),
10150 _cloneNode(node.identifier),
10151 _mapToken(node.inKeyword),
10152 _cloneNode(node.iterable),
10153 _mapToken(node.rightParenthesis),
9770 _cloneNode(node.body)); 10154 _cloneNode(node.body));
9771 } 10155 }
9772 return new ForEachStatement.withDeclaration(_mapToken(node.awaitKeyword), 10156 return new ForEachStatement.withDeclaration(
9773 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10157 _mapToken(node.awaitKeyword),
9774 _cloneNode(loopVariable), _mapToken(node.inKeyword), 10158 _mapToken(node.forKeyword),
9775 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10159 _mapToken(node.leftParenthesis),
10160 _cloneNode(loopVariable),
10161 _mapToken(node.inKeyword),
10162 _cloneNode(node.iterable),
10163 _mapToken(node.rightParenthesis),
9776 _cloneNode(node.body)); 10164 _cloneNode(node.body));
9777 } 10165 }
9778 10166
9779 @override 10167 @override
9780 FormalParameterList visitFormalParameterList(FormalParameterList node) => 10168 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
9781 new FormalParameterList(_mapToken(node.leftParenthesis), 10169 new FormalParameterList(
9782 _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter), 10170 _mapToken(node.leftParenthesis),
9783 _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis)); 10171 _cloneNodeList(node.parameters),
10172 _mapToken(node.leftDelimiter),
10173 _mapToken(node.rightDelimiter),
10174 _mapToken(node.rightParenthesis));
9784 10175
9785 @override 10176 @override
9786 ForStatement visitForStatement(ForStatement node) => new ForStatement( 10177 ForStatement visitForStatement(ForStatement node) => new ForStatement(
9787 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10178 _mapToken(node.forKeyword),
9788 _cloneNode(node.variables), _cloneNode(node.initialization), 10179 _mapToken(node.leftParenthesis),
9789 _mapToken(node.leftSeparator), _cloneNode(node.condition), 10180 _cloneNode(node.variables),
9790 _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), 10181 _cloneNode(node.initialization),
9791 _mapToken(node.rightParenthesis), _cloneNode(node.body)); 10182 _mapToken(node.leftSeparator),
10183 _cloneNode(node.condition),
10184 _mapToken(node.rightSeparator),
10185 _cloneNodeList(node.updaters),
10186 _mapToken(node.rightParenthesis),
10187 _cloneNode(node.body));
9792 10188
9793 @override 10189 @override
9794 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 10190 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
9795 new FunctionDeclaration(_cloneNode(node.documentationComment), 10191 new FunctionDeclaration(
9796 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10192 _cloneNode(node.documentationComment),
9797 _cloneNode(node.returnType), _mapToken(node.propertyKeyword), 10193 _cloneNodeList(node.metadata),
9798 _cloneNode(node.name), _cloneNode(node.functionExpression)); 10194 _mapToken(node.externalKeyword),
10195 _cloneNode(node.returnType),
10196 _mapToken(node.propertyKeyword),
10197 _cloneNode(node.name),
10198 _cloneNode(node.functionExpression));
9799 10199
9800 @override 10200 @override
9801 FunctionDeclarationStatement visitFunctionDeclarationStatement( 10201 FunctionDeclarationStatement visitFunctionDeclarationStatement(
9802 FunctionDeclarationStatement node) => 10202 FunctionDeclarationStatement node) =>
9803 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration)); 10203 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
9804 10204
9805 @override 10205 @override
9806 FunctionExpression visitFunctionExpression(FunctionExpression node) { 10206 FunctionExpression visitFunctionExpression(FunctionExpression node) {
9807 FunctionExpression copy = new FunctionExpression( 10207 FunctionExpression copy = new FunctionExpression(
9808 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10208 _cloneNode(node.typeParameters),
10209 _cloneNode(node.parameters),
9809 _cloneNode(node.body)); 10210 _cloneNode(node.body));
9810 copy.element = node.element; 10211 copy.element = node.element;
9811 copy.propagatedType = node.propagatedType; 10212 copy.propagatedType = node.propagatedType;
9812 copy.staticType = node.staticType; 10213 copy.staticType = node.staticType;
9813 return copy; 10214 return copy;
9814 } 10215 }
9815 10216
9816 @override 10217 @override
9817 FunctionExpressionInvocation visitFunctionExpressionInvocation( 10218 FunctionExpressionInvocation visitFunctionExpressionInvocation(
9818 FunctionExpressionInvocation node) { 10219 FunctionExpressionInvocation node) {
9819 FunctionExpressionInvocation copy = new FunctionExpressionInvocation( 10220 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
9820 _cloneNode(node.function), _cloneNode(node.typeArguments), 10221 _cloneNode(node.function),
10222 _cloneNode(node.typeArguments),
9821 _cloneNode(node.argumentList)); 10223 _cloneNode(node.argumentList));
9822 copy.propagatedElement = node.propagatedElement; 10224 copy.propagatedElement = node.propagatedElement;
9823 copy.propagatedType = node.propagatedType; 10225 copy.propagatedType = node.propagatedType;
9824 copy.staticElement = node.staticElement; 10226 copy.staticElement = node.staticElement;
9825 copy.staticType = node.staticType; 10227 copy.staticType = node.staticType;
9826 return copy; 10228 return copy;
9827 } 10229 }
9828 10230
9829 @override 10231 @override
9830 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 10232 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
9831 new FunctionTypeAlias(_cloneNode(node.documentationComment), 10233 new FunctionTypeAlias(
9832 _cloneNodeList(node.metadata), _mapToken(node.typedefKeyword), 10234 _cloneNode(node.documentationComment),
9833 _cloneNode(node.returnType), _cloneNode(node.name), 10235 _cloneNodeList(node.metadata),
9834 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10236 _mapToken(node.typedefKeyword),
10237 _cloneNode(node.returnType),
10238 _cloneNode(node.name),
10239 _cloneNode(node.typeParameters),
10240 _cloneNode(node.parameters),
9835 _mapToken(node.semicolon)); 10241 _mapToken(node.semicolon));
9836 10242
9837 @override 10243 @override
9838 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 10244 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
9839 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 10245 FunctionTypedFormalParameter node) =>
9840 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10246 new FunctionTypedFormalParameter(
9841 _cloneNode(node.returnType), _cloneNode(node.identifier), 10247 _cloneNode(node.documentationComment),
9842 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10248 _cloneNodeList(node.metadata),
10249 _cloneNode(node.returnType),
10250 _cloneNode(node.identifier),
10251 _cloneNode(node.typeParameters),
10252 _cloneNode(node.parameters));
9843 10253
9844 @override 10254 @override
9845 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 10255 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
9846 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames)); 10256 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
9847 10257
9848 @override 10258 @override
9849 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 10259 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
9850 _mapToken(node.ifKeyword), _mapToken(node.leftParenthesis), 10260 _mapToken(node.ifKeyword),
9851 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10261 _mapToken(node.leftParenthesis),
9852 _cloneNode(node.thenStatement), _mapToken(node.elseKeyword), 10262 _cloneNode(node.condition),
10263 _mapToken(node.rightParenthesis),
10264 _cloneNode(node.thenStatement),
10265 _mapToken(node.elseKeyword),
9853 _cloneNode(node.elseStatement)); 10266 _cloneNode(node.elseStatement));
9854 10267
9855 @override 10268 @override
9856 ImplementsClause visitImplementsClause(ImplementsClause node) => 10269 ImplementsClause visitImplementsClause(ImplementsClause node) =>
9857 new ImplementsClause( 10270 new ImplementsClause(
9858 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); 10271 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces));
9859 10272
9860 @override 10273 @override
9861 ImportDirective visitImportDirective(ImportDirective node) => 10274 ImportDirective visitImportDirective(ImportDirective node) =>
9862 new ImportDirective(_cloneNode(node.documentationComment), 10275 new ImportDirective(
9863 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10276 _cloneNode(node.documentationComment),
9864 _cloneNode(node.uri), _mapToken(node.deferredKeyword), 10277 _cloneNodeList(node.metadata),
9865 _mapToken(node.asKeyword), _cloneNode(node.prefix), 10278 _mapToken(node.keyword),
9866 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10279 _cloneNode(node.uri),
10280 _mapToken(node.deferredKeyword),
10281 _mapToken(node.asKeyword),
10282 _cloneNode(node.prefix),
10283 _cloneNodeList(node.combinators),
10284 _mapToken(node.semicolon));
9867 10285
9868 @override 10286 @override
9869 IndexExpression visitIndexExpression(IndexExpression node) { 10287 IndexExpression visitIndexExpression(IndexExpression node) {
9870 Token period = _mapToken(node.period); 10288 Token period = _mapToken(node.period);
9871 IndexExpression copy; 10289 IndexExpression copy;
9872 if (period == null) { 10290 if (period == null) {
9873 copy = new IndexExpression.forTarget(_cloneNode(node.target), 10291 copy = new IndexExpression.forTarget(
9874 _mapToken(node.leftBracket), _cloneNode(node.index), 10292 _cloneNode(node.target),
10293 _mapToken(node.leftBracket),
10294 _cloneNode(node.index),
9875 _mapToken(node.rightBracket)); 10295 _mapToken(node.rightBracket));
9876 } else { 10296 } else {
9877 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), 10297 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket),
9878 _cloneNode(node.index), _mapToken(node.rightBracket)); 10298 _cloneNode(node.index), _mapToken(node.rightBracket));
9879 } 10299 }
9880 copy.auxiliaryElements = node.auxiliaryElements; 10300 copy.auxiliaryElements = node.auxiliaryElements;
9881 copy.propagatedElement = node.propagatedElement; 10301 copy.propagatedElement = node.propagatedElement;
9882 copy.propagatedType = node.propagatedType; 10302 copy.propagatedType = node.propagatedType;
9883 copy.staticElement = node.staticElement; 10303 copy.staticElement = node.staticElement;
9884 copy.staticType = node.staticType; 10304 copy.staticType = node.staticType;
9885 return copy; 10305 return copy;
9886 } 10306 }
9887 10307
9888 @override 10308 @override
9889 InstanceCreationExpression visitInstanceCreationExpression( 10309 InstanceCreationExpression visitInstanceCreationExpression(
9890 InstanceCreationExpression node) { 10310 InstanceCreationExpression node) {
9891 InstanceCreationExpression copy = new InstanceCreationExpression( 10311 InstanceCreationExpression copy = new InstanceCreationExpression(
9892 _mapToken(node.keyword), _cloneNode(node.constructorName), 10312 _mapToken(node.keyword),
10313 _cloneNode(node.constructorName),
9893 _cloneNode(node.argumentList)); 10314 _cloneNode(node.argumentList));
9894 copy.propagatedType = node.propagatedType; 10315 copy.propagatedType = node.propagatedType;
9895 copy.staticElement = node.staticElement; 10316 copy.staticElement = node.staticElement;
9896 copy.staticType = node.staticType; 10317 copy.staticType = node.staticType;
9897 return copy; 10318 return copy;
9898 } 10319 }
9899 10320
9900 @override 10321 @override
9901 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 10322 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
9902 IntegerLiteral copy = 10323 IntegerLiteral copy =
9903 new IntegerLiteral(_mapToken(node.literal), node.value); 10324 new IntegerLiteral(_mapToken(node.literal), node.value);
9904 copy.propagatedType = node.propagatedType; 10325 copy.propagatedType = node.propagatedType;
9905 copy.staticType = node.staticType; 10326 copy.staticType = node.staticType;
9906 return copy; 10327 return copy;
9907 } 10328 }
9908 10329
9909 @override 10330 @override
9910 InterpolationExpression visitInterpolationExpression( 10331 InterpolationExpression visitInterpolationExpression(
9911 InterpolationExpression node) => new InterpolationExpression( 10332 InterpolationExpression node) =>
9912 _mapToken(node.leftBracket), _cloneNode(node.expression), 10333 new InterpolationExpression(_mapToken(node.leftBracket),
9913 _mapToken(node.rightBracket)); 10334 _cloneNode(node.expression), _mapToken(node.rightBracket));
9914 10335
9915 @override 10336 @override
9916 InterpolationString visitInterpolationString(InterpolationString node) => 10337 InterpolationString visitInterpolationString(InterpolationString node) =>
9917 new InterpolationString(_mapToken(node.contents), node.value); 10338 new InterpolationString(_mapToken(node.contents), node.value);
9918 10339
9919 @override 10340 @override
9920 IsExpression visitIsExpression(IsExpression node) { 10341 IsExpression visitIsExpression(IsExpression node) {
9921 IsExpression copy = new IsExpression(_cloneNode(node.expression), 10342 IsExpression copy = new IsExpression(
9922 _mapToken(node.isOperator), _mapToken(node.notOperator), 10343 _cloneNode(node.expression),
10344 _mapToken(node.isOperator),
10345 _mapToken(node.notOperator),
9923 _cloneNode(node.type)); 10346 _cloneNode(node.type));
9924 copy.propagatedType = node.propagatedType; 10347 copy.propagatedType = node.propagatedType;
9925 copy.staticType = node.staticType; 10348 copy.staticType = node.staticType;
9926 return copy; 10349 return copy;
9927 } 10350 }
9928 10351
9929 @override 10352 @override
9930 Label visitLabel(Label node) => 10353 Label visitLabel(Label node) =>
9931 new Label(_cloneNode(node.label), _mapToken(node.colon)); 10354 new Label(_cloneNode(node.label), _mapToken(node.colon));
9932 10355
9933 @override 10356 @override
9934 LabeledStatement visitLabeledStatement(LabeledStatement node) => 10357 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
9935 new LabeledStatement( 10358 new LabeledStatement(
9936 _cloneNodeList(node.labels), _cloneNode(node.statement)); 10359 _cloneNodeList(node.labels), _cloneNode(node.statement));
9937 10360
9938 @override 10361 @override
9939 LibraryDirective visitLibraryDirective(LibraryDirective node) => 10362 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
9940 new LibraryDirective(_cloneNode(node.documentationComment), 10363 new LibraryDirective(
9941 _cloneNodeList(node.metadata), _mapToken(node.libraryKeyword), 10364 _cloneNode(node.documentationComment),
9942 _cloneNode(node.name), _mapToken(node.semicolon)); 10365 _cloneNodeList(node.metadata),
10366 _mapToken(node.libraryKeyword),
10367 _cloneNode(node.name),
10368 _mapToken(node.semicolon));
9943 10369
9944 @override 10370 @override
9945 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 10371 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
9946 LibraryIdentifier copy = 10372 LibraryIdentifier copy =
9947 new LibraryIdentifier(_cloneNodeList(node.components)); 10373 new LibraryIdentifier(_cloneNodeList(node.components));
9948 copy.propagatedType = node.propagatedType; 10374 copy.propagatedType = node.propagatedType;
9949 copy.staticType = node.staticType; 10375 copy.staticType = node.staticType;
9950 return copy; 10376 return copy;
9951 } 10377 }
9952 10378
9953 @override 10379 @override
9954 ListLiteral visitListLiteral(ListLiteral node) { 10380 ListLiteral visitListLiteral(ListLiteral node) {
9955 ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword), 10381 ListLiteral copy = new ListLiteral(
9956 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10382 _mapToken(node.constKeyword),
9957 _cloneNodeList(node.elements), _mapToken(node.rightBracket)); 10383 _cloneNode(node.typeArguments),
10384 _mapToken(node.leftBracket),
10385 _cloneNodeList(node.elements),
10386 _mapToken(node.rightBracket));
9958 copy.propagatedType = node.propagatedType; 10387 copy.propagatedType = node.propagatedType;
9959 copy.staticType = node.staticType; 10388 copy.staticType = node.staticType;
9960 return copy; 10389 return copy;
9961 } 10390 }
9962 10391
9963 @override 10392 @override
9964 MapLiteral visitMapLiteral(MapLiteral node) { 10393 MapLiteral visitMapLiteral(MapLiteral node) {
9965 MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword), 10394 MapLiteral copy = new MapLiteral(
9966 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10395 _mapToken(node.constKeyword),
9967 _cloneNodeList(node.entries), _mapToken(node.rightBracket)); 10396 _cloneNode(node.typeArguments),
10397 _mapToken(node.leftBracket),
10398 _cloneNodeList(node.entries),
10399 _mapToken(node.rightBracket));
9968 copy.propagatedType = node.propagatedType; 10400 copy.propagatedType = node.propagatedType;
9969 copy.staticType = node.staticType; 10401 copy.staticType = node.staticType;
9970 return copy; 10402 return copy;
9971 } 10403 }
9972 10404
9973 @override 10405 @override
9974 MapLiteralEntry visitMapLiteralEntry( 10406 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
9975 MapLiteralEntry node) => new MapLiteralEntry( 10407 new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator),
9976 _cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value)); 10408 _cloneNode(node.value));
9977 10409
9978 @override 10410 @override
9979 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 10411 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
9980 new MethodDeclaration(_cloneNode(node.documentationComment), 10412 new MethodDeclaration(
9981 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10413 _cloneNode(node.documentationComment),
9982 _mapToken(node.modifierKeyword), _cloneNode(node.returnType), 10414 _cloneNodeList(node.metadata),
9983 _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword), 10415 _mapToken(node.externalKeyword),
9984 _cloneNode(node.name), _cloneNode(node._typeParameters), 10416 _mapToken(node.modifierKeyword),
9985 _cloneNode(node.parameters), _cloneNode(node.body)); 10417 _cloneNode(node.returnType),
10418 _mapToken(node.propertyKeyword),
10419 _mapToken(node.operatorKeyword),
10420 _cloneNode(node.name),
10421 _cloneNode(node._typeParameters),
10422 _cloneNode(node.parameters),
10423 _cloneNode(node.body));
9986 10424
9987 @override 10425 @override
9988 MethodInvocation visitMethodInvocation(MethodInvocation node) { 10426 MethodInvocation visitMethodInvocation(MethodInvocation node) {
9989 MethodInvocation copy = new MethodInvocation(_cloneNode(node.target), 10427 MethodInvocation copy = new MethodInvocation(
9990 _mapToken(node.operator), _cloneNode(node.methodName), 10428 _cloneNode(node.target),
9991 _cloneNode(node.typeArguments), _cloneNode(node.argumentList)); 10429 _mapToken(node.operator),
10430 _cloneNode(node.methodName),
10431 _cloneNode(node.typeArguments),
10432 _cloneNode(node.argumentList));
9992 copy.propagatedType = node.propagatedType; 10433 copy.propagatedType = node.propagatedType;
9993 copy.staticType = node.staticType; 10434 copy.staticType = node.staticType;
9994 return copy; 10435 return copy;
9995 } 10436 }
9996 10437
9997 @override 10438 @override
9998 NamedExpression visitNamedExpression(NamedExpression node) { 10439 NamedExpression visitNamedExpression(NamedExpression node) {
9999 NamedExpression copy = 10440 NamedExpression copy =
10000 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression)); 10441 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
10001 copy.propagatedType = node.propagatedType; 10442 copy.propagatedType = node.propagatedType;
(...skipping 15 matching lines...)
10017 NullLiteral copy = new NullLiteral(_mapToken(node.literal)); 10458 NullLiteral copy = new NullLiteral(_mapToken(node.literal));
10018 copy.propagatedType = node.propagatedType; 10459 copy.propagatedType = node.propagatedType;
10019 copy.staticType = node.staticType; 10460 copy.staticType = node.staticType;
10020 return copy; 10461 return copy;
10021 } 10462 }
10022 10463
10023 @override 10464 @override
10024 ParenthesizedExpression visitParenthesizedExpression( 10465 ParenthesizedExpression visitParenthesizedExpression(
10025 ParenthesizedExpression node) { 10466 ParenthesizedExpression node) {
10026 ParenthesizedExpression copy = new ParenthesizedExpression( 10467 ParenthesizedExpression copy = new ParenthesizedExpression(
10027 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10468 _mapToken(node.leftParenthesis),
10469 _cloneNode(node.expression),
10028 _mapToken(node.rightParenthesis)); 10470 _mapToken(node.rightParenthesis));
10029 copy.propagatedType = node.propagatedType; 10471 copy.propagatedType = node.propagatedType;
10030 copy.staticType = node.staticType; 10472 copy.staticType = node.staticType;
10031 return copy; 10473 return copy;
10032 } 10474 }
10033 10475
10034 @override 10476 @override
10035 PartDirective visitPartDirective(PartDirective node) { 10477 PartDirective visitPartDirective(PartDirective node) {
10036 PartDirective copy = new PartDirective( 10478 PartDirective copy = new PartDirective(
10037 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10479 _cloneNode(node.documentationComment),
10038 _mapToken(node.partKeyword), _cloneNode(node.uri), 10480 _cloneNodeList(node.metadata),
10481 _mapToken(node.partKeyword),
10482 _cloneNode(node.uri),
10039 _mapToken(node.semicolon)); 10483 _mapToken(node.semicolon));
10040 copy.element = node.element; 10484 copy.element = node.element;
10041 return copy; 10485 return copy;
10042 } 10486 }
10043 10487
10044 @override 10488 @override
10045 PartOfDirective visitPartOfDirective(PartOfDirective node) { 10489 PartOfDirective visitPartOfDirective(PartOfDirective node) {
10046 PartOfDirective copy = new PartOfDirective( 10490 PartOfDirective copy = new PartOfDirective(
10047 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10491 _cloneNode(node.documentationComment),
10048 _mapToken(node.partKeyword), _mapToken(node.ofKeyword), 10492 _cloneNodeList(node.metadata),
10049 _cloneNode(node.libraryName), _mapToken(node.semicolon)); 10493 _mapToken(node.partKeyword),
10494 _mapToken(node.ofKeyword),
10495 _cloneNode(node.libraryName),
10496 _mapToken(node.semicolon));
10050 copy.element = node.element; 10497 copy.element = node.element;
10051 return copy; 10498 return copy;
10052 } 10499 }
10053 10500
10054 @override 10501 @override
10055 PostfixExpression visitPostfixExpression(PostfixExpression node) { 10502 PostfixExpression visitPostfixExpression(PostfixExpression node) {
10056 PostfixExpression copy = new PostfixExpression( 10503 PostfixExpression copy = new PostfixExpression(
10057 _cloneNode(node.operand), _mapToken(node.operator)); 10504 _cloneNode(node.operand), _mapToken(node.operator));
10058 copy.propagatedElement = node.propagatedElement; 10505 copy.propagatedElement = node.propagatedElement;
10059 copy.propagatedType = node.propagatedType; 10506 copy.propagatedType = node.propagatedType;
(...skipping 28 matching lines...)
10088 _mapToken(node.operator), _cloneNode(node.propertyName)); 10535 _mapToken(node.operator), _cloneNode(node.propertyName));
10089 copy.propagatedType = node.propagatedType; 10536 copy.propagatedType = node.propagatedType;
10090 copy.staticType = node.staticType; 10537 copy.staticType = node.staticType;
10091 return copy; 10538 return copy;
10092 } 10539 }
10093 10540
10094 @override 10541 @override
10095 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 10542 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
10096 RedirectingConstructorInvocation node) { 10543 RedirectingConstructorInvocation node) {
10097 RedirectingConstructorInvocation copy = 10544 RedirectingConstructorInvocation copy =
10098 new RedirectingConstructorInvocation(_mapToken(node.thisKeyword), 10545 new RedirectingConstructorInvocation(
10099 _mapToken(node.period), _cloneNode(node.constructorName), 10546 _mapToken(node.thisKeyword),
10547 _mapToken(node.period),
10548 _cloneNode(node.constructorName),
10100 _cloneNode(node.argumentList)); 10549 _cloneNode(node.argumentList));
10101 copy.staticElement = node.staticElement; 10550 copy.staticElement = node.staticElement;
10102 return copy; 10551 return copy;
10103 } 10552 }
10104 10553
10105 @override 10554 @override
10106 RethrowExpression visitRethrowExpression(RethrowExpression node) { 10555 RethrowExpression visitRethrowExpression(RethrowExpression node) {
10107 RethrowExpression copy = 10556 RethrowExpression copy =
10108 new RethrowExpression(_mapToken(node.rethrowKeyword)); 10557 new RethrowExpression(_mapToken(node.rethrowKeyword));
10109 copy.propagatedType = node.propagatedType; 10558 copy.propagatedType = node.propagatedType;
10110 copy.staticType = node.staticType; 10559 copy.staticType = node.staticType;
10111 return copy; 10560 return copy;
10112 } 10561 }
10113 10562
10114 @override 10563 @override
10115 ReturnStatement visitReturnStatement(ReturnStatement node) => 10564 ReturnStatement visitReturnStatement(ReturnStatement node) =>
10116 new ReturnStatement(_mapToken(node.returnKeyword), 10565 new ReturnStatement(_mapToken(node.returnKeyword),
10117 _cloneNode(node.expression), _mapToken(node.semicolon)); 10566 _cloneNode(node.expression), _mapToken(node.semicolon));
10118 10567
10119 @override 10568 @override
10120 ScriptTag visitScriptTag(ScriptTag node) => 10569 ScriptTag visitScriptTag(ScriptTag node) =>
10121 new ScriptTag(_mapToken(node.scriptTag)); 10570 new ScriptTag(_mapToken(node.scriptTag));
10122 10571
10123 @override 10572 @override
10124 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 10573 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
10125 _mapToken(node.keyword), _cloneNodeList(node.shownNames)); 10574 _mapToken(node.keyword), _cloneNodeList(node.shownNames));
10126 10575
10127 @override 10576 @override
10128 SimpleFormalParameter visitSimpleFormalParameter( 10577 SimpleFormalParameter visitSimpleFormalParameter(
10129 SimpleFormalParameter node) => new SimpleFormalParameter( 10578 SimpleFormalParameter node) =>
10130 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10579 new SimpleFormalParameter(
10131 _mapToken(node.keyword), _cloneNode(node.type), 10580 _cloneNode(node.documentationComment),
10132 _cloneNode(node.identifier)); 10581 _cloneNodeList(node.metadata),
10582 _mapToken(node.keyword),
10583 _cloneNode(node.type),
10584 _cloneNode(node.identifier));
10133 10585
10134 @override 10586 @override
10135 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 10587 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
10136 Token mappedToken = _mapToken(node.token); 10588 Token mappedToken = _mapToken(node.token);
10137 if (mappedToken == null) { 10589 if (mappedToken == null) {
10138 // This only happens for SimpleIdentifiers created by the parser as part 10590 // This only happens for SimpleIdentifiers created by the parser as part
10139 // of scanning documentation comments (the tokens for those identifiers 10591 // of scanning documentation comments (the tokens for those identifiers
10140 // are not in the original token stream and hence do not get copied). 10592 // are not in the original token stream and hence do not get copied).
10141 // This extra check can be removed if the scanner is changed to scan 10593 // This extra check can be removed if the scanner is changed to scan
10142 // documentation comments for the parser. 10594 // documentation comments for the parser.
(...skipping 23 matching lines...)
10166 new StringInterpolation(_cloneNodeList(node.elements)); 10618 new StringInterpolation(_cloneNodeList(node.elements));
10167 copy.propagatedType = node.propagatedType; 10619 copy.propagatedType = node.propagatedType;
10168 copy.staticType = node.staticType; 10620 copy.staticType = node.staticType;
10169 return copy; 10621 return copy;
10170 } 10622 }
10171 10623
10172 @override 10624 @override
10173 SuperConstructorInvocation visitSuperConstructorInvocation( 10625 SuperConstructorInvocation visitSuperConstructorInvocation(
10174 SuperConstructorInvocation node) { 10626 SuperConstructorInvocation node) {
10175 SuperConstructorInvocation copy = new SuperConstructorInvocation( 10627 SuperConstructorInvocation copy = new SuperConstructorInvocation(
10176 _mapToken(node.superKeyword), _mapToken(node.period), 10628 _mapToken(node.superKeyword),
10177 _cloneNode(node.constructorName), _cloneNode(node.argumentList)); 10629 _mapToken(node.period),
10630 _cloneNode(node.constructorName),
10631 _cloneNode(node.argumentList));
10178 copy.staticElement = node.staticElement; 10632 copy.staticElement = node.staticElement;
10179 return copy; 10633 return copy;
10180 } 10634 }
10181 10635
10182 @override 10636 @override
10183 SuperExpression visitSuperExpression(SuperExpression node) { 10637 SuperExpression visitSuperExpression(SuperExpression node) {
10184 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword)); 10638 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword));
10185 copy.propagatedType = node.propagatedType; 10639 copy.propagatedType = node.propagatedType;
10186 copy.staticType = node.staticType; 10640 copy.staticType = node.staticType;
10187 return copy; 10641 return copy;
10188 } 10642 }
10189 10643
10190 @override 10644 @override
10191 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 10645 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
10192 _cloneNodeList(node.labels), _mapToken(node.keyword), 10646 _cloneNodeList(node.labels),
10193 _cloneNode(node.expression), _mapToken(node.colon), 10647 _mapToken(node.keyword),
10648 _cloneNode(node.expression),
10649 _mapToken(node.colon),
10194 _cloneNodeList(node.statements)); 10650 _cloneNodeList(node.statements));
10195 10651
10196 @override 10652 @override
10197 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 10653 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
10198 _cloneNodeList(node.labels), _mapToken(node.keyword), 10654 _cloneNodeList(node.labels),
10199 _mapToken(node.colon), _cloneNodeList(node.statements)); 10655 _mapToken(node.keyword),
10656 _mapToken(node.colon),
10657 _cloneNodeList(node.statements));
10200 10658
10201 @override 10659 @override
10202 SwitchStatement visitSwitchStatement(SwitchStatement node) => 10660 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
10203 new SwitchStatement(_mapToken(node.switchKeyword), 10661 new SwitchStatement(
10204 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10662 _mapToken(node.switchKeyword),
10205 _mapToken(node.rightParenthesis), _mapToken(node.leftBracket), 10663 _mapToken(node.leftParenthesis),
10206 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 10664 _cloneNode(node.expression),
10665 _mapToken(node.rightParenthesis),
10666 _mapToken(node.leftBracket),
10667 _cloneNodeList(node.members),
10668 _mapToken(node.rightBracket));
10207 10669
10208 @override 10670 @override
10209 AstNode visitSymbolLiteral(SymbolLiteral node) { 10671 AstNode visitSymbolLiteral(SymbolLiteral node) {
10210 SymbolLiteral copy = new SymbolLiteral( 10672 SymbolLiteral copy = new SymbolLiteral(
10211 _mapToken(node.poundSign), _mapTokens(node.components)); 10673 _mapToken(node.poundSign), _mapTokens(node.components));
10212 copy.propagatedType = node.propagatedType; 10674 copy.propagatedType = node.propagatedType;
10213 copy.staticType = node.staticType; 10675 copy.staticType = node.staticType;
10214 return copy; 10676 return copy;
10215 } 10677 }
10216 10678
10217 @override 10679 @override
10218 ThisExpression visitThisExpression(ThisExpression node) { 10680 ThisExpression visitThisExpression(ThisExpression node) {
10219 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword)); 10681 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword));
10220 copy.propagatedType = node.propagatedType; 10682 copy.propagatedType = node.propagatedType;
10221 copy.staticType = node.staticType; 10683 copy.staticType = node.staticType;
10222 return copy; 10684 return copy;
10223 } 10685 }
10224 10686
10225 @override 10687 @override
10226 ThrowExpression visitThrowExpression(ThrowExpression node) { 10688 ThrowExpression visitThrowExpression(ThrowExpression node) {
10227 ThrowExpression copy = new ThrowExpression( 10689 ThrowExpression copy = new ThrowExpression(
10228 _mapToken(node.throwKeyword), _cloneNode(node.expression)); 10690 _mapToken(node.throwKeyword), _cloneNode(node.expression));
10229 copy.propagatedType = node.propagatedType; 10691 copy.propagatedType = node.propagatedType;
10230 copy.staticType = node.staticType; 10692 copy.staticType = node.staticType;
10231 return copy; 10693 return copy;
10232 } 10694 }
10233 10695
10234 @override 10696 @override
10235 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 10697 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
10236 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 10698 TopLevelVariableDeclaration node) =>
10237 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10699 new TopLevelVariableDeclaration(
10238 _cloneNode(node.variables), _mapToken(node.semicolon)); 10700 _cloneNode(node.documentationComment),
10701 _cloneNodeList(node.metadata),
10702 _cloneNode(node.variables),
10703 _mapToken(node.semicolon));
10239 10704
10240 @override 10705 @override
10241 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 10706 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
10242 _mapToken(node.tryKeyword), _cloneNode(node.body), 10707 _mapToken(node.tryKeyword),
10243 _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword), 10708 _cloneNode(node.body),
10709 _cloneNodeList(node.catchClauses),
10710 _mapToken(node.finallyKeyword),
10244 _cloneNode(node.finallyBlock)); 10711 _cloneNode(node.finallyBlock));
10245 10712
10246 @override 10713 @override
10247 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 10714 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
10248 new TypeArgumentList(_mapToken(node.leftBracket), 10715 new TypeArgumentList(_mapToken(node.leftBracket),
10249 _cloneNodeList(node.arguments), _mapToken(node.rightBracket)); 10716 _cloneNodeList(node.arguments), _mapToken(node.rightBracket));
10250 10717
10251 @override 10718 @override
10252 TypeName visitTypeName(TypeName node) { 10719 TypeName visitTypeName(TypeName node) {
10253 TypeName copy = 10720 TypeName copy =
10254 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments)); 10721 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
10255 copy.type = node.type; 10722 copy.type = node.type;
10256 return copy; 10723 return copy;
10257 } 10724 }
10258 10725
10259 @override 10726 @override
10260 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 10727 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
10261 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10728 _cloneNode(node.documentationComment),
10262 _cloneNode(node.name), _mapToken(node.extendsKeyword), 10729 _cloneNodeList(node.metadata),
10730 _cloneNode(node.name),
10731 _mapToken(node.extendsKeyword),
10263 _cloneNode(node.bound)); 10732 _cloneNode(node.bound));
10264 10733
10265 @override 10734 @override
10266 TypeParameterList visitTypeParameterList(TypeParameterList node) => 10735 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
10267 new TypeParameterList(_mapToken(node.leftBracket), 10736 new TypeParameterList(_mapToken(node.leftBracket),
10268 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); 10737 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket));
10269 10738
10270 @override 10739 @override
10271 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 10740 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
10272 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals), 10741 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals),
10273 _cloneNode(node.initializer)); 10742 _cloneNode(node.initializer));
10274 10743
10275 @override 10744 @override
10276 VariableDeclarationList visitVariableDeclarationList( 10745 VariableDeclarationList visitVariableDeclarationList(
10277 VariableDeclarationList node) => new VariableDeclarationList(null, 10746 VariableDeclarationList node) =>
10278 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10747 new VariableDeclarationList(
10279 _cloneNode(node.type), _cloneNodeList(node.variables)); 10748 null,
10749 _cloneNodeList(node.metadata),
10750 _mapToken(node.keyword),
10751 _cloneNode(node.type),
10752 _cloneNodeList(node.variables));
10280 10753
10281 @override 10754 @override
10282 VariableDeclarationStatement visitVariableDeclarationStatement( 10755 VariableDeclarationStatement visitVariableDeclarationStatement(
10283 VariableDeclarationStatement node) => new VariableDeclarationStatement( 10756 VariableDeclarationStatement node) =>
10284 _cloneNode(node.variables), _mapToken(node.semicolon)); 10757 new VariableDeclarationStatement(
10758 _cloneNode(node.variables), _mapToken(node.semicolon));
10285 10759
10286 @override 10760 @override
10287 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 10761 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
10288 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10762 _mapToken(node.whileKeyword),
10289 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10763 _mapToken(node.leftParenthesis),
10764 _cloneNode(node.condition),
10765 _mapToken(node.rightParenthesis),
10290 _cloneNode(node.body)); 10766 _cloneNode(node.body));
10291 10767
10292 @override 10768 @override
10293 WithClause visitWithClause(WithClause node) => new WithClause( 10769 WithClause visitWithClause(WithClause node) => new WithClause(
10294 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes)); 10770 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
10295 10771
10296 @override 10772 @override
10297 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 10773 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
10298 _mapToken(node.yieldKeyword), _mapToken(node.star), 10774 _mapToken(node.yieldKeyword),
10299 _cloneNode(node.expression), _mapToken(node.semicolon)); 10775 _mapToken(node.star),
10776 _cloneNode(node.expression),
10777 _mapToken(node.semicolon));
10300 10778
10301 AstNode _cloneNode(AstNode node) { 10779 AstNode _cloneNode(AstNode node) {
10302 if (node == null) { 10780 if (node == null) {
10303 return null; 10781 return null;
10304 } 10782 }
10305 if (identical(node, _oldNode)) { 10783 if (identical(node, _oldNode)) {
10306 return _newNode; 10784 return _newNode;
10307 } 10785 }
10308 return node.accept(this) as AstNode; 10786 return node.accept(this) as AstNode;
10309 } 10787 }
(...skipping 1262 matching lines...)
11572 * Initialize a newly created method declaration. Either or both of the 12050 * Initialize a newly created method declaration. Either or both of the
11573 * [comment] and [metadata] can be `null` if the declaration does not have the 12051 * [comment] and [metadata] can be `null` if the declaration does not have the
11574 * corresponding attribute. The [externalKeyword] can be `null` if the method 12052 * corresponding attribute. The [externalKeyword] can be `null` if the method
11575 * is not external. The [modifierKeyword] can be `null` if the method is 12053 * is not external. The [modifierKeyword] can be `null` if the method is
11576 * neither abstract nor static. The [returnType] can be `null` if no return 12054 * neither abstract nor static. The [returnType] can be `null` if no return
11577 * type was specified. The [propertyKeyword] can be `null` if the method is 12055 * type was specified. The [propertyKeyword] can be `null` if the method is
11578 * neither a getter or a setter. The [operatorKeyword] can be `null` if the 12056 * neither a getter or a setter. The [operatorKeyword] can be `null` if the
11579 * method does not implement an operator. The [parameters] must be `null` if 12057 * method does not implement an operator. The [parameters] must be `null` if
11580 * this method declares a getter. 12058 * this method declares a getter.
11581 */ 12059 */
11582 MethodDeclaration(Comment comment, List<Annotation> metadata, 12060 MethodDeclaration(
11583 this.externalKeyword, this.modifierKeyword, TypeName returnType, 12061 Comment comment,
11584 this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name, 12062 List<Annotation> metadata,
11585 TypeParameterList typeParameters, FormalParameterList parameters, 12063 this.externalKeyword,
12064 this.modifierKeyword,
12065 TypeName returnType,
12066 this.propertyKeyword,
12067 this.operatorKeyword,
12068 SimpleIdentifier name,
12069 TypeParameterList typeParameters,
12070 FormalParameterList parameters,
11586 FunctionBody body) 12071 FunctionBody body)
11587 : super(comment, metadata) { 12072 : super(comment, metadata) {
11588 _returnType = _becomeParentOf(returnType); 12073 _returnType = _becomeParentOf(returnType);
11589 _name = _becomeParentOf(name); 12074 _name = _becomeParentOf(name);
11590 _typeParameters = _becomeParentOf(typeParameters); 12075 _typeParameters = _becomeParentOf(typeParameters);
11591 _parameters = _becomeParentOf(parameters); 12076 _parameters = _becomeParentOf(parameters);
11592 _body = _becomeParentOf(body); 12077 _body = _becomeParentOf(body);
11593 } 12078 }
11594 12079
11595 /** 12080 /**
(...skipping 183 matching lines...)
11779 12264
11780 /** 12265 /**
11781 * The list of arguments to the method. 12266 * The list of arguments to the method.
11782 */ 12267 */
11783 ArgumentList _argumentList; 12268 ArgumentList _argumentList;
11784 12269
11785 /** 12270 /**
11786 * Initialize a newly created method invocation. The [target] and [operator] 12271 * Initialize a newly created method invocation. The [target] and [operator]
11787 * can be `null` if there is no target. 12272 * can be `null` if there is no target.
11788 */ 12273 */
11789 MethodInvocation(Expression target, this.operator, 12274 MethodInvocation(
11790 SimpleIdentifier methodName, TypeArgumentList typeArguments, 12275 Expression target,
12276 this.operator,
12277 SimpleIdentifier methodName,
12278 TypeArgumentList typeArguments,
11791 ArgumentList argumentList) { 12279 ArgumentList argumentList) {
11792 _target = _becomeParentOf(target); 12280 _target = _becomeParentOf(target);
11793 _methodName = _becomeParentOf(methodName); 12281 _methodName = _becomeParentOf(methodName);
11794 _typeArguments = _becomeParentOf(typeArguments); 12282 _typeArguments = _becomeParentOf(typeArguments);
11795 _argumentList = _becomeParentOf(argumentList); 12283 _argumentList = _becomeParentOf(argumentList);
11796 } 12284 }
11797 12285
11798 /** 12286 /**
11799 * Return the list of arguments to the method. 12287 * Return the list of arguments to the method.
11800 */ 12288 */
(...skipping 779 matching lines...)
12580 } 13068 }
12581 return visitNode(node); 13069 return visitNode(node);
12582 } 13070 }
12583 13071
12584 @override 13072 @override
12585 bool visitAssertStatement(AssertStatement node) { 13073 bool visitAssertStatement(AssertStatement node) {
12586 if (identical(node.condition, _oldNode)) { 13074 if (identical(node.condition, _oldNode)) {
12587 node.condition = _newNode as Expression; 13075 node.condition = _newNode as Expression;
12588 return true; 13076 return true;
12589 } 13077 }
13078 if (identical(node._message, _oldNode)) {
13079 node.message = _newNode as Expression;
13080 return true;
13081 }
12590 return visitNode(node); 13082 return visitNode(node);
12591 } 13083 }
12592 13084
12593 @override 13085 @override
12594 bool visitAssignmentExpression(AssignmentExpression node) { 13086 bool visitAssignmentExpression(AssignmentExpression node) {
12595 if (identical(node.leftHandSide, _oldNode)) { 13087 if (identical(node.leftHandSide, _oldNode)) {
12596 node.leftHandSide = _newNode as Expression; 13088 node.leftHandSide = _newNode as Expression;
12597 return true; 13089 return true;
12598 } else if (identical(node.rightHandSide, _oldNode)) { 13090 } else if (identical(node.rightHandSide, _oldNode)) {
12599 node.rightHandSide = _newNode as Expression; 13091 node.rightHandSide = _newNode as Expression;
(...skipping 3407 matching lines...)
16007 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; 16499 R visitPrefixedIdentifier(PrefixedIdentifier node) => null;
16008 16500
16009 @override 16501 @override
16010 R visitPrefixExpression(PrefixExpression node) => null; 16502 R visitPrefixExpression(PrefixExpression node) => null;
16011 16503
16012 @override 16504 @override
16013 R visitPropertyAccess(PropertyAccess node) => null; 16505 R visitPropertyAccess(PropertyAccess node) => null;
16014 16506
16015 @override 16507 @override
16016 R visitRedirectingConstructorInvocation( 16508 R visitRedirectingConstructorInvocation(
16017 RedirectingConstructorInvocation node) => null; 16509 RedirectingConstructorInvocation node) =>
16510 null;
16018 16511
16019 @override 16512 @override
16020 R visitRethrowExpression(RethrowExpression node) => null; 16513 R visitRethrowExpression(RethrowExpression node) => null;
16021 16514
16022 @override 16515 @override
16023 R visitReturnStatement(ReturnStatement node) => null; 16516 R visitReturnStatement(ReturnStatement node) => null;
16024 16517
16025 @override 16518 @override
16026 R visitScriptTag(ScriptTag node) => null; 16519 R visitScriptTag(ScriptTag node) => null;
16027 16520
(...skipping 1200 matching lines...)
17228 17721
17229 /** 17722 /**
17230 * The right curly bracket. 17723 * The right curly bracket.
17231 */ 17724 */
17232 Token rightBracket; 17725 Token rightBracket;
17233 17726
17234 /** 17727 /**
17235 * Initialize a newly created switch statement. The list of [members] can be 17728 * Initialize a newly created switch statement. The list of [members] can be
17236 * `null` if there are no switch members. 17729 * `null` if there are no switch members.
17237 */ 17730 */
17238 SwitchStatement(this.switchKeyword, this.leftParenthesis, 17731 SwitchStatement(
17239 Expression expression, this.rightParenthesis, this.leftBracket, 17732 this.switchKeyword,
17240 List<SwitchMember> members, this.rightBracket) { 17733 this.leftParenthesis,
17734 Expression expression,
17735 this.rightParenthesis,
17736 this.leftBracket,
17737 List<SwitchMember> members,
17738 this.rightBracket) {
17241 _expression = _becomeParentOf(expression); 17739 _expression = _becomeParentOf(expression);
17242 _members = new NodeList<SwitchMember>(this, members); 17740 _members = new NodeList<SwitchMember>(this, members);
17243 } 17741 }
17244 17742
17245 @override 17743 @override
17246 Token get beginToken => switchKeyword; 17744 Token get beginToken => switchKeyword;
17247 17745
17248 @override 17746 @override
17249 Iterable get childEntities => new ChildEntities() 17747 Iterable get childEntities => new ChildEntities()
17250 ..add(switchKeyword) 17748 ..add(switchKeyword)
(...skipping 334 matching lines...)
17585 _visitNode(node.expression); 18083 _visitNode(node.expression);
17586 _writer.print(" as "); 18084 _writer.print(" as ");
17587 _visitNode(node.type); 18085 _visitNode(node.type);
17588 return null; 18086 return null;
17589 } 18087 }
17590 18088
17591 @override 18089 @override
17592 Object visitAssertStatement(AssertStatement node) { 18090 Object visitAssertStatement(AssertStatement node) {
17593 _writer.print("assert ("); 18091 _writer.print("assert (");
17594 _visitNode(node.condition); 18092 _visitNode(node.condition);
18093 if (node.message != null) {
18094 _writer.print(', ');
18095 _visitNode(node.message);
18096 }
17595 _writer.print(");"); 18097 _writer.print(");");
17596 return null; 18098 return null;
17597 } 18099 }
17598 18100
17599 @override 18101 @override
17600 Object visitAssignmentExpression(AssignmentExpression node) { 18102 Object visitAssignmentExpression(AssignmentExpression node) {
17601 _visitNode(node.leftHandSide); 18103 _visitNode(node.leftHandSide);
17602 _writer.print(' '); 18104 _writer.print(' ');
17603 _writer.print(node.operator.lexeme); 18105 _writer.print(node.operator.lexeme);
17604 _writer.print(' '); 18106 _writer.print(' ');
(...skipping 1846 matching lines...)
19451 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node); 19953 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node);
19452 19954
19453 @override 19955 @override
19454 R visitPrefixExpression(PrefixExpression node) => visitNode(node); 19956 R visitPrefixExpression(PrefixExpression node) => visitNode(node);
19455 19957
19456 @override 19958 @override
19457 R visitPropertyAccess(PropertyAccess node) => visitNode(node); 19959 R visitPropertyAccess(PropertyAccess node) => visitNode(node);
19458 19960
19459 @override 19961 @override
19460 R visitRedirectingConstructorInvocation( 19962 R visitRedirectingConstructorInvocation(
19461 RedirectingConstructorInvocation node) => visitNode(node); 19963 RedirectingConstructorInvocation node) =>
19964 visitNode(node);
19462 19965
19463 @override 19966 @override
19464 R visitRethrowExpression(RethrowExpression node) => visitNode(node); 19967 R visitRethrowExpression(RethrowExpression node) => visitNode(node);
19465 19968
19466 @override 19969 @override
19467 R visitReturnStatement(ReturnStatement node) => visitNode(node); 19970 R visitReturnStatement(ReturnStatement node) => visitNode(node);
19468 19971
19469 @override 19972 @override
19470 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 19973 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
19471 19974
(...skipping 733 matching lines...)
20205 } 20708 }
20206 20709
20207 @override 20710 @override
20208 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); 20711 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
20209 20712
20210 @override 20713 @override
20211 void visitChildren(AstVisitor visitor) { 20714 void visitChildren(AstVisitor visitor) {
20212 _safelyVisitChild(_expression, visitor); 20715 _safelyVisitChild(_expression, visitor);
20213 } 20716 }
20214 } 20717 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/context/context.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine