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

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

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packages/analyzer/lib/src/error.dart ('k') | packages/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information.
7
8 library engine.ast; 5 library engine.ast;
9 6
10 import 'dart:collection'; 7 import 'dart:collection';
11 8
12 import 'element.dart'; 9 import 'element.dart';
13 import 'engine.dart' show AnalysisEngine; 10 import 'engine.dart' show AnalysisEngine;
14 import 'java_core.dart'; 11 import 'java_core.dart';
15 import 'java_engine.dart'; 12 import 'java_engine.dart';
16 import 'parser.dart'; 13 import 'parser.dart';
17 import 'scanner.dart'; 14 import 'scanner.dart';
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 * A flag indicating whether tokens should be cloned while cloning an AST 956 * A flag indicating whether tokens should be cloned while cloning an AST
960 * structure. 957 * structure.
961 */ 958 */
962 final bool cloneTokens; 959 final bool cloneTokens;
963 960
964 /** 961 /**
965 * Initialize a newly created AST cloner to optionally clone tokens while 962 * Initialize a newly created AST cloner to optionally clone tokens while
966 * cloning AST nodes if [cloneTokens] is `true`. 963 * cloning AST nodes if [cloneTokens] is `true`.
967 */ 964 */
968 AstCloner( 965 AstCloner(
969 [this.cloneTokens = false]); // TODO(brianwilkerson) Change this to be a n amed parameter. 966 [this.cloneTokens =
967 false]); // TODO(brianwilkerson) Change this to be a named parameter.
970 968
971 /** 969 /**
972 * Return a clone of the given [node]. 970 * Return a clone of the given [node].
973 */ 971 */
974 AstNode cloneNode(AstNode node) { 972 AstNode cloneNode(AstNode node) {
975 if (node == null) { 973 if (node == null) {
976 return null; 974 return null;
977 } 975 }
978 return node.accept(this) as AstNode; 976 return node.accept(this) as AstNode;
979 } 977 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 } 1009 }
1012 return tokens; 1010 return tokens;
1013 } 1011 }
1014 1012
1015 @override 1013 @override
1016 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 1014 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
1017 new AdjacentStrings(cloneNodeList(node.strings)); 1015 new AdjacentStrings(cloneNodeList(node.strings));
1018 1016
1019 @override 1017 @override
1020 Annotation visitAnnotation(Annotation node) => new Annotation( 1018 Annotation visitAnnotation(Annotation node) => new Annotation(
1021 cloneToken(node.atSign), cloneNode(node.name), cloneToken(node.period), 1019 cloneToken(node.atSign),
1022 cloneNode(node.constructorName), cloneNode(node.arguments)); 1020 cloneNode(node.name),
1021 cloneToken(node.period),
1022 cloneNode(node.constructorName),
1023 cloneNode(node.arguments));
1023 1024
1024 @override 1025 @override
1025 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 1026 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
1026 cloneToken(node.leftParenthesis), cloneNodeList(node.arguments), 1027 cloneToken(node.leftParenthesis),
1028 cloneNodeList(node.arguments),
1027 cloneToken(node.rightParenthesis)); 1029 cloneToken(node.rightParenthesis));
1028 1030
1029 @override 1031 @override
1030 AsExpression visitAsExpression(AsExpression node) => new AsExpression( 1032 AsExpression visitAsExpression(AsExpression node) => new AsExpression(
1031 cloneNode(node.expression), cloneToken(node.asOperator), 1033 cloneNode(node.expression),
1034 cloneToken(node.asOperator),
1032 cloneNode(node.type)); 1035 cloneNode(node.type));
1033 1036
1034 @override 1037 @override
1035 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 1038 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
1036 cloneToken(node.assertKeyword), cloneToken(node.leftParenthesis), 1039 cloneToken(node.assertKeyword),
1037 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1040 cloneToken(node.leftParenthesis),
1041 cloneNode(node.condition),
1042 cloneToken(node.rightParenthesis),
1038 cloneToken(node.semicolon)); 1043 cloneToken(node.semicolon));
1039 1044
1040 @override 1045 @override
1041 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => 1046 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) =>
1042 new AssignmentExpression(cloneNode(node.leftHandSide), 1047 new AssignmentExpression(cloneNode(node.leftHandSide),
1043 cloneToken(node.operator), cloneNode(node.rightHandSide)); 1048 cloneToken(node.operator), cloneNode(node.rightHandSide));
1044 1049
1045 @override 1050 @override
1046 AwaitExpression visitAwaitExpression(AwaitExpression node) => 1051 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
1047 new AwaitExpression( 1052 new AwaitExpression(
1048 cloneToken(node.awaitKeyword), cloneNode(node.expression)); 1053 cloneToken(node.awaitKeyword), cloneNode(node.expression));
1049 1054
1050 @override 1055 @override
1051 BinaryExpression visitBinaryExpression(BinaryExpression node) => 1056 BinaryExpression visitBinaryExpression(BinaryExpression node) =>
1052 new BinaryExpression(cloneNode(node.leftOperand), 1057 new BinaryExpression(cloneNode(node.leftOperand),
1053 cloneToken(node.operator), cloneNode(node.rightOperand)); 1058 cloneToken(node.operator), cloneNode(node.rightOperand));
1054 1059
1055 @override 1060 @override
1056 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket), 1061 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket),
1057 cloneNodeList(node.statements), cloneToken(node.rightBracket)); 1062 cloneNodeList(node.statements), cloneToken(node.rightBracket));
1058 1063
1059 @override 1064 @override
1060 BlockFunctionBody visitBlockFunctionBody( 1065 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
1061 BlockFunctionBody node) => new BlockFunctionBody( 1066 new BlockFunctionBody(cloneToken(node.keyword), cloneToken(node.star),
1062 cloneToken(node.keyword), cloneToken(node.star), cloneNode(node.block)); 1067 cloneNode(node.block));
1063 1068
1064 @override 1069 @override
1065 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => 1070 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
1066 new BooleanLiteral(cloneToken(node.literal), node.value); 1071 new BooleanLiteral(cloneToken(node.literal), node.value);
1067 1072
1068 @override 1073 @override
1069 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 1074 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
1070 cloneToken(node.breakKeyword), cloneNode(node.label), 1075 cloneToken(node.breakKeyword),
1076 cloneNode(node.label),
1071 cloneToken(node.semicolon)); 1077 cloneToken(node.semicolon));
1072 1078
1073 @override 1079 @override
1074 CascadeExpression visitCascadeExpression(CascadeExpression node) => 1080 CascadeExpression visitCascadeExpression(CascadeExpression node) =>
1075 new CascadeExpression( 1081 new CascadeExpression(
1076 cloneNode(node.target), cloneNodeList(node.cascadeSections)); 1082 cloneNode(node.target), cloneNodeList(node.cascadeSections));
1077 1083
1078 @override 1084 @override
1079 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 1085 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
1080 cloneToken(node.onKeyword), cloneNode(node.exceptionType), 1086 cloneToken(node.onKeyword),
1081 cloneToken(node.catchKeyword), cloneToken(node.leftParenthesis), 1087 cloneNode(node.exceptionType),
1082 cloneNode(node.exceptionParameter), cloneToken(node.comma), 1088 cloneToken(node.catchKeyword),
1083 cloneNode(node.stackTraceParameter), cloneToken(node.rightParenthesis), 1089 cloneToken(node.leftParenthesis),
1090 cloneNode(node.exceptionParameter),
1091 cloneToken(node.comma),
1092 cloneNode(node.stackTraceParameter),
1093 cloneToken(node.rightParenthesis),
1084 cloneNode(node.body)); 1094 cloneNode(node.body));
1085 1095
1086 @override 1096 @override
1087 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 1097 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
1088 ClassDeclaration copy = new ClassDeclaration( 1098 ClassDeclaration copy = new ClassDeclaration(
1089 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1099 cloneNode(node.documentationComment),
1090 cloneToken(node.abstractKeyword), cloneToken(node.classKeyword), 1100 cloneNodeList(node.metadata),
1091 cloneNode(node.name), cloneNode(node.typeParameters), 1101 cloneToken(node.abstractKeyword),
1092 cloneNode(node.extendsClause), cloneNode(node.withClause), 1102 cloneToken(node.classKeyword),
1093 cloneNode(node.implementsClause), cloneToken(node.leftBracket), 1103 cloneNode(node.name),
1094 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1104 cloneNode(node.typeParameters),
1105 cloneNode(node.extendsClause),
1106 cloneNode(node.withClause),
1107 cloneNode(node.implementsClause),
1108 cloneToken(node.leftBracket),
1109 cloneNodeList(node.members),
1110 cloneToken(node.rightBracket));
1095 copy.nativeClause = cloneNode(node.nativeClause); 1111 copy.nativeClause = cloneNode(node.nativeClause);
1096 return copy; 1112 return copy;
1097 } 1113 }
1098 1114
1099 @override 1115 @override
1100 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 1116 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
1101 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1117 cloneNode(node.documentationComment),
1102 cloneToken(node.typedefKeyword), cloneNode(node.name), 1118 cloneNodeList(node.metadata),
1103 cloneNode(node.typeParameters), cloneToken(node.equals), 1119 cloneToken(node.typedefKeyword),
1104 cloneToken(node.abstractKeyword), cloneNode(node.superclass), 1120 cloneNode(node.name),
1105 cloneNode(node.withClause), cloneNode(node.implementsClause), 1121 cloneNode(node.typeParameters),
1122 cloneToken(node.equals),
1123 cloneToken(node.abstractKeyword),
1124 cloneNode(node.superclass),
1125 cloneNode(node.withClause),
1126 cloneNode(node.implementsClause),
1106 cloneToken(node.semicolon)); 1127 cloneToken(node.semicolon));
1107 1128
1108 @override 1129 @override
1109 Comment visitComment(Comment node) { 1130 Comment visitComment(Comment node) {
1110 if (node.isDocumentation) { 1131 if (node.isDocumentation) {
1111 return Comment.createDocumentationCommentWithReferences( 1132 return Comment.createDocumentationCommentWithReferences(
1112 cloneTokenList(node.tokens), cloneNodeList(node.references)); 1133 cloneTokenList(node.tokens), cloneNodeList(node.references));
1113 } else if (node.isBlock) { 1134 } else if (node.isBlock) {
1114 return Comment.createBlockComment(cloneTokenList(node.tokens)); 1135 return Comment.createBlockComment(cloneTokenList(node.tokens));
1115 } 1136 }
1116 return Comment.createEndOfLineComment(cloneTokenList(node.tokens)); 1137 return Comment.createEndOfLineComment(cloneTokenList(node.tokens));
1117 } 1138 }
1118 1139
1119 @override 1140 @override
1120 CommentReference visitCommentReference(CommentReference node) => 1141 CommentReference visitCommentReference(CommentReference node) =>
1121 new CommentReference( 1142 new CommentReference(
1122 cloneToken(node.newKeyword), cloneNode(node.identifier)); 1143 cloneToken(node.newKeyword), cloneNode(node.identifier));
1123 1144
1124 @override 1145 @override
1125 CompilationUnit visitCompilationUnit(CompilationUnit node) { 1146 CompilationUnit visitCompilationUnit(CompilationUnit node) {
1126 CompilationUnit clone = new CompilationUnit(cloneToken(node.beginToken), 1147 CompilationUnit clone = new CompilationUnit(
1127 cloneNode(node.scriptTag), cloneNodeList(node.directives), 1148 cloneToken(node.beginToken),
1128 cloneNodeList(node.declarations), cloneToken(node.endToken)); 1149 cloneNode(node.scriptTag),
1150 cloneNodeList(node.directives),
1151 cloneNodeList(node.declarations),
1152 cloneToken(node.endToken));
1129 clone.lineInfo = node.lineInfo; 1153 clone.lineInfo = node.lineInfo;
1130 return clone; 1154 return clone;
1131 } 1155 }
1132 1156
1133 @override 1157 @override
1134 ConditionalExpression visitConditionalExpression( 1158 ConditionalExpression visitConditionalExpression(
1135 ConditionalExpression node) => new ConditionalExpression( 1159 ConditionalExpression node) =>
1136 cloneNode(node.condition), cloneToken(node.question), 1160 new ConditionalExpression(
1137 cloneNode(node.thenExpression), cloneToken(node.colon), 1161 cloneNode(node.condition),
1138 cloneNode(node.elseExpression)); 1162 cloneToken(node.question),
1163 cloneNode(node.thenExpression),
1164 cloneToken(node.colon),
1165 cloneNode(node.elseExpression));
1139 1166
1140 @override 1167 @override
1141 ConstructorDeclaration visitConstructorDeclaration( 1168 ConstructorDeclaration visitConstructorDeclaration(
1142 ConstructorDeclaration node) => new ConstructorDeclaration( 1169 ConstructorDeclaration node) =>
1143 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1170 new ConstructorDeclaration(
1144 cloneToken(node.externalKeyword), cloneToken(node.constKeyword), 1171 cloneNode(node.documentationComment),
1145 cloneToken(node.factoryKeyword), cloneNode(node.returnType), 1172 cloneNodeList(node.metadata),
1146 cloneToken(node.period), cloneNode(node.name), cloneNode(node.parameters), 1173 cloneToken(node.externalKeyword),
1147 cloneToken(node.separator), cloneNodeList(node.initializers), 1174 cloneToken(node.constKeyword),
1148 cloneNode(node.redirectedConstructor), cloneNode(node.body)); 1175 cloneToken(node.factoryKeyword),
1176 cloneNode(node.returnType),
1177 cloneToken(node.period),
1178 cloneNode(node.name),
1179 cloneNode(node.parameters),
1180 cloneToken(node.separator),
1181 cloneNodeList(node.initializers),
1182 cloneNode(node.redirectedConstructor),
1183 cloneNode(node.body));
1149 1184
1150 @override 1185 @override
1151 ConstructorFieldInitializer visitConstructorFieldInitializer( 1186 ConstructorFieldInitializer visitConstructorFieldInitializer(
1152 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 1187 ConstructorFieldInitializer node) =>
1153 cloneToken(node.thisKeyword), cloneToken(node.period), 1188 new ConstructorFieldInitializer(
1154 cloneNode(node.fieldName), cloneToken(node.equals), 1189 cloneToken(node.thisKeyword),
1155 cloneNode(node.expression)); 1190 cloneToken(node.period),
1191 cloneNode(node.fieldName),
1192 cloneToken(node.equals),
1193 cloneNode(node.expression));
1156 1194
1157 @override 1195 @override
1158 ConstructorName visitConstructorName(ConstructorName node) => 1196 ConstructorName visitConstructorName(ConstructorName node) =>
1159 new ConstructorName( 1197 new ConstructorName(
1160 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name)); 1198 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name));
1161 1199
1162 @override 1200 @override
1163 ContinueStatement visitContinueStatement(ContinueStatement node) => 1201 ContinueStatement visitContinueStatement(ContinueStatement node) =>
1164 new ContinueStatement(cloneToken(node.continueKeyword), 1202 new ContinueStatement(cloneToken(node.continueKeyword),
1165 cloneNode(node.label), cloneToken(node.semicolon)); 1203 cloneNode(node.label), cloneToken(node.semicolon));
1166 1204
1167 @override 1205 @override
1168 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 1206 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
1169 new DeclaredIdentifier(cloneNode(node.documentationComment), 1207 new DeclaredIdentifier(
1170 cloneNodeList(node.metadata), cloneToken(node.keyword), 1208 cloneNode(node.documentationComment),
1171 cloneNode(node.type), cloneNode(node.identifier)); 1209 cloneNodeList(node.metadata),
1210 cloneToken(node.keyword),
1211 cloneNode(node.type),
1212 cloneNode(node.identifier));
1172 1213
1173 @override 1214 @override
1174 DefaultFormalParameter visitDefaultFormalParameter( 1215 DefaultFormalParameter visitDefaultFormalParameter(
1175 DefaultFormalParameter node) => new DefaultFormalParameter( 1216 DefaultFormalParameter node) =>
1176 cloneNode(node.parameter), node.kind, cloneToken(node.separator), 1217 new DefaultFormalParameter(cloneNode(node.parameter), node.kind,
1177 cloneNode(node.defaultValue)); 1218 cloneToken(node.separator), cloneNode(node.defaultValue));
1178 1219
1179 @override 1220 @override
1180 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 1221 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
1181 cloneToken(node.doKeyword), cloneNode(node.body), 1222 cloneToken(node.doKeyword),
1182 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1223 cloneNode(node.body),
1183 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1224 cloneToken(node.whileKeyword),
1225 cloneToken(node.leftParenthesis),
1226 cloneNode(node.condition),
1227 cloneToken(node.rightParenthesis),
1184 cloneToken(node.semicolon)); 1228 cloneToken(node.semicolon));
1185 1229
1186 @override 1230 @override
1187 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => 1231 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) =>
1188 new DoubleLiteral(cloneToken(node.literal), node.value); 1232 new DoubleLiteral(cloneToken(node.literal), node.value);
1189 1233
1190 @override 1234 @override
1191 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 1235 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
1192 new EmptyFunctionBody(cloneToken(node.semicolon)); 1236 new EmptyFunctionBody(cloneToken(node.semicolon));
1193 1237
1194 @override 1238 @override
1195 EmptyStatement visitEmptyStatement(EmptyStatement node) => 1239 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
1196 new EmptyStatement(cloneToken(node.semicolon)); 1240 new EmptyStatement(cloneToken(node.semicolon));
1197 1241
1198 @override 1242 @override
1199 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 1243 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
1200 new EnumConstantDeclaration(cloneNode(node.documentationComment), 1244 new EnumConstantDeclaration(cloneNode(node.documentationComment),
1201 cloneNodeList(node.metadata), cloneNode(node.name)); 1245 cloneNodeList(node.metadata), cloneNode(node.name));
1202 1246
1203 @override 1247 @override
1204 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) => 1248 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
1205 new EnumDeclaration(cloneNode(node.documentationComment), 1249 new EnumDeclaration(
1206 cloneNodeList(node.metadata), cloneToken(node.enumKeyword), 1250 cloneNode(node.documentationComment),
1207 cloneNode(node.name), cloneToken(node.leftBracket), 1251 cloneNodeList(node.metadata),
1208 cloneNodeList(node.constants), cloneToken(node.rightBracket)); 1252 cloneToken(node.enumKeyword),
1253 cloneNode(node.name),
1254 cloneToken(node.leftBracket),
1255 cloneNodeList(node.constants),
1256 cloneToken(node.rightBracket));
1209 1257
1210 @override 1258 @override
1211 ExportDirective visitExportDirective(ExportDirective node) { 1259 ExportDirective visitExportDirective(ExportDirective node) {
1212 ExportDirective directive = new ExportDirective( 1260 ExportDirective directive = new ExportDirective(
1213 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1261 cloneNode(node.documentationComment),
1214 cloneToken(node.keyword), cloneNode(node.uri), 1262 cloneNodeList(node.metadata),
1215 cloneNodeList(node.combinators), cloneToken(node.semicolon)); 1263 cloneToken(node.keyword),
1264 cloneNode(node.uri),
1265 cloneNodeList(node.combinators),
1266 cloneToken(node.semicolon));
1216 directive.source = node.source; 1267 directive.source = node.source;
1217 directive.uriContent = node.uriContent; 1268 directive.uriContent = node.uriContent;
1218 return directive; 1269 return directive;
1219 } 1270 }
1220 1271
1221 @override 1272 @override
1222 ExpressionFunctionBody visitExpressionFunctionBody( 1273 ExpressionFunctionBody visitExpressionFunctionBody(
1223 ExpressionFunctionBody node) => new ExpressionFunctionBody( 1274 ExpressionFunctionBody node) =>
1224 cloneToken(node.keyword), cloneToken(node.functionDefinition), 1275 new ExpressionFunctionBody(
1225 cloneNode(node.expression), cloneToken(node.semicolon)); 1276 cloneToken(node.keyword),
1277 cloneToken(node.functionDefinition),
1278 cloneNode(node.expression),
1279 cloneToken(node.semicolon));
1226 1280
1227 @override 1281 @override
1228 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 1282 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
1229 new ExpressionStatement( 1283 new ExpressionStatement(
1230 cloneNode(node.expression), cloneToken(node.semicolon)); 1284 cloneNode(node.expression), cloneToken(node.semicolon));
1231 1285
1232 @override 1286 @override
1233 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 1287 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
1234 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); 1288 cloneToken(node.extendsKeyword), cloneNode(node.superclass));
1235 1289
1236 @override 1290 @override
1237 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 1291 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
1238 new FieldDeclaration(cloneNode(node.documentationComment), 1292 new FieldDeclaration(
1239 cloneNodeList(node.metadata), cloneToken(node.staticKeyword), 1293 cloneNode(node.documentationComment),
1240 cloneNode(node.fields), cloneToken(node.semicolon)); 1294 cloneNodeList(node.metadata),
1295 cloneToken(node.staticKeyword),
1296 cloneNode(node.fields),
1297 cloneToken(node.semicolon));
1241 1298
1242 @override 1299 @override
1243 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 1300 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
1244 new FieldFormalParameter(cloneNode(node.documentationComment), 1301 new FieldFormalParameter(
1245 cloneNodeList(node.metadata), cloneToken(node.keyword), 1302 cloneNode(node.documentationComment),
1246 cloneNode(node.type), cloneToken(node.thisKeyword), 1303 cloneNodeList(node.metadata),
1247 cloneToken(node.period), cloneNode(node.identifier), 1304 cloneToken(node.keyword),
1248 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1305 cloneNode(node.type),
1306 cloneToken(node.thisKeyword),
1307 cloneToken(node.period),
1308 cloneNode(node.identifier),
1309 cloneNode(node.typeParameters),
1310 cloneNode(node.parameters));
1249 1311
1250 @override 1312 @override
1251 ForEachStatement visitForEachStatement(ForEachStatement node) { 1313 ForEachStatement visitForEachStatement(ForEachStatement node) {
1252 DeclaredIdentifier loopVariable = node.loopVariable; 1314 DeclaredIdentifier loopVariable = node.loopVariable;
1253 if (loopVariable == null) { 1315 if (loopVariable == null) {
1254 return new ForEachStatement.withReference(cloneToken(node.awaitKeyword), 1316 return new ForEachStatement.withReference(
1255 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1317 cloneToken(node.awaitKeyword),
1256 cloneNode(node.identifier), cloneToken(node.inKeyword), 1318 cloneToken(node.forKeyword),
1257 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1319 cloneToken(node.leftParenthesis),
1320 cloneNode(node.identifier),
1321 cloneToken(node.inKeyword),
1322 cloneNode(node.iterable),
1323 cloneToken(node.rightParenthesis),
1258 cloneNode(node.body)); 1324 cloneNode(node.body));
1259 } 1325 }
1260 return new ForEachStatement.withDeclaration(cloneToken(node.awaitKeyword), 1326 return new ForEachStatement.withDeclaration(
1261 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1327 cloneToken(node.awaitKeyword),
1262 cloneNode(loopVariable), cloneToken(node.inKeyword), 1328 cloneToken(node.forKeyword),
1263 cloneNode(node.iterable), cloneToken(node.rightParenthesis), 1329 cloneToken(node.leftParenthesis),
1330 cloneNode(loopVariable),
1331 cloneToken(node.inKeyword),
1332 cloneNode(node.iterable),
1333 cloneToken(node.rightParenthesis),
1264 cloneNode(node.body)); 1334 cloneNode(node.body));
1265 } 1335 }
1266 1336
1267 @override 1337 @override
1268 FormalParameterList visitFormalParameterList(FormalParameterList node) => 1338 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
1269 new FormalParameterList(cloneToken(node.leftParenthesis), 1339 new FormalParameterList(
1270 cloneNodeList(node.parameters), cloneToken(node.leftDelimiter), 1340 cloneToken(node.leftParenthesis),
1271 cloneToken(node.rightDelimiter), cloneToken(node.rightParenthesis)); 1341 cloneNodeList(node.parameters),
1342 cloneToken(node.leftDelimiter),
1343 cloneToken(node.rightDelimiter),
1344 cloneToken(node.rightParenthesis));
1272 1345
1273 @override 1346 @override
1274 ForStatement visitForStatement(ForStatement node) => new ForStatement( 1347 ForStatement visitForStatement(ForStatement node) => new ForStatement(
1275 cloneToken(node.forKeyword), cloneToken(node.leftParenthesis), 1348 cloneToken(node.forKeyword),
1276 cloneNode(node.variables), cloneNode(node.initialization), 1349 cloneToken(node.leftParenthesis),
1277 cloneToken(node.leftSeparator), cloneNode(node.condition), 1350 cloneNode(node.variables),
1278 cloneToken(node.rightSeparator), cloneNodeList(node.updaters), 1351 cloneNode(node.initialization),
1279 cloneToken(node.rightParenthesis), cloneNode(node.body)); 1352 cloneToken(node.leftSeparator),
1353 cloneNode(node.condition),
1354 cloneToken(node.rightSeparator),
1355 cloneNodeList(node.updaters),
1356 cloneToken(node.rightParenthesis),
1357 cloneNode(node.body));
1280 1358
1281 @override 1359 @override
1282 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 1360 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
1283 new FunctionDeclaration(cloneNode(node.documentationComment), 1361 new FunctionDeclaration(
1284 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1362 cloneNode(node.documentationComment),
1285 cloneNode(node.returnType), cloneToken(node.propertyKeyword), 1363 cloneNodeList(node.metadata),
1286 cloneNode(node.name), cloneNode(node.functionExpression)); 1364 cloneToken(node.externalKeyword),
1365 cloneNode(node.returnType),
1366 cloneToken(node.propertyKeyword),
1367 cloneNode(node.name),
1368 cloneNode(node.functionExpression));
1287 1369
1288 @override 1370 @override
1289 FunctionDeclarationStatement visitFunctionDeclarationStatement( 1371 FunctionDeclarationStatement visitFunctionDeclarationStatement(
1290 FunctionDeclarationStatement node) => 1372 FunctionDeclarationStatement node) =>
1291 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration)); 1373 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration));
1292 1374
1293 @override 1375 @override
1294 FunctionExpression visitFunctionExpression(FunctionExpression node) => 1376 FunctionExpression visitFunctionExpression(FunctionExpression node) =>
1295 new FunctionExpression(cloneNode(node.typeParameters), 1377 new FunctionExpression(cloneNode(node.typeParameters),
1296 cloneNode(node.parameters), cloneNode(node.body)); 1378 cloneNode(node.parameters), cloneNode(node.body));
1297 1379
1298 @override 1380 @override
1299 FunctionExpressionInvocation visitFunctionExpressionInvocation( 1381 FunctionExpressionInvocation visitFunctionExpressionInvocation(
1300 FunctionExpressionInvocation node) => new FunctionExpressionInvocation( 1382 FunctionExpressionInvocation node) =>
1301 cloneNode(node.function), cloneNode(node.typeArguments), 1383 new FunctionExpressionInvocation(cloneNode(node.function),
1302 cloneNode(node.argumentList)); 1384 cloneNode(node.typeArguments), cloneNode(node.argumentList));
1303 1385
1304 @override 1386 @override
1305 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 1387 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
1306 new FunctionTypeAlias(cloneNode(node.documentationComment), 1388 new FunctionTypeAlias(
1307 cloneNodeList(node.metadata), cloneToken(node.typedefKeyword), 1389 cloneNode(node.documentationComment),
1308 cloneNode(node.returnType), cloneNode(node.name), 1390 cloneNodeList(node.metadata),
1309 cloneNode(node.typeParameters), cloneNode(node.parameters), 1391 cloneToken(node.typedefKeyword),
1392 cloneNode(node.returnType),
1393 cloneNode(node.name),
1394 cloneNode(node.typeParameters),
1395 cloneNode(node.parameters),
1310 cloneToken(node.semicolon)); 1396 cloneToken(node.semicolon));
1311 1397
1312 @override 1398 @override
1313 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 1399 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
1314 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 1400 FunctionTypedFormalParameter node) =>
1315 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1401 new FunctionTypedFormalParameter(
1316 cloneNode(node.returnType), cloneNode(node.identifier), 1402 cloneNode(node.documentationComment),
1317 cloneNode(node.typeParameters), cloneNode(node.parameters)); 1403 cloneNodeList(node.metadata),
1404 cloneNode(node.returnType),
1405 cloneNode(node.identifier),
1406 cloneNode(node.typeParameters),
1407 cloneNode(node.parameters));
1318 1408
1319 @override 1409 @override
1320 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 1410 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
1321 cloneToken(node.keyword), cloneNodeList(node.hiddenNames)); 1411 cloneToken(node.keyword), cloneNodeList(node.hiddenNames));
1322 1412
1323 @override 1413 @override
1324 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 1414 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
1325 cloneToken(node.ifKeyword), cloneToken(node.leftParenthesis), 1415 cloneToken(node.ifKeyword),
1326 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1416 cloneToken(node.leftParenthesis),
1327 cloneNode(node.thenStatement), cloneToken(node.elseKeyword), 1417 cloneNode(node.condition),
1418 cloneToken(node.rightParenthesis),
1419 cloneNode(node.thenStatement),
1420 cloneToken(node.elseKeyword),
1328 cloneNode(node.elseStatement)); 1421 cloneNode(node.elseStatement));
1329 1422
1330 @override 1423 @override
1331 ImplementsClause visitImplementsClause(ImplementsClause node) => 1424 ImplementsClause visitImplementsClause(ImplementsClause node) =>
1332 new ImplementsClause( 1425 new ImplementsClause(
1333 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); 1426 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces));
1334 1427
1335 @override 1428 @override
1336 ImportDirective visitImportDirective(ImportDirective node) { 1429 ImportDirective visitImportDirective(ImportDirective node) {
1337 ImportDirective directive = new ImportDirective( 1430 ImportDirective directive = new ImportDirective(
1338 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1431 cloneNode(node.documentationComment),
1339 cloneToken(node.keyword), cloneNode(node.uri), 1432 cloneNodeList(node.metadata),
1340 cloneToken(node.deferredKeyword), cloneToken(node.asKeyword), 1433 cloneToken(node.keyword),
1341 cloneNode(node.prefix), cloneNodeList(node.combinators), 1434 cloneNode(node.uri),
1435 cloneToken(node.deferredKeyword),
1436 cloneToken(node.asKeyword),
1437 cloneNode(node.prefix),
1438 cloneNodeList(node.combinators),
1342 cloneToken(node.semicolon)); 1439 cloneToken(node.semicolon));
1343 directive.source = node.source; 1440 directive.source = node.source;
1344 directive.uriContent = node.uriContent; 1441 directive.uriContent = node.uriContent;
1345 return directive; 1442 return directive;
1346 } 1443 }
1347 1444
1348 @override 1445 @override
1349 IndexExpression visitIndexExpression(IndexExpression node) { 1446 IndexExpression visitIndexExpression(IndexExpression node) {
1350 Token period = node.period; 1447 Token period = node.period;
1351 if (period == null) { 1448 if (period == null) {
1352 return new IndexExpression.forTarget(cloneNode(node.target), 1449 return new IndexExpression.forTarget(
1353 cloneToken(node.leftBracket), cloneNode(node.index), 1450 cloneNode(node.target),
1451 cloneToken(node.leftBracket),
1452 cloneNode(node.index),
1354 cloneToken(node.rightBracket)); 1453 cloneToken(node.rightBracket));
1355 } else { 1454 } else {
1356 return new IndexExpression.forCascade(cloneToken(period), 1455 return new IndexExpression.forCascade(
1357 cloneToken(node.leftBracket), cloneNode(node.index), 1456 cloneToken(period),
1457 cloneToken(node.leftBracket),
1458 cloneNode(node.index),
1358 cloneToken(node.rightBracket)); 1459 cloneToken(node.rightBracket));
1359 } 1460 }
1360 } 1461 }
1361 1462
1362 @override 1463 @override
1363 InstanceCreationExpression visitInstanceCreationExpression( 1464 InstanceCreationExpression visitInstanceCreationExpression(
1364 InstanceCreationExpression node) => new InstanceCreationExpression( 1465 InstanceCreationExpression node) =>
1365 cloneToken(node.keyword), cloneNode(node.constructorName), 1466 new InstanceCreationExpression(cloneToken(node.keyword),
1366 cloneNode(node.argumentList)); 1467 cloneNode(node.constructorName), cloneNode(node.argumentList));
1367 1468
1368 @override 1469 @override
1369 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => 1470 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
1370 new IntegerLiteral(cloneToken(node.literal), node.value); 1471 new IntegerLiteral(cloneToken(node.literal), node.value);
1371 1472
1372 @override 1473 @override
1373 InterpolationExpression visitInterpolationExpression( 1474 InterpolationExpression visitInterpolationExpression(
1374 InterpolationExpression node) => new InterpolationExpression( 1475 InterpolationExpression node) =>
1375 cloneToken(node.leftBracket), cloneNode(node.expression), 1476 new InterpolationExpression(cloneToken(node.leftBracket),
1376 cloneToken(node.rightBracket)); 1477 cloneNode(node.expression), cloneToken(node.rightBracket));
1377 1478
1378 @override 1479 @override
1379 InterpolationString visitInterpolationString(InterpolationString node) => 1480 InterpolationString visitInterpolationString(InterpolationString node) =>
1380 new InterpolationString(cloneToken(node.contents), node.value); 1481 new InterpolationString(cloneToken(node.contents), node.value);
1381 1482
1382 @override 1483 @override
1383 IsExpression visitIsExpression(IsExpression node) => new IsExpression( 1484 IsExpression visitIsExpression(IsExpression node) => new IsExpression(
1384 cloneNode(node.expression), cloneToken(node.isOperator), 1485 cloneNode(node.expression),
1385 cloneToken(node.notOperator), cloneNode(node.type)); 1486 cloneToken(node.isOperator),
1487 cloneToken(node.notOperator),
1488 cloneNode(node.type));
1386 1489
1387 @override 1490 @override
1388 Label visitLabel(Label node) => 1491 Label visitLabel(Label node) =>
1389 new Label(cloneNode(node.label), cloneToken(node.colon)); 1492 new Label(cloneNode(node.label), cloneToken(node.colon));
1390 1493
1391 @override 1494 @override
1392 LabeledStatement visitLabeledStatement(LabeledStatement node) => 1495 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
1393 new LabeledStatement( 1496 new LabeledStatement(
1394 cloneNodeList(node.labels), cloneNode(node.statement)); 1497 cloneNodeList(node.labels), cloneNode(node.statement));
1395 1498
1396 @override 1499 @override
1397 LibraryDirective visitLibraryDirective(LibraryDirective node) => 1500 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
1398 new LibraryDirective(cloneNode(node.documentationComment), 1501 new LibraryDirective(
1399 cloneNodeList(node.metadata), cloneToken(node.libraryKeyword), 1502 cloneNode(node.documentationComment),
1400 cloneNode(node.name), cloneToken(node.semicolon)); 1503 cloneNodeList(node.metadata),
1504 cloneToken(node.libraryKeyword),
1505 cloneNode(node.name),
1506 cloneToken(node.semicolon));
1401 1507
1402 @override 1508 @override
1403 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => 1509 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
1404 new LibraryIdentifier(cloneNodeList(node.components)); 1510 new LibraryIdentifier(cloneNodeList(node.components));
1405 1511
1406 @override 1512 @override
1407 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral( 1513 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(
1408 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1514 cloneToken(node.constKeyword),
1409 cloneToken(node.leftBracket), cloneNodeList(node.elements), 1515 cloneNode(node.typeArguments),
1516 cloneToken(node.leftBracket),
1517 cloneNodeList(node.elements),
1410 cloneToken(node.rightBracket)); 1518 cloneToken(node.rightBracket));
1411 1519
1412 @override 1520 @override
1413 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral( 1521 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(
1414 cloneToken(node.constKeyword), cloneNode(node.typeArguments), 1522 cloneToken(node.constKeyword),
1415 cloneToken(node.leftBracket), cloneNodeList(node.entries), 1523 cloneNode(node.typeArguments),
1524 cloneToken(node.leftBracket),
1525 cloneNodeList(node.entries),
1416 cloneToken(node.rightBracket)); 1526 cloneToken(node.rightBracket));
1417 1527
1418 @override 1528 @override
1419 MapLiteralEntry visitMapLiteralEntry( 1529 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
1420 MapLiteralEntry node) => new MapLiteralEntry( 1530 new MapLiteralEntry(cloneNode(node.key), cloneToken(node.separator),
1421 cloneNode(node.key), cloneToken(node.separator), cloneNode(node.value)); 1531 cloneNode(node.value));
1422 1532
1423 @override 1533 @override
1424 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 1534 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
1425 new MethodDeclaration(cloneNode(node.documentationComment), 1535 new MethodDeclaration(
1426 cloneNodeList(node.metadata), cloneToken(node.externalKeyword), 1536 cloneNode(node.documentationComment),
1427 cloneToken(node.modifierKeyword), cloneNode(node.returnType), 1537 cloneNodeList(node.metadata),
1428 cloneToken(node.propertyKeyword), cloneToken(node.operatorKeyword), 1538 cloneToken(node.externalKeyword),
1429 cloneNode(node.name), cloneNode(node.typeParameters), 1539 cloneToken(node.modifierKeyword),
1430 cloneNode(node.parameters), cloneNode(node.body)); 1540 cloneNode(node.returnType),
1541 cloneToken(node.propertyKeyword),
1542 cloneToken(node.operatorKeyword),
1543 cloneNode(node.name),
1544 cloneNode(node.typeParameters),
1545 cloneNode(node.parameters),
1546 cloneNode(node.body));
1431 1547
1432 @override 1548 @override
1433 MethodInvocation visitMethodInvocation(MethodInvocation node) => 1549 MethodInvocation visitMethodInvocation(MethodInvocation node) =>
1434 new MethodInvocation(cloneNode(node.target), cloneToken(node.operator), 1550 new MethodInvocation(
1435 cloneNode(node.methodName), cloneNode(node.typeArguments), 1551 cloneNode(node.target),
1552 cloneToken(node.operator),
1553 cloneNode(node.methodName),
1554 cloneNode(node.typeArguments),
1436 cloneNode(node.argumentList)); 1555 cloneNode(node.argumentList));
1437 1556
1438 @override 1557 @override
1439 NamedExpression visitNamedExpression(NamedExpression node) => 1558 NamedExpression visitNamedExpression(NamedExpression node) =>
1440 new NamedExpression(cloneNode(node.name), cloneNode(node.expression)); 1559 new NamedExpression(cloneNode(node.name), cloneNode(node.expression));
1441 1560
1442 @override 1561 @override
1443 AstNode visitNativeClause(NativeClause node) => 1562 AstNode visitNativeClause(NativeClause node) =>
1444 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name)); 1563 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name));
1445 1564
1446 @override 1565 @override
1447 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => 1566 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) =>
1448 new NativeFunctionBody(cloneToken(node.nativeKeyword), 1567 new NativeFunctionBody(cloneToken(node.nativeKeyword),
1449 cloneNode(node.stringLiteral), cloneToken(node.semicolon)); 1568 cloneNode(node.stringLiteral), cloneToken(node.semicolon));
1450 1569
1451 @override 1570 @override
1452 NullLiteral visitNullLiteral(NullLiteral node) => 1571 NullLiteral visitNullLiteral(NullLiteral node) =>
1453 new NullLiteral(cloneToken(node.literal)); 1572 new NullLiteral(cloneToken(node.literal));
1454 1573
1455 @override 1574 @override
1456 ParenthesizedExpression visitParenthesizedExpression( 1575 ParenthesizedExpression visitParenthesizedExpression(
1457 ParenthesizedExpression node) => new ParenthesizedExpression( 1576 ParenthesizedExpression node) =>
1458 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1577 new ParenthesizedExpression(cloneToken(node.leftParenthesis),
1459 cloneToken(node.rightParenthesis)); 1578 cloneNode(node.expression), cloneToken(node.rightParenthesis));
1460 1579
1461 @override 1580 @override
1462 PartDirective visitPartDirective(PartDirective node) { 1581 PartDirective visitPartDirective(PartDirective node) {
1463 PartDirective directive = new PartDirective( 1582 PartDirective directive = new PartDirective(
1464 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1583 cloneNode(node.documentationComment),
1465 cloneToken(node.partKeyword), cloneNode(node.uri), 1584 cloneNodeList(node.metadata),
1585 cloneToken(node.partKeyword),
1586 cloneNode(node.uri),
1466 cloneToken(node.semicolon)); 1587 cloneToken(node.semicolon));
1467 directive.source = node.source; 1588 directive.source = node.source;
1468 directive.uriContent = node.uriContent; 1589 directive.uriContent = node.uriContent;
1469 return directive; 1590 return directive;
1470 } 1591 }
1471 1592
1472 @override 1593 @override
1473 PartOfDirective visitPartOfDirective(PartOfDirective node) => 1594 PartOfDirective visitPartOfDirective(PartOfDirective node) =>
1474 new PartOfDirective(cloneNode(node.documentationComment), 1595 new PartOfDirective(
1475 cloneNodeList(node.metadata), cloneToken(node.partKeyword), 1596 cloneNode(node.documentationComment),
1476 cloneToken(node.ofKeyword), cloneNode(node.libraryName), 1597 cloneNodeList(node.metadata),
1598 cloneToken(node.partKeyword),
1599 cloneToken(node.ofKeyword),
1600 cloneNode(node.libraryName),
1477 cloneToken(node.semicolon)); 1601 cloneToken(node.semicolon));
1478 1602
1479 @override 1603 @override
1480 PostfixExpression visitPostfixExpression(PostfixExpression node) => 1604 PostfixExpression visitPostfixExpression(PostfixExpression node) =>
1481 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator)); 1605 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator));
1482 1606
1483 @override 1607 @override
1484 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => 1608 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) =>
1485 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period), 1609 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period),
1486 cloneNode(node.identifier)); 1610 cloneNode(node.identifier));
1487 1611
1488 @override 1612 @override
1489 PrefixExpression visitPrefixExpression(PrefixExpression node) => 1613 PrefixExpression visitPrefixExpression(PrefixExpression node) =>
1490 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand)); 1614 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand));
1491 1615
1492 @override 1616 @override
1493 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( 1617 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
1494 cloneNode(node.target), cloneToken(node.operator), 1618 cloneNode(node.target),
1619 cloneToken(node.operator),
1495 cloneNode(node.propertyName)); 1620 cloneNode(node.propertyName));
1496 1621
1497 @override 1622 @override
1498 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 1623 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
1499 RedirectingConstructorInvocation node) => 1624 RedirectingConstructorInvocation node) =>
1500 new RedirectingConstructorInvocation(cloneToken(node.thisKeyword), 1625 new RedirectingConstructorInvocation(
1501 cloneToken(node.period), cloneNode(node.constructorName), 1626 cloneToken(node.thisKeyword),
1627 cloneToken(node.period),
1628 cloneNode(node.constructorName),
1502 cloneNode(node.argumentList)); 1629 cloneNode(node.argumentList));
1503 1630
1504 @override 1631 @override
1505 RethrowExpression visitRethrowExpression(RethrowExpression node) => 1632 RethrowExpression visitRethrowExpression(RethrowExpression node) =>
1506 new RethrowExpression(cloneToken(node.rethrowKeyword)); 1633 new RethrowExpression(cloneToken(node.rethrowKeyword));
1507 1634
1508 @override 1635 @override
1509 ReturnStatement visitReturnStatement(ReturnStatement node) => 1636 ReturnStatement visitReturnStatement(ReturnStatement node) =>
1510 new ReturnStatement(cloneToken(node.returnKeyword), 1637 new ReturnStatement(cloneToken(node.returnKeyword),
1511 cloneNode(node.expression), cloneToken(node.semicolon)); 1638 cloneNode(node.expression), cloneToken(node.semicolon));
1512 1639
1513 @override 1640 @override
1514 ScriptTag visitScriptTag(ScriptTag node) => 1641 ScriptTag visitScriptTag(ScriptTag node) =>
1515 new ScriptTag(cloneToken(node.scriptTag)); 1642 new ScriptTag(cloneToken(node.scriptTag));
1516 1643
1517 @override 1644 @override
1518 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 1645 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
1519 cloneToken(node.keyword), cloneNodeList(node.shownNames)); 1646 cloneToken(node.keyword), cloneNodeList(node.shownNames));
1520 1647
1521 @override 1648 @override
1522 SimpleFormalParameter visitSimpleFormalParameter( 1649 SimpleFormalParameter visitSimpleFormalParameter(
1523 SimpleFormalParameter node) => new SimpleFormalParameter( 1650 SimpleFormalParameter node) =>
1524 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1651 new SimpleFormalParameter(
1525 cloneToken(node.keyword), cloneNode(node.type), 1652 cloneNode(node.documentationComment),
1526 cloneNode(node.identifier)); 1653 cloneNodeList(node.metadata),
1654 cloneToken(node.keyword),
1655 cloneNode(node.type),
1656 cloneNode(node.identifier));
1527 1657
1528 @override 1658 @override
1529 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => 1659 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
1530 new SimpleIdentifier(cloneToken(node.token)); 1660 new SimpleIdentifier(cloneToken(node.token));
1531 1661
1532 @override 1662 @override
1533 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => 1663 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) =>
1534 new SimpleStringLiteral(cloneToken(node.literal), node.value); 1664 new SimpleStringLiteral(cloneToken(node.literal), node.value);
1535 1665
1536 @override 1666 @override
1537 StringInterpolation visitStringInterpolation(StringInterpolation node) => 1667 StringInterpolation visitStringInterpolation(StringInterpolation node) =>
1538 new StringInterpolation(cloneNodeList(node.elements)); 1668 new StringInterpolation(cloneNodeList(node.elements));
1539 1669
1540 @override 1670 @override
1541 SuperConstructorInvocation visitSuperConstructorInvocation( 1671 SuperConstructorInvocation visitSuperConstructorInvocation(
1542 SuperConstructorInvocation node) => new SuperConstructorInvocation( 1672 SuperConstructorInvocation node) =>
1543 cloneToken(node.superKeyword), cloneToken(node.period), 1673 new SuperConstructorInvocation(
1544 cloneNode(node.constructorName), cloneNode(node.argumentList)); 1674 cloneToken(node.superKeyword),
1675 cloneToken(node.period),
1676 cloneNode(node.constructorName),
1677 cloneNode(node.argumentList));
1545 1678
1546 @override 1679 @override
1547 SuperExpression visitSuperExpression(SuperExpression node) => 1680 SuperExpression visitSuperExpression(SuperExpression node) =>
1548 new SuperExpression(cloneToken(node.superKeyword)); 1681 new SuperExpression(cloneToken(node.superKeyword));
1549 1682
1550 @override 1683 @override
1551 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 1684 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
1552 cloneNodeList(node.labels), cloneToken(node.keyword), 1685 cloneNodeList(node.labels),
1553 cloneNode(node.expression), cloneToken(node.colon), 1686 cloneToken(node.keyword),
1687 cloneNode(node.expression),
1688 cloneToken(node.colon),
1554 cloneNodeList(node.statements)); 1689 cloneNodeList(node.statements));
1555 1690
1556 @override 1691 @override
1557 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 1692 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
1558 cloneNodeList(node.labels), cloneToken(node.keyword), 1693 cloneNodeList(node.labels),
1559 cloneToken(node.colon), cloneNodeList(node.statements)); 1694 cloneToken(node.keyword),
1695 cloneToken(node.colon),
1696 cloneNodeList(node.statements));
1560 1697
1561 @override 1698 @override
1562 SwitchStatement visitSwitchStatement(SwitchStatement node) => 1699 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
1563 new SwitchStatement(cloneToken(node.switchKeyword), 1700 new SwitchStatement(
1564 cloneToken(node.leftParenthesis), cloneNode(node.expression), 1701 cloneToken(node.switchKeyword),
1565 cloneToken(node.rightParenthesis), cloneToken(node.leftBracket), 1702 cloneToken(node.leftParenthesis),
1566 cloneNodeList(node.members), cloneToken(node.rightBracket)); 1703 cloneNode(node.expression),
1704 cloneToken(node.rightParenthesis),
1705 cloneToken(node.leftBracket),
1706 cloneNodeList(node.members),
1707 cloneToken(node.rightBracket));
1567 1708
1568 @override 1709 @override
1569 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral( 1710 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(
1570 cloneToken(node.poundSign), cloneTokenList(node.components)); 1711 cloneToken(node.poundSign), cloneTokenList(node.components));
1571 1712
1572 @override 1713 @override
1573 ThisExpression visitThisExpression(ThisExpression node) => 1714 ThisExpression visitThisExpression(ThisExpression node) =>
1574 new ThisExpression(cloneToken(node.thisKeyword)); 1715 new ThisExpression(cloneToken(node.thisKeyword));
1575 1716
1576 @override 1717 @override
1577 ThrowExpression visitThrowExpression(ThrowExpression node) => 1718 ThrowExpression visitThrowExpression(ThrowExpression node) =>
1578 new ThrowExpression( 1719 new ThrowExpression(
1579 cloneToken(node.throwKeyword), cloneNode(node.expression)); 1720 cloneToken(node.throwKeyword), cloneNode(node.expression));
1580 1721
1581 @override 1722 @override
1582 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 1723 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
1583 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 1724 TopLevelVariableDeclaration node) =>
1584 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1725 new TopLevelVariableDeclaration(
1585 cloneNode(node.variables), cloneToken(node.semicolon)); 1726 cloneNode(node.documentationComment),
1727 cloneNodeList(node.metadata),
1728 cloneNode(node.variables),
1729 cloneToken(node.semicolon));
1586 1730
1587 @override 1731 @override
1588 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 1732 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
1589 cloneToken(node.tryKeyword), cloneNode(node.body), 1733 cloneToken(node.tryKeyword),
1590 cloneNodeList(node.catchClauses), cloneToken(node.finallyKeyword), 1734 cloneNode(node.body),
1735 cloneNodeList(node.catchClauses),
1736 cloneToken(node.finallyKeyword),
1591 cloneNode(node.finallyBlock)); 1737 cloneNode(node.finallyBlock));
1592 1738
1593 @override 1739 @override
1594 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 1740 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
1595 new TypeArgumentList(cloneToken(node.leftBracket), 1741 new TypeArgumentList(cloneToken(node.leftBracket),
1596 cloneNodeList(node.arguments), cloneToken(node.rightBracket)); 1742 cloneNodeList(node.arguments), cloneToken(node.rightBracket));
1597 1743
1598 @override 1744 @override
1599 TypeName visitTypeName(TypeName node) => 1745 TypeName visitTypeName(TypeName node) =>
1600 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments)); 1746 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments));
1601 1747
1602 @override 1748 @override
1603 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 1749 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
1604 cloneNode(node.documentationComment), cloneNodeList(node.metadata), 1750 cloneNode(node.documentationComment),
1605 cloneNode(node.name), cloneToken(node.extendsKeyword), 1751 cloneNodeList(node.metadata),
1752 cloneNode(node.name),
1753 cloneToken(node.extendsKeyword),
1606 cloneNode(node.bound)); 1754 cloneNode(node.bound));
1607 1755
1608 @override 1756 @override
1609 TypeParameterList visitTypeParameterList(TypeParameterList node) => 1757 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
1610 new TypeParameterList(cloneToken(node.leftBracket), 1758 new TypeParameterList(cloneToken(node.leftBracket),
1611 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); 1759 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket));
1612 1760
1613 @override 1761 @override
1614 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 1762 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
1615 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals), 1763 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals),
1616 cloneNode(node.initializer)); 1764 cloneNode(node.initializer));
1617 1765
1618 @override 1766 @override
1619 VariableDeclarationList visitVariableDeclarationList( 1767 VariableDeclarationList visitVariableDeclarationList(
1620 VariableDeclarationList node) => new VariableDeclarationList(null, 1768 VariableDeclarationList node) =>
1621 cloneNodeList(node.metadata), cloneToken(node.keyword), 1769 new VariableDeclarationList(
1622 cloneNode(node.type), cloneNodeList(node.variables)); 1770 cloneNode(node.documentationComment),
1771 cloneNodeList(node.metadata),
1772 cloneToken(node.keyword),
1773 cloneNode(node.type),
1774 cloneNodeList(node.variables));
1623 1775
1624 @override 1776 @override
1625 VariableDeclarationStatement visitVariableDeclarationStatement( 1777 VariableDeclarationStatement visitVariableDeclarationStatement(
1626 VariableDeclarationStatement node) => new VariableDeclarationStatement( 1778 VariableDeclarationStatement node) =>
1627 cloneNode(node.variables), cloneToken(node.semicolon)); 1779 new VariableDeclarationStatement(
1780 cloneNode(node.variables), cloneToken(node.semicolon));
1628 1781
1629 @override 1782 @override
1630 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 1783 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
1631 cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis), 1784 cloneToken(node.whileKeyword),
1632 cloneNode(node.condition), cloneToken(node.rightParenthesis), 1785 cloneToken(node.leftParenthesis),
1786 cloneNode(node.condition),
1787 cloneToken(node.rightParenthesis),
1633 cloneNode(node.body)); 1788 cloneNode(node.body));
1634 1789
1635 @override 1790 @override
1636 WithClause visitWithClause(WithClause node) => new WithClause( 1791 WithClause visitWithClause(WithClause node) => new WithClause(
1637 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes)); 1792 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes));
1638 1793
1639 @override 1794 @override
1640 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 1795 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
1641 cloneToken(node.yieldKeyword), cloneToken(node.star), 1796 cloneToken(node.yieldKeyword),
1642 cloneNode(node.expression), cloneToken(node.semicolon)); 1797 cloneToken(node.star),
1798 cloneNode(node.expression),
1799 cloneToken(node.semicolon));
1643 1800
1644 /** 1801 /**
1645 * Return a clone of the given [node]. 1802 * Return a clone of the given [node].
1646 */ 1803 */
1647 static AstNode clone(AstNode node) { 1804 static AstNode clone(AstNode node) {
1648 return node.accept(new AstCloner()); 1805 return node.accept(new AstCloner());
1649 } 1806 }
1650 } 1807 }
1651 1808
1652 /** 1809 /**
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2721 */ 2878 */
2722 static const List<AstNode> EMPTY_LIST = const <AstNode>[]; 2879 static const List<AstNode> EMPTY_LIST = const <AstNode>[];
2723 2880
2724 /** 2881 /**
2725 * A comparator that can be used to sort AST nodes in lexical order. In other 2882 * A comparator that can be used to sort AST nodes in lexical order. In other
2726 * words, `compare` will return a negative value if the offset of the first 2883 * words, `compare` will return a negative value if the offset of the first
2727 * node is less than the offset of the second node, zero (0) if the nodes have 2884 * node is less than the offset of the second node, zero (0) if the nodes have
2728 * the same offset, and a positive value if the offset of the first node is 2885 * the same offset, and a positive value if the offset of the first node is
2729 * greater than the offset of the second node. 2886 * greater than the offset of the second node.
2730 */ 2887 */
2731 static Comparator<AstNode> LEXICAL_ORDER = 2888 static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) =>
2732 (AstNode first, AstNode second) => second.offset - first.offset; 2889 first.offset - second.offset;
2733 2890
2734 /** 2891 /**
2735 * The parent of the node, or `null` if the node is the root of an AST 2892 * The parent of the node, or `null` if the node is the root of an AST
2736 * structure. 2893 * structure.
2737 */ 2894 */
2738 AstNode _parent; 2895 AstNode _parent;
2739 2896
2740 /** 2897 /**
2741 * A table mapping the names of properties to their values, or `null` if this 2898 * A table mapping the names of properties to their values, or `null` if this
2742 * node does not have any properties associated with it. 2899 * node does not have any properties associated with it.
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
3472 * Initialize a newly created function body consisting of a block of 3629 * Initialize a newly created function body consisting of a block of
3473 * statements. The [keyword] can be `null` if there is no keyword specified 3630 * statements. The [keyword] can be `null` if there is no keyword specified
3474 * for the block. The [star] can be `null` if there is no star following the 3631 * for the block. The [star] can be `null` if there is no star following the
3475 * keyword (and must be `null` if there is no keyword). 3632 * keyword (and must be `null` if there is no keyword).
3476 */ 3633 */
3477 BlockFunctionBody(this.keyword, this.star, Block block) { 3634 BlockFunctionBody(this.keyword, this.star, Block block) {
3478 _block = _becomeParentOf(block); 3635 _block = _becomeParentOf(block);
3479 } 3636 }
3480 3637
3481 @override 3638 @override
3482 Token get beginToken => _block.beginToken; 3639 Token get beginToken {
3640 if (keyword != null) {
3641 return keyword;
3642 }
3643 return _block.beginToken;
3644 }
3483 3645
3484 /** 3646 /**
3485 * Return the block representing the body of the function. 3647 * Return the block representing the body of the function.
3486 */ 3648 */
3487 Block get block => _block; 3649 Block get block => _block;
3488 3650
3489 /** 3651 /**
3490 * Set the block representing the body of the function to the given [block]. 3652 * Set the block representing the body of the function to the given [block].
3491 */ 3653 */
3492 void set block(Block block) { 3654 void set block(Block block) {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
3841 * The body of the catch block. 4003 * The body of the catch block.
3842 */ 4004 */
3843 Block _body; 4005 Block _body;
3844 4006
3845 /** 4007 /**
3846 * Initialize a newly created catch clause. The [onKeyword] and 4008 * Initialize a newly created catch clause. The [onKeyword] and
3847 * [exceptionType] can be `null` if the clause will catch all exceptions. The 4009 * [exceptionType] can be `null` if the clause will catch all exceptions. The
3848 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not 4010 * [comma] and [stackTraceParameter] can be `null` if the stack trace is not
3849 * referencable within the body. 4011 * referencable within the body.
3850 */ 4012 */
3851 CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword, 4013 CatchClause(
3852 this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma, 4014 this.onKeyword,
3853 SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) { 4015 TypeName exceptionType,
4016 this.catchKeyword,
4017 this.leftParenthesis,
4018 SimpleIdentifier exceptionParameter,
4019 this.comma,
4020 SimpleIdentifier stackTraceParameter,
4021 this.rightParenthesis,
4022 Block body) {
3854 _exceptionType = _becomeParentOf(exceptionType); 4023 _exceptionType = _becomeParentOf(exceptionType);
3855 _exceptionParameter = _becomeParentOf(exceptionParameter); 4024 _exceptionParameter = _becomeParentOf(exceptionParameter);
3856 _stackTraceParameter = _becomeParentOf(stackTraceParameter); 4025 _stackTraceParameter = _becomeParentOf(stackTraceParameter);
3857 _body = _becomeParentOf(body); 4026 _body = _becomeParentOf(body);
3858 } 4027 }
3859 4028
3860 @override 4029 @override
3861 Token get beginToken { 4030 Token get beginToken {
3862 if (onKeyword != null) { 4031 if (onKeyword != null) {
3863 return onKeyword; 4032 return onKeyword;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
4046 /** 4215 /**
4047 * Initialize a newly created class declaration. Either or both of the 4216 * Initialize a newly created class declaration. Either or both of the
4048 * [comment] and [metadata] can be `null` if the class does not have the 4217 * [comment] and [metadata] can be `null` if the class does not have the
4049 * corresponding attribute. The [abstractKeyword] can be `null` if the class 4218 * corresponding attribute. The [abstractKeyword] can be `null` if the class
4050 * is not abstract. The [typeParameters] can be `null` if the class does not 4219 * is not abstract. The [typeParameters] can be `null` if the class does not
4051 * have any type parameters. Any or all of the [extendsClause], [withClause], 4220 * have any type parameters. Any or all of the [extendsClause], [withClause],
4052 * and [implementsClause] can be `null` if the class does not have the 4221 * and [implementsClause] can be `null` if the class does not have the
4053 * corresponding clause. The list of [members] can be `null` if the class does 4222 * corresponding clause. The list of [members] can be `null` if the class does
4054 * not have any members. 4223 * not have any members.
4055 */ 4224 */
4056 ClassDeclaration(Comment comment, List<Annotation> metadata, 4225 ClassDeclaration(
4057 this.abstractKeyword, this.classKeyword, SimpleIdentifier name, 4226 Comment comment,
4058 TypeParameterList typeParameters, ExtendsClause extendsClause, 4227 List<Annotation> metadata,
4059 WithClause withClause, ImplementsClause implementsClause, 4228 this.abstractKeyword,
4060 this.leftBracket, List<ClassMember> members, this.rightBracket) 4229 this.classKeyword,
4230 SimpleIdentifier name,
4231 TypeParameterList typeParameters,
4232 ExtendsClause extendsClause,
4233 WithClause withClause,
4234 ImplementsClause implementsClause,
4235 this.leftBracket,
4236 List<ClassMember> members,
4237 this.rightBracket)
4061 : super(comment, metadata, name) { 4238 : super(comment, metadata, name) {
4062 _typeParameters = _becomeParentOf(typeParameters); 4239 _typeParameters = _becomeParentOf(typeParameters);
4063 _extendsClause = _becomeParentOf(extendsClause); 4240 _extendsClause = _becomeParentOf(extendsClause);
4064 _withClause = _becomeParentOf(withClause); 4241 _withClause = _becomeParentOf(withClause);
4065 _implementsClause = _becomeParentOf(implementsClause); 4242 _implementsClause = _becomeParentOf(implementsClause);
4066 _members = new NodeList<ClassMember>(this, members); 4243 _members = new NodeList<ClassMember>(this, members);
4067 } 4244 }
4068 4245
4069 @override 4246 @override
4070 Iterable get childEntities => super._childEntities 4247 Iterable get childEntities => super._childEntities
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
4302 ImplementsClause _implementsClause; 4479 ImplementsClause _implementsClause;
4303 4480
4304 /** 4481 /**
4305 * Initialize a newly created class type alias. Either or both of the 4482 * Initialize a newly created class type alias. Either or both of the
4306 * [comment] and [metadata] can be `null` if the class type alias does not 4483 * [comment] and [metadata] can be `null` if the class type alias does not
4307 * have the corresponding attribute. The [typeParameters] can be `null` if the 4484 * have the corresponding attribute. The [typeParameters] can be `null` if the
4308 * class does not have any type parameters. The [abstractKeyword] can be 4485 * class does not have any type parameters. The [abstractKeyword] can be
4309 * `null` if the class is not abstract. The [implementsClause] can be `null` 4486 * `null` if the class is not abstract. The [implementsClause] can be `null`
4310 * if the class does not implement any interfaces. 4487 * if the class does not implement any interfaces.
4311 */ 4488 */
4312 ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 4489 ClassTypeAlias(
4313 SimpleIdentifier name, TypeParameterList typeParameters, this.equals, 4490 Comment comment,
4314 this.abstractKeyword, TypeName superclass, WithClause withClause, 4491 List<Annotation> metadata,
4315 ImplementsClause implementsClause, Token semicolon) 4492 Token keyword,
4493 SimpleIdentifier name,
4494 TypeParameterList typeParameters,
4495 this.equals,
4496 this.abstractKeyword,
4497 TypeName superclass,
4498 WithClause withClause,
4499 ImplementsClause implementsClause,
4500 Token semicolon)
4316 : super(comment, metadata, keyword, name, semicolon) { 4501 : super(comment, metadata, keyword, name, semicolon) {
4317 _typeParameters = _becomeParentOf(typeParameters); 4502 _typeParameters = _becomeParentOf(typeParameters);
4318 _superclass = _becomeParentOf(superclass); 4503 _superclass = _becomeParentOf(superclass);
4319 _withClause = _becomeParentOf(withClause); 4504 _withClause = _becomeParentOf(withClause);
4320 _implementsClause = _becomeParentOf(implementsClause); 4505 _implementsClause = _becomeParentOf(implementsClause);
4321 } 4506 }
4322 4507
4323 @override 4508 @override
4324 Iterable get childEntities => super._childEntities 4509 Iterable get childEntities => super._childEntities
4325 ..add(typedefKeyword) 4510 ..add(typedefKeyword)
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
4692 */ 4877 */
4693 LineInfo lineInfo; 4878 LineInfo lineInfo;
4694 4879
4695 /** 4880 /**
4696 * Initialize a newly created compilation unit to have the given directives 4881 * Initialize a newly created compilation unit to have the given directives
4697 * and declarations. The [scriptTag] can be `null` if there is no script tag 4882 * and declarations. The [scriptTag] can be `null` if there is no script tag
4698 * in the compilation unit. The list of [directives] can be `null` if there 4883 * in the compilation unit. The list of [directives] can be `null` if there
4699 * are no directives in the compilation unit. The list of [declarations] can 4884 * are no directives in the compilation unit. The list of [declarations] can
4700 * be `null` if there are no declarations in the compilation unit. 4885 * be `null` if there are no declarations in the compilation unit.
4701 */ 4886 */
4702 CompilationUnit(this.beginToken, ScriptTag scriptTag, 4887 CompilationUnit(
4703 List<Directive> directives, List<CompilationUnitMember> declarations, 4888 this.beginToken,
4889 ScriptTag scriptTag,
4890 List<Directive> directives,
4891 List<CompilationUnitMember> declarations,
4704 this.endToken) { 4892 this.endToken) {
4705 _scriptTag = _becomeParentOf(scriptTag); 4893 _scriptTag = _becomeParentOf(scriptTag);
4706 _directives = new NodeList<Directive>(this, directives); 4894 _directives = new NodeList<Directive>(this, directives);
4707 _declarations = new NodeList<CompilationUnitMember>(this, declarations); 4895 _declarations = new NodeList<CompilationUnitMember>(this, declarations);
4708 } 4896 }
4709 4897
4710 @override 4898 @override
4711 Iterable get childEntities { 4899 Iterable get childEntities {
4712 ChildEntities result = new ChildEntities()..add(_scriptTag); 4900 ChildEntities result = new ChildEntities()..add(_scriptTag);
4713 if (_directivesAreBeforeDeclarations) { 4901 if (_directivesAreBeforeDeclarations) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
4922 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this); 5110 accept(AstVisitor visitor) => visitor.visitConditionalExpression(this);
4923 5111
4924 @override 5112 @override
4925 void visitChildren(AstVisitor visitor) { 5113 void visitChildren(AstVisitor visitor) {
4926 _safelyVisitChild(_condition, visitor); 5114 _safelyVisitChild(_condition, visitor);
4927 _safelyVisitChild(_thenExpression, visitor); 5115 _safelyVisitChild(_thenExpression, visitor);
4928 _safelyVisitChild(_elseExpression, visitor); 5116 _safelyVisitChild(_elseExpression, visitor);
4929 } 5117 }
4930 } 5118 }
4931 5119
4932 /** 5120 /// Instances of the class [ConstantEvaluator] evaluate constant expressions to
4933 * An object that can be used to evaluate constant expressions to produce their 5121 /// produce their compile-time value.
4934 * compile-time value. According to the Dart Language Specification: 5122 ///
4935 * <blockquote> 5123 /// According to the Dart Language Specification:
4936 * A constant expression is one of the following: 5124 ///
4937 * * A literal number. 5125 /// > A constant expression is one of the following:
4938 * * A literal boolean. 5126 /// >
4939 * * A literal string where any interpolated expression is a compile-time 5127 /// > * A literal number.
4940 * constant that evaluates to a numeric, string or boolean value or to `null`. 5128 /// > * A literal boolean.
4941 * * `null`. 5129 /// > * A literal string where any interpolated expression is a compile-time
4942 * * A reference to a static constant variable. 5130 /// > constant that evaluates to a numeric, string or boolean value or to
4943 * * An identifier expression that denotes a constant variable, a class or a 5131 /// > **null**.
4944 * type parameter. 5132 /// > * A literal symbol.
4945 * * A constant constructor invocation. 5133 /// > * **null**.
4946 * * A constant list literal. 5134 /// > * A qualified reference to a static constant variable.
4947 * * A constant map literal. 5135 /// > * An identifier expression that denotes a constant variable, class or type
4948 * * A simple or qualified identifier denoting a top-level function or a static 5136 /// > alias.
4949 * method. 5137 /// > * A constant constructor invocation.
4950 * * A parenthesized expression `(e)` where `e` is a constant expression. 5138 /// > * A constant list literal.
4951 * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`, 5139 /// > * A constant map literal.
4952 * `e1 != e2` where `e1` and `e2` are constant expressions that evaluate to a 5140 /// > * A simple or qualified identifier denoting a top-level function or a
4953 * numeric, string or boolean value or to `null`. 5141 /// > static method.
4954 * * An expression of one of the forms `!e`, `e1 && e2` or `e1 || e2`, where 5142 /// > * A parenthesized expression _(e)_ where _e_ is a constant expression.
4955 * `e`, `e1` and `e2` are constant expressions that evaluate to a boolean 5143 /// > * <span>
4956 * value or to `null`. 5144 /// > An expression of the form <i>identical(e<sub>1</sub>, e<sub>2</sub>)</i>
4957 * * An expression of one of the forms `~e`, `e1 ^ e2`, `e1 & e2`, `e1 | e2`, 5145 /// > where <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
4958 * `e1 >> e2` or `e1 << e2`, where `e`, `e1` and `e2` are constant expressions 5146 /// > expressions and <i>identical()</i> is statically bound to the predefined
4959 * that evaluate to an integer value or to `null`. 5147 /// > dart function <i>identical()</i> discussed above.
4960 * * An expression of one of the forms `-e`, `e1 + e2`, `e1 - e2`, `e1 * e2`, 5148 /// > </span>
4961 * `e1 / e2`, `e1 ~/ e2`, `e1 > e2`, `e1 < e2`, `e1 >= e2`, `e1 <= e2` or 5149 /// > * <span>
4962 * `e1 % e2`, where `e`, `e1` and `e2` are constant expressions that evaluate 5150 /// > An expression of one of the forms <i>e<sub>1</sub> == e<sub>2</sub></i>
4963 * to a numeric value or to `null`. 5151 /// > or <i>e<sub>1</sub> != e<sub>2</sub></i> where <i>e<sub>1</sub></i> and
4964 * </blockquote> 5152 /// > <i>e<sub>2</sub></i> are constant expressions that evaluate to a
4965 * The values returned by instances of this class are therefore `null` and 5153 /// > numeric, string or boolean value.
4966 * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and 5154 /// > </span>
4967 * `DartObject`. 5155 /// > * <span>
4968 * 5156 /// > An expression of one of the forms <i>!e</i>, <i>e<sub>1</sub> &amp;&amp;
4969 * In addition, this class defines several values that can be returned to 5157 /// > e<sub>2</sub></i> or <i>e<sub>1</sub> || e<sub>2</sub></i>, where
4970 * indicate various conditions encountered during evaluation. These are 5158 /// > <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
4971 * documented with the static fields that define those values. 5159 /// > expressions that evaluate to a boolean value.
4972 */ 5160 /// > </span>
5161 /// > * <span>
5162 /// > An expression of one of the forms <i>~e</i>, <i>e<sub>1</sub> ^
5163 /// > e<sub>2</sub></i>, <i>e<sub>1</sub> &amp; e<sub>2</sub></i>,
5164 /// > <i>e<sub>1</sub> | e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;&gt;
5165 /// > e<sub>2</sub></i> or <i>e<sub>1</sub> &lt;&lt; e<sub>2</sub></i>, where
5166 /// > <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
5167 /// > expressions that evaluate to an integer value or to <b>null</b>.
5168 /// > </span>
5169 /// > * <span>
5170 /// > An expression of one of the forms <i>-e</i>, <i>e<sub>1</sub> +
5171 /// > e<sub>2</sub></i>, <i>e<sub>1</sub> -e<sub>2</sub></i>,
5172 /// > <i>e<sub>1</sub> * e<sub>2</sub></i>, <i>e<sub>1</sub> /
5173 /// > e<sub>2</sub></i>, <i>e<sub>1</sub> ~/ e<sub>2</sub></i>,
5174 /// > <i>e<sub>1</sub> &gt; e<sub>2</sub></i>, <i>e<sub>1</sub> &lt;
5175 /// > e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;= e<sub>2</sub></i>,
5176 /// > <i>e<sub>1</sub> &lt;= e<sub>2</sub></i> or <i>e<sub>1</sub> %
5177 /// > e<sub>2</sub></i>, where <i>e</i>, <i>e<sub>1</sub></i> and
5178 /// > <i>e<sub>2</sub></i> are constant expressions that evaluate to a numeric
5179 /// > value or to <b>null</b>.
5180 /// > </span>
5181 /// > * <span>
5182 /// > An expression of the form <i>e<sub>1</sub> ? e<sub>2</sub> :
5183 /// > e<sub>3</sub></i> where <i>e<sub>1</sub></i>, <i>e<sub>2</sub></i> and
5184 /// > <i>e<sub>3</sub></i> are constant expressions, and <i>e<sub>1</sub></i>
5185 /// > evaluates to a boolean value.
5186 /// > </span>
5187 ///
5188 /// The values returned by instances of this class are therefore `null` and
5189 /// instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and
5190 /// `DartObject`.
5191 ///
5192 /// In addition, this class defines several values that can be returned to
5193 /// indicate various conditions encountered during evaluation. These are
5194 /// documented with the static fields that define those values.
4973 class ConstantEvaluator extends GeneralizingAstVisitor<Object> { 5195 class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
4974 /** 5196 /**
4975 * The value returned for expressions (or non-expression nodes) that are not 5197 * The value returned for expressions (or non-expression nodes) that are not
4976 * compile-time constant expressions. 5198 * compile-time constant expressions.
4977 */ 5199 */
4978 static Object NOT_A_CONSTANT = new Object(); 5200 static Object NOT_A_CONSTANT = new Object();
4979 5201
4980 @override 5202 @override
4981 Object visitAdjacentStrings(AdjacentStrings node) { 5203 Object visitAdjacentStrings(AdjacentStrings node) {
4982 StringBuffer buffer = new StringBuffer(); 5204 StringBuffer buffer = new StringBuffer();
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
5364 * constructor cannot be used to create a constant. The [factoryKeyword] can 5586 * constructor cannot be used to create a constant. The [factoryKeyword] can
5365 * be `null` if the constructor is not a factory. The [period] and [name] can 5587 * be `null` if the constructor is not a factory. The [period] and [name] can
5366 * both be `null` if the constructor is not a named constructor. The 5588 * both be `null` if the constructor is not a named constructor. The
5367 * [separator] can be `null` if the constructor does not have any initializers 5589 * [separator] can be `null` if the constructor does not have any initializers
5368 * and does not redirect to a different constructor. The list of 5590 * and does not redirect to a different constructor. The list of
5369 * [initializers] can be `null` if the constructor does not have any 5591 * [initializers] can be `null` if the constructor does not have any
5370 * initializers. The [redirectedConstructor] can be `null` if the constructor 5592 * initializers. The [redirectedConstructor] can be `null` if the constructor
5371 * does not redirect to a different constructor. The [body] can be `null` if 5593 * does not redirect to a different constructor. The [body] can be `null` if
5372 * the constructor does not have a body. 5594 * the constructor does not have a body.
5373 */ 5595 */
5374 ConstructorDeclaration(Comment comment, List<Annotation> metadata, 5596 ConstructorDeclaration(
5375 this.externalKeyword, this.constKeyword, this.factoryKeyword, 5597 Comment comment,
5376 Identifier returnType, this.period, SimpleIdentifier name, 5598 List<Annotation> metadata,
5377 FormalParameterList parameters, this.separator, 5599 this.externalKeyword,
5600 this.constKeyword,
5601 this.factoryKeyword,
5602 Identifier returnType,
5603 this.period,
5604 SimpleIdentifier name,
5605 FormalParameterList parameters,
5606 this.separator,
5378 List<ConstructorInitializer> initializers, 5607 List<ConstructorInitializer> initializers,
5379 ConstructorName redirectedConstructor, FunctionBody body) 5608 ConstructorName redirectedConstructor,
5609 FunctionBody body)
5380 : super(comment, metadata) { 5610 : super(comment, metadata) {
5381 _returnType = _becomeParentOf(returnType); 5611 _returnType = _becomeParentOf(returnType);
5382 _name = _becomeParentOf(name); 5612 _name = _becomeParentOf(name);
5383 _parameters = _becomeParentOf(parameters); 5613 _parameters = _becomeParentOf(parameters);
5384 _initializers = new NodeList<ConstructorInitializer>(this, initializers); 5614 _initializers = new NodeList<ConstructorInitializer>(this, initializers);
5385 _redirectedConstructor = _becomeParentOf(redirectedConstructor); 5615 _redirectedConstructor = _becomeParentOf(redirectedConstructor);
5386 _body = _becomeParentOf(body); 5616 _body = _becomeParentOf(body);
5387 } 5617 }
5388 5618
5389 /** 5619 /**
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
6016 6246
6017 @override 6247 @override
6018 SimpleIdentifier get identifier => _parameter.identifier; 6248 SimpleIdentifier get identifier => _parameter.identifier;
6019 6249
6020 @override 6250 @override
6021 bool get isConst => _parameter != null && _parameter.isConst; 6251 bool get isConst => _parameter != null && _parameter.isConst;
6022 6252
6023 @override 6253 @override
6024 bool get isFinal => _parameter != null && _parameter.isFinal; 6254 bool get isFinal => _parameter != null && _parameter.isFinal;
6025 6255
6256 @override
6257 NodeList<Annotation> get metadata => _parameter.metadata;
6258
6026 /** 6259 /**
6027 * Return the formal parameter with which the default value is associated. 6260 * Return the formal parameter with which the default value is associated.
6028 */ 6261 */
6029 NormalFormalParameter get parameter => _parameter; 6262 NormalFormalParameter get parameter => _parameter;
6030 6263
6031 /** 6264 /**
6032 * Set the formal parameter with which the default value is associated to the 6265 * Set the formal parameter with which the default value is associated to the
6033 * given [formalParameter]. 6266 * given [formalParameter].
6034 */ 6267 */
6035 void set parameter(NormalFormalParameter formalParameter) { 6268 void set parameter(NormalFormalParameter formalParameter) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
6147 Token rightParenthesis; 6380 Token rightParenthesis;
6148 6381
6149 /** 6382 /**
6150 * The semicolon terminating the statement. 6383 * The semicolon terminating the statement.
6151 */ 6384 */
6152 Token semicolon; 6385 Token semicolon;
6153 6386
6154 /** 6387 /**
6155 * Initialize a newly created do loop. 6388 * Initialize a newly created do loop.
6156 */ 6389 */
6157 DoStatement(this.doKeyword, Statement body, this.whileKeyword, 6390 DoStatement(
6158 this.leftParenthesis, Expression condition, this.rightParenthesis, 6391 this.doKeyword,
6392 Statement body,
6393 this.whileKeyword,
6394 this.leftParenthesis,
6395 Expression condition,
6396 this.rightParenthesis,
6159 this.semicolon) { 6397 this.semicolon) {
6160 _body = _becomeParentOf(body); 6398 _body = _becomeParentOf(body);
6161 _condition = _becomeParentOf(condition); 6399 _condition = _becomeParentOf(condition);
6162 } 6400 }
6163 6401
6164 @override 6402 @override
6165 Token get beginToken => doKeyword; 6403 Token get beginToken => doKeyword;
6166 6404
6167 /** 6405 /**
6168 * Return the body of the loop. 6406 * Return the body of the loop.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
6264 * Return the element associated with the given [node], or `null` if there is 6502 * Return the element associated with the given [node], or `null` if there is
6265 * no element associated with the node. 6503 * no element associated with the node.
6266 */ 6504 */
6267 static Element locate(AstNode node) { 6505 static Element locate(AstNode node) {
6268 if (node == null) { 6506 if (node == null) {
6269 return null; 6507 return null;
6270 } 6508 }
6271 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper(); 6509 ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
6272 return node.accept(mapper); 6510 return node.accept(mapper);
6273 } 6511 }
6274
6275 /**
6276 * Return the element associated with the given [node], or `null` if there is
6277 * no element associated with the node.
6278 */
6279 static Element locateWithOffset(AstNode node, int offset) {
6280 // TODO(brianwilkerson) 'offset' is not used. Figure out what's going on:
6281 // whether there's a bug or whether this method is unnecessary.
6282 if (node == null) {
6283 return null;
6284 }
6285 // try to get Element from node
6286 Element nodeElement = locate(node);
6287 if (nodeElement != null) {
6288 return nodeElement;
6289 }
6290 // no Element
6291 return null;
6292 }
6293 } 6512 }
6294 6513
6295 /** 6514 /**
6296 * Visitor that maps nodes to elements. 6515 * Visitor that maps nodes to elements.
6297 */ 6516 */
6298 class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> { 6517 class ElementLocator_ElementMapper extends GeneralizingAstVisitor<Element> {
6299 @override 6518 @override
6300 Element visitAnnotation(Annotation node) => node.element; 6519 Element visitAnnotation(Annotation node) => node.element;
6301 6520
6302 @override 6521 @override
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
6372 Element visitLibraryDirective(LibraryDirective node) => node.element; 6591 Element visitLibraryDirective(LibraryDirective node) => node.element;
6373 6592
6374 @override 6593 @override
6375 Element visitMethodDeclaration(MethodDeclaration node) => node.element; 6594 Element visitMethodDeclaration(MethodDeclaration node) => node.element;
6376 6595
6377 @override 6596 @override
6378 Element visitMethodInvocation(MethodInvocation node) => 6597 Element visitMethodInvocation(MethodInvocation node) =>
6379 node.methodName.bestElement; 6598 node.methodName.bestElement;
6380 6599
6381 @override 6600 @override
6601 Element visitPartOfDirective(PartOfDirective node) => node.element;
6602
6603 @override
6382 Element visitPostfixExpression(PostfixExpression node) => node.bestElement; 6604 Element visitPostfixExpression(PostfixExpression node) => node.bestElement;
6383 6605
6384 @override 6606 @override
6385 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.bestElement; 6607 Element visitPrefixedIdentifier(PrefixedIdentifier node) => node.bestElement;
6386 6608
6387 @override 6609 @override
6388 Element visitPrefixExpression(PrefixExpression node) => node.bestElement; 6610 Element visitPrefixExpression(PrefixExpression node) => node.bestElement;
6389 6611
6390 @override 6612 @override
6391 Element visitStringLiteral(StringLiteral node) { 6613 Element visitStringLiteral(StringLiteral node) {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
6554 * The right curly bracket. 6776 * The right curly bracket.
6555 */ 6777 */
6556 Token rightBracket; 6778 Token rightBracket;
6557 6779
6558 /** 6780 /**
6559 * Initialize a newly created enumeration declaration. Either or both of the 6781 * Initialize a newly created enumeration declaration. Either or both of the
6560 * [comment] and [metadata] can be `null` if the declaration does not have the 6782 * [comment] and [metadata] can be `null` if the declaration does not have the
6561 * corresponding attribute. The list of [constants] must contain at least one 6783 * corresponding attribute. The list of [constants] must contain at least one
6562 * value. 6784 * value.
6563 */ 6785 */
6564 EnumDeclaration(Comment comment, List<Annotation> metadata, this.enumKeyword, 6786 EnumDeclaration(
6565 SimpleIdentifier name, this.leftBracket, 6787 Comment comment,
6566 List<EnumConstantDeclaration> constants, this.rightBracket) 6788 List<Annotation> metadata,
6789 this.enumKeyword,
6790 SimpleIdentifier name,
6791 this.leftBracket,
6792 List<EnumConstantDeclaration> constants,
6793 this.rightBracket)
6567 : super(comment, metadata, name) { 6794 : super(comment, metadata, name) {
6568 _constants = new NodeList<EnumConstantDeclaration>(this, constants); 6795 _constants = new NodeList<EnumConstantDeclaration>(this, constants);
6569 } 6796 }
6570 6797
6571 @override 6798 @override
6572 // TODO(brianwilkerson) Add commas? 6799 // TODO(brianwilkerson) Add commas?
6573 Iterable get childEntities => super._childEntities 6800 Iterable get childEntities => super._childEntities
6574 ..add(enumKeyword) 6801 ..add(enumKeyword)
6575 ..add(_name) 6802 ..add(_name)
6576 ..add(leftBracket) 6803 ..add(leftBracket)
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
7171 7398
7172 /** 7399 /**
7173 * Initialize a newly created formal parameter. Either or both of the 7400 * Initialize a newly created formal parameter. Either or both of the
7174 * [comment] and [metadata] can be `null` if the parameter does not have the 7401 * [comment] and [metadata] can be `null` if the parameter does not have the
7175 * corresponding attribute. The [keyword] can be `null` if there is a type. 7402 * corresponding attribute. The [keyword] can be `null` if there is a type.
7176 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and 7403 * The [type] must be `null` if the keyword is 'var'. The [thisKeyword] and
7177 * [period] can be `null` if the keyword 'this' was not provided. The 7404 * [period] can be `null` if the keyword 'this' was not provided. The
7178 * [parameters] can be `null` if this is not a function-typed field formal 7405 * [parameters] can be `null` if this is not a function-typed field formal
7179 * parameter. 7406 * parameter.
7180 */ 7407 */
7181 FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword, 7408 FieldFormalParameter(
7182 TypeName type, this.thisKeyword, this.period, SimpleIdentifier identifier, 7409 Comment comment,
7183 TypeParameterList typeParameters, FormalParameterList parameters) 7410 List<Annotation> metadata,
7411 this.keyword,
7412 TypeName type,
7413 this.thisKeyword,
7414 this.period,
7415 SimpleIdentifier identifier,
7416 TypeParameterList typeParameters,
7417 FormalParameterList parameters)
7184 : super(comment, metadata, identifier) { 7418 : super(comment, metadata, identifier) {
7185 _type = _becomeParentOf(type); 7419 _type = _becomeParentOf(type);
7186 _typeParameters = _becomeParentOf(typeParameters); 7420 _typeParameters = _becomeParentOf(typeParameters);
7187 _parameters = _becomeParentOf(parameters); 7421 _parameters = _becomeParentOf(parameters);
7188 } 7422 }
7189 7423
7190 @override 7424 @override
7191 Token get beginToken { 7425 Token get beginToken {
7192 if (keyword != null) { 7426 if (keyword != null) {
7193 return keyword; 7427 return keyword;
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
7345 /** 7579 /**
7346 * The body of the loop. 7580 * The body of the loop.
7347 */ 7581 */
7348 Statement _body; 7582 Statement _body;
7349 7583
7350 /** 7584 /**
7351 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7585 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7352 * `null` if this is not an asynchronous for loop. 7586 * `null` if this is not an asynchronous for loop.
7353 */ 7587 */
7354 @deprecated // Use new ForEachStatement.withDeclaration(...) 7588 @deprecated // Use new ForEachStatement.withDeclaration(...)
7355 ForEachStatement.con1(this.awaitKeyword, this.forKeyword, 7589 ForEachStatement.con1(
7356 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7590 this.awaitKeyword,
7357 Expression iterator, this.rightParenthesis, Statement body) { 7591 this.forKeyword,
7592 this.leftParenthesis,
7593 DeclaredIdentifier loopVariable,
7594 this.inKeyword,
7595 Expression iterator,
7596 this.rightParenthesis,
7597 Statement body) {
7358 _loopVariable = _becomeParentOf(loopVariable); 7598 _loopVariable = _becomeParentOf(loopVariable);
7359 _iterable = _becomeParentOf(iterator); 7599 _iterable = _becomeParentOf(iterator);
7360 _body = _becomeParentOf(body); 7600 _body = _becomeParentOf(body);
7361 } 7601 }
7362 7602
7363 /** 7603 /**
7364 * Initialize a newly created for-each statement. The [awaitKeyword] can be 7604 * Initialize a newly created for-each statement. The [awaitKeyword] can be
7365 * `null` if this is not an asynchronous for loop. 7605 * `null` if this is not an asynchronous for loop.
7366 */ 7606 */
7367 @deprecated // Use new ForEachStatement.withReference(...) 7607 @deprecated // Use new ForEachStatement.withReference(...)
7368 ForEachStatement.con2(this.awaitKeyword, this.forKeyword, 7608 ForEachStatement.con2(
7369 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7609 this.awaitKeyword,
7370 Expression iterator, this.rightParenthesis, Statement body) { 7610 this.forKeyword,
7611 this.leftParenthesis,
7612 SimpleIdentifier identifier,
7613 this.inKeyword,
7614 Expression iterator,
7615 this.rightParenthesis,
7616 Statement body) {
7371 _identifier = _becomeParentOf(identifier); 7617 _identifier = _becomeParentOf(identifier);
7372 _iterable = _becomeParentOf(iterator); 7618 _iterable = _becomeParentOf(iterator);
7373 _body = _becomeParentOf(body); 7619 _body = _becomeParentOf(body);
7374 } 7620 }
7375 7621
7376 /** 7622 /**
7377 * Initialize a newly created for-each statement whose loop control variable 7623 * Initialize a newly created for-each statement whose loop control variable
7378 * is declared internally (in the for-loop part). The [awaitKeyword] can be 7624 * is declared internally (in the for-loop part). The [awaitKeyword] can be
7379 * `null` if this is not an asynchronous for loop. 7625 * `null` if this is not an asynchronous for loop.
7380 */ 7626 */
7381 ForEachStatement.withDeclaration(this.awaitKeyword, this.forKeyword, 7627 ForEachStatement.withDeclaration(
7382 this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword, 7628 this.awaitKeyword,
7383 Expression iterator, this.rightParenthesis, Statement body) { 7629 this.forKeyword,
7630 this.leftParenthesis,
7631 DeclaredIdentifier loopVariable,
7632 this.inKeyword,
7633 Expression iterator,
7634 this.rightParenthesis,
7635 Statement body) {
7384 _loopVariable = _becomeParentOf(loopVariable); 7636 _loopVariable = _becomeParentOf(loopVariable);
7385 _iterable = _becomeParentOf(iterator); 7637 _iterable = _becomeParentOf(iterator);
7386 _body = _becomeParentOf(body); 7638 _body = _becomeParentOf(body);
7387 } 7639 }
7388 7640
7389 /** 7641 /**
7390 * Initialize a newly created for-each statement whose loop control variable 7642 * Initialize a newly created for-each statement whose loop control variable
7391 * is declared outside the for loop. The [awaitKeyword] can be `null` if this 7643 * is declared outside the for loop. The [awaitKeyword] can be `null` if this
7392 * is not an asynchronous for loop. 7644 * is not an asynchronous for loop.
7393 */ 7645 */
7394 ForEachStatement.withReference(this.awaitKeyword, this.forKeyword, 7646 ForEachStatement.withReference(
7395 this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword, 7647 this.awaitKeyword,
7396 Expression iterator, this.rightParenthesis, Statement body) { 7648 this.forKeyword,
7649 this.leftParenthesis,
7650 SimpleIdentifier identifier,
7651 this.inKeyword,
7652 Expression iterator,
7653 this.rightParenthesis,
7654 Statement body) {
7397 _identifier = _becomeParentOf(identifier); 7655 _identifier = _becomeParentOf(identifier);
7398 _iterable = _becomeParentOf(iterator); 7656 _iterable = _becomeParentOf(iterator);
7399 _body = _becomeParentOf(body); 7657 _body = _becomeParentOf(body);
7400 } 7658 }
7401 7659
7402 @override 7660 @override
7403 Token get beginToken => forKeyword; 7661 Token get beginToken => forKeyword;
7404 7662
7405 /** 7663 /**
7406 * Return the body of the loop. 7664 * Return the body of the loop.
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
7520 * Return `true` if this parameter was declared with the 'final' modifier. 7778 * Return `true` if this parameter was declared with the 'final' modifier.
7521 * Parameters that are declared with the 'const' modifier will return `false` 7779 * Parameters that are declared with the 'const' modifier will return `false`
7522 * even though they are implicitly final. 7780 * even though they are implicitly final.
7523 */ 7781 */
7524 bool get isFinal; 7782 bool get isFinal;
7525 7783
7526 /** 7784 /**
7527 * Return the kind of this parameter. 7785 * Return the kind of this parameter.
7528 */ 7786 */
7529 ParameterKind get kind; 7787 ParameterKind get kind;
7788
7789 /**
7790 * Return the annotations associated with this parameter.
7791 */
7792 NodeList<Annotation> get metadata;
7530 } 7793 }
7531 7794
7532 /** 7795 /**
7533 * The formal parameter list of a method declaration, function declaration, or 7796 * The formal parameter list of a method declaration, function declaration, or
7534 * function type alias. 7797 * function type alias.
7535 * 7798 *
7536 * While the grammar requires all optional formal parameters to follow all of 7799 * While the grammar requires all optional formal parameters to follow all of
7537 * the normal formal parameters and at most one grouping of optional formal 7800 * the normal formal parameters and at most one grouping of optional formal
7538 * parameters, this class does not enforce those constraints. All parameters are 7801 * parameters, this class does not enforce those constraints. All parameters are
7539 * flattened into a single list, which can have any or all kinds of parameters 7802 * flattened into a single list, which can have any or all kinds of parameters
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
7712 * The body of the loop. 7975 * The body of the loop.
7713 */ 7976 */
7714 Statement _body; 7977 Statement _body;
7715 7978
7716 /** 7979 /**
7717 * Initialize a newly created for statement. Either the [variableList] or the 7980 * Initialize a newly created for statement. Either the [variableList] or the
7718 * [initialization] must be `null`. Either the [condition] and the list of 7981 * [initialization] must be `null`. Either the [condition] and the list of
7719 * [updaters] can be `null` if the loop does not have the corresponding 7982 * [updaters] can be `null` if the loop does not have the corresponding
7720 * attribute. 7983 * attribute.
7721 */ 7984 */
7722 ForStatement(this.forKeyword, this.leftParenthesis, 7985 ForStatement(
7723 VariableDeclarationList variableList, Expression initialization, 7986 this.forKeyword,
7724 this.leftSeparator, Expression condition, this.rightSeparator, 7987 this.leftParenthesis,
7725 List<Expression> updaters, this.rightParenthesis, Statement body) { 7988 VariableDeclarationList variableList,
7989 Expression initialization,
7990 this.leftSeparator,
7991 Expression condition,
7992 this.rightSeparator,
7993 List<Expression> updaters,
7994 this.rightParenthesis,
7995 Statement body) {
7726 _variableList = _becomeParentOf(variableList); 7996 _variableList = _becomeParentOf(variableList);
7727 _initialization = _becomeParentOf(initialization); 7997 _initialization = _becomeParentOf(initialization);
7728 _condition = _becomeParentOf(condition); 7998 _condition = _becomeParentOf(condition);
7729 _updaters = new NodeList<Expression>(this, updaters); 7999 _updaters = new NodeList<Expression>(this, updaters);
7730 _body = _becomeParentOf(body); 8000 _body = _becomeParentOf(body);
7731 } 8001 }
7732 8002
7733 @override 8003 @override
7734 Token get beginToken => forKeyword; 8004 Token get beginToken => forKeyword;
7735 8005
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
7890 FunctionExpression _functionExpression; 8160 FunctionExpression _functionExpression;
7891 8161
7892 /** 8162 /**
7893 * Initialize a newly created function declaration. Either or both of the 8163 * Initialize a newly created function declaration. Either or both of the
7894 * [comment] and [metadata] can be `null` if the function does not have the 8164 * [comment] and [metadata] can be `null` if the function does not have the
7895 * corresponding attribute. The [externalKeyword] can be `null` if the 8165 * corresponding attribute. The [externalKeyword] can be `null` if the
7896 * function is not an external function. The [returnType] can be `null` if no 8166 * function is not an external function. The [returnType] can be `null` if no
7897 * return type was specified. The [propertyKeyword] can be `null` if the 8167 * return type was specified. The [propertyKeyword] can be `null` if the
7898 * function is neither a getter or a setter. 8168 * function is neither a getter or a setter.
7899 */ 8169 */
7900 FunctionDeclaration(Comment comment, List<Annotation> metadata, 8170 FunctionDeclaration(
7901 this.externalKeyword, TypeName returnType, this.propertyKeyword, 8171 Comment comment,
7902 SimpleIdentifier name, FunctionExpression functionExpression) 8172 List<Annotation> metadata,
8173 this.externalKeyword,
8174 TypeName returnType,
8175 this.propertyKeyword,
8176 SimpleIdentifier name,
8177 FunctionExpression functionExpression)
7903 : super(comment, metadata, name) { 8178 : super(comment, metadata, name) {
7904 _returnType = _becomeParentOf(returnType); 8179 _returnType = _becomeParentOf(returnType);
7905 _functionExpression = _becomeParentOf(functionExpression); 8180 _functionExpression = _becomeParentOf(functionExpression);
7906 } 8181 }
7907 8182
7908 @override 8183 @override
7909 Iterable get childEntities => super._childEntities 8184 Iterable get childEntities => super._childEntities
7910 ..add(externalKeyword) 8185 ..add(externalKeyword)
7911 ..add(_returnType) 8186 ..add(_returnType)
7912 ..add(propertyKeyword) 8187 ..add(propertyKeyword)
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
8308 */ 8583 */
8309 FormalParameterList _parameters; 8584 FormalParameterList _parameters;
8310 8585
8311 /** 8586 /**
8312 * Initialize a newly created function type alias. Either or both of the 8587 * Initialize a newly created function type alias. Either or both of the
8313 * [comment] and [metadata] can be `null` if the function does not have the 8588 * [comment] and [metadata] can be `null` if the function does not have the
8314 * corresponding attribute. The [returnType] can be `null` if no return type 8589 * corresponding attribute. The [returnType] can be `null` if no return type
8315 * was specified. The [typeParameters] can be `null` if the function has no 8590 * was specified. The [typeParameters] can be `null` if the function has no
8316 * type parameters. 8591 * type parameters.
8317 */ 8592 */
8318 FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword, 8593 FunctionTypeAlias(
8319 TypeName returnType, SimpleIdentifier name, 8594 Comment comment,
8320 TypeParameterList typeParameters, FormalParameterList parameters, 8595 List<Annotation> metadata,
8596 Token keyword,
8597 TypeName returnType,
8598 SimpleIdentifier name,
8599 TypeParameterList typeParameters,
8600 FormalParameterList parameters,
8321 Token semicolon) 8601 Token semicolon)
8322 : super(comment, metadata, keyword, name, semicolon) { 8602 : super(comment, metadata, keyword, name, semicolon) {
8323 _returnType = _becomeParentOf(returnType); 8603 _returnType = _becomeParentOf(returnType);
8324 _typeParameters = _becomeParentOf(typeParameters); 8604 _typeParameters = _becomeParentOf(typeParameters);
8325 _parameters = _becomeParentOf(parameters); 8605 _parameters = _becomeParentOf(parameters);
8326 } 8606 }
8327 8607
8328 @override 8608 @override
8329 Iterable get childEntities => super._childEntities 8609 Iterable get childEntities => super._childEntities
8330 ..add(typedefKeyword) 8610 ..add(typedefKeyword)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
8415 * The parameters of the function-typed parameter. 8695 * The parameters of the function-typed parameter.
8416 */ 8696 */
8417 FormalParameterList _parameters; 8697 FormalParameterList _parameters;
8418 8698
8419 /** 8699 /**
8420 * Initialize a newly created formal parameter. Either or both of the 8700 * Initialize a newly created formal parameter. Either or both of the
8421 * [comment] and [metadata] can be `null` if the parameter does not have the 8701 * [comment] and [metadata] can be `null` if the parameter does not have the
8422 * corresponding attribute. The [returnType] can be `null` if no return type 8702 * corresponding attribute. The [returnType] can be `null` if no return type
8423 * was specified. 8703 * was specified.
8424 */ 8704 */
8425 FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata, 8705 FunctionTypedFormalParameter(
8426 TypeName returnType, SimpleIdentifier identifier, 8706 Comment comment,
8427 TypeParameterList typeParameters, FormalParameterList parameters) 8707 List<Annotation> metadata,
8708 TypeName returnType,
8709 SimpleIdentifier identifier,
8710 TypeParameterList typeParameters,
8711 FormalParameterList parameters)
8428 : super(comment, metadata, identifier) { 8712 : super(comment, metadata, identifier) {
8429 _returnType = _becomeParentOf(returnType); 8713 _returnType = _becomeParentOf(returnType);
8430 _typeParameters = _becomeParentOf(typeParameters); 8714 _typeParameters = _becomeParentOf(typeParameters);
8431 _parameters = _becomeParentOf(parameters); 8715 _parameters = _becomeParentOf(parameters);
8432 } 8716 }
8433 8717
8434 @override 8718 @override
8435 Token get beginToken { 8719 Token get beginToken {
8436 if (_returnType != null) { 8720 if (_returnType != null) {
8437 return _returnType.beginToken; 8721 return _returnType.beginToken;
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
9074 /** 9358 /**
9075 * The statement that is executed if the condition evaluates to `false`, or 9359 * The statement that is executed if the condition evaluates to `false`, or
9076 * `null` if there is no else statement. 9360 * `null` if there is no else statement.
9077 */ 9361 */
9078 Statement _elseStatement; 9362 Statement _elseStatement;
9079 9363
9080 /** 9364 /**
9081 * Initialize a newly created if statement. The [elseKeyword] and 9365 * Initialize a newly created if statement. The [elseKeyword] and
9082 * [elseStatement] can be `null` if there is no else clause. 9366 * [elseStatement] can be `null` if there is no else clause.
9083 */ 9367 */
9084 IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition, 9368 IfStatement(
9085 this.rightParenthesis, Statement thenStatement, this.elseKeyword, 9369 this.ifKeyword,
9370 this.leftParenthesis,
9371 Expression condition,
9372 this.rightParenthesis,
9373 Statement thenStatement,
9374 this.elseKeyword,
9086 Statement elseStatement) { 9375 Statement elseStatement) {
9087 _condition = _becomeParentOf(condition); 9376 _condition = _becomeParentOf(condition);
9088 _thenStatement = _becomeParentOf(thenStatement); 9377 _thenStatement = _becomeParentOf(thenStatement);
9089 _elseStatement = _becomeParentOf(elseStatement); 9378 _elseStatement = _becomeParentOf(elseStatement);
9090 } 9379 }
9091 9380
9092 @override 9381 @override
9093 Token get beginToken => ifKeyword; 9382 Token get beginToken => ifKeyword;
9094 9383
9095 @override 9384 @override
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
9229 } 9518 }
9230 9519
9231 /** 9520 /**
9232 * An import directive. 9521 * An import directive.
9233 * 9522 *
9234 * > importDirective ::= 9523 * > importDirective ::=
9235 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';' 9524 * > [Annotation] 'import' [StringLiteral] ('as' identifier)? [Combinator]* ';'
9236 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';' 9525 * > | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combi nator]* ';'
9237 */ 9526 */
9238 class ImportDirective extends NamespaceDirective { 9527 class ImportDirective extends NamespaceDirective {
9239 static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1, 9528 static Comparator<ImportDirective> COMPARATOR =
9240 ImportDirective import2) { 9529 (ImportDirective import1, ImportDirective import2) {
9241 // 9530 //
9242 // uri 9531 // uri
9243 // 9532 //
9244 StringLiteral uri1 = import1.uri; 9533 StringLiteral uri1 = import1.uri;
9245 StringLiteral uri2 = import2.uri; 9534 StringLiteral uri2 = import2.uri;
9246 String uriStr1 = uri1.stringValue; 9535 String uriStr1 = uri1.stringValue;
9247 String uriStr2 = uri2.stringValue; 9536 String uriStr2 = uri2.stringValue;
9248 if (uriStr1 != null || uriStr2 != null) { 9537 if (uriStr1 != null || uriStr2 != null) {
9249 if (uriStr1 == null) { 9538 if (uriStr1 == null) {
9250 return -1; 9539 return -1;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
9349 SimpleIdentifier _prefix; 9638 SimpleIdentifier _prefix;
9350 9639
9351 /** 9640 /**
9352 * Initialize a newly created import directive. Either or both of the 9641 * Initialize a newly created import directive. Either or both of the
9353 * [comment] and [metadata] can be `null` if the function does not have the 9642 * [comment] and [metadata] can be `null` if the function does not have the
9354 * corresponding attribute. The [deferredKeyword] can be `null` if the import 9643 * corresponding attribute. The [deferredKeyword] can be `null` if the import
9355 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import 9644 * is not deferred. The [asKeyword] and [prefix] can be `null` if the import
9356 * does not specify a prefix. The list of [combinators] can be `null` if there 9645 * does not specify a prefix. The list of [combinators] can be `null` if there
9357 * are no combinators. 9646 * are no combinators.
9358 */ 9647 */
9359 ImportDirective(Comment comment, List<Annotation> metadata, Token keyword, 9648 ImportDirective(
9360 StringLiteral libraryUri, this.deferredKeyword, this.asKeyword, 9649 Comment comment,
9361 SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon) 9650 List<Annotation> metadata,
9651 Token keyword,
9652 StringLiteral libraryUri,
9653 this.deferredKeyword,
9654 this.asKeyword,
9655 SimpleIdentifier prefix,
9656 List<Combinator> combinators,
9657 Token semicolon)
9362 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) { 9658 : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
9363 _prefix = _becomeParentOf(prefix); 9659 _prefix = _becomeParentOf(prefix);
9364 } 9660 }
9365 9661
9366 /** 9662 /**
9367 * The token representing the 'as' token, or `null` if the imported names are 9663 * The token representing the 'as' token, or `null` if the imported names are
9368 * not prefixed. 9664 * not prefixed.
9369 */ 9665 */
9370 @deprecated // Use "this.asKeyword" 9666 @deprecated // Use "this.asKeyword"
9371 Token get asToken => asKeyword; 9667 Token get asToken => asKeyword;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
9466 * mapping of old tokens to new tokens. 9762 * mapping of old tokens to new tokens.
9467 */ 9763 */
9468 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); 9764 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap);
9469 9765
9470 @override 9766 @override
9471 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => 9767 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) =>
9472 new AdjacentStrings(_cloneNodeList(node.strings)); 9768 new AdjacentStrings(_cloneNodeList(node.strings));
9473 9769
9474 @override 9770 @override
9475 Annotation visitAnnotation(Annotation node) { 9771 Annotation visitAnnotation(Annotation node) {
9476 Annotation copy = new Annotation(_mapToken(node.atSign), 9772 Annotation copy = new Annotation(
9477 _cloneNode(node.name), _mapToken(node.period), 9773 _mapToken(node.atSign),
9478 _cloneNode(node.constructorName), _cloneNode(node.arguments)); 9774 _cloneNode(node.name),
9775 _mapToken(node.period),
9776 _cloneNode(node.constructorName),
9777 _cloneNode(node.arguments));
9479 copy.element = node.element; 9778 copy.element = node.element;
9480 return copy; 9779 return copy;
9481 } 9780 }
9482 9781
9483 @override 9782 @override
9484 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( 9783 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
9485 _mapToken(node.leftParenthesis), _cloneNodeList(node.arguments), 9784 _mapToken(node.leftParenthesis),
9785 _cloneNodeList(node.arguments),
9486 _mapToken(node.rightParenthesis)); 9786 _mapToken(node.rightParenthesis));
9487 9787
9488 @override 9788 @override
9489 AsExpression visitAsExpression(AsExpression node) { 9789 AsExpression visitAsExpression(AsExpression node) {
9490 AsExpression copy = new AsExpression(_cloneNode(node.expression), 9790 AsExpression copy = new AsExpression(_cloneNode(node.expression),
9491 _mapToken(node.asOperator), _cloneNode(node.type)); 9791 _mapToken(node.asOperator), _cloneNode(node.type));
9492 copy.propagatedType = node.propagatedType; 9792 copy.propagatedType = node.propagatedType;
9493 copy.staticType = node.staticType; 9793 copy.staticType = node.staticType;
9494 return copy; 9794 return copy;
9495 } 9795 }
9496 9796
9497 @override 9797 @override
9498 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( 9798 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
9499 _mapToken(node.assertKeyword), _mapToken(node.leftParenthesis), 9799 _mapToken(node.assertKeyword),
9500 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 9800 _mapToken(node.leftParenthesis),
9801 _cloneNode(node.condition),
9802 _mapToken(node.rightParenthesis),
9501 _mapToken(node.semicolon)); 9803 _mapToken(node.semicolon));
9502 9804
9503 @override 9805 @override
9504 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { 9806 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
9505 AssignmentExpression copy = new AssignmentExpression( 9807 AssignmentExpression copy = new AssignmentExpression(
9506 _cloneNode(node.leftHandSide), _mapToken(node.operator), 9808 _cloneNode(node.leftHandSide),
9809 _mapToken(node.operator),
9507 _cloneNode(node.rightHandSide)); 9810 _cloneNode(node.rightHandSide));
9508 copy.propagatedElement = node.propagatedElement; 9811 copy.propagatedElement = node.propagatedElement;
9509 copy.propagatedType = node.propagatedType; 9812 copy.propagatedType = node.propagatedType;
9510 copy.staticElement = node.staticElement; 9813 copy.staticElement = node.staticElement;
9511 copy.staticType = node.staticType; 9814 copy.staticType = node.staticType;
9512 return copy; 9815 return copy;
9513 } 9816 }
9514 9817
9515 @override 9818 @override
9516 AwaitExpression visitAwaitExpression(AwaitExpression node) => 9819 AwaitExpression visitAwaitExpression(AwaitExpression node) =>
9517 new AwaitExpression( 9820 new AwaitExpression(
9518 _mapToken(node.awaitKeyword), _cloneNode(node.expression)); 9821 _mapToken(node.awaitKeyword), _cloneNode(node.expression));
9519 9822
9520 @override 9823 @override
9521 BinaryExpression visitBinaryExpression(BinaryExpression node) { 9824 BinaryExpression visitBinaryExpression(BinaryExpression node) {
9522 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), 9825 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand),
9523 _mapToken(node.operator), _cloneNode(node.rightOperand)); 9826 _mapToken(node.operator), _cloneNode(node.rightOperand));
9524 copy.propagatedElement = node.propagatedElement; 9827 copy.propagatedElement = node.propagatedElement;
9525 copy.propagatedType = node.propagatedType; 9828 copy.propagatedType = node.propagatedType;
9526 copy.staticElement = node.staticElement; 9829 copy.staticElement = node.staticElement;
9527 copy.staticType = node.staticType; 9830 copy.staticType = node.staticType;
9528 return copy; 9831 return copy;
9529 } 9832 }
9530 9833
9531 @override 9834 @override
9532 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), 9835 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket),
9533 _cloneNodeList(node.statements), _mapToken(node.rightBracket)); 9836 _cloneNodeList(node.statements), _mapToken(node.rightBracket));
9534 9837
9535 @override 9838 @override
9536 BlockFunctionBody visitBlockFunctionBody( 9839 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
9537 BlockFunctionBody node) => new BlockFunctionBody( 9840 new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star),
9538 _mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block)); 9841 _cloneNode(node.block));
9539 9842
9540 @override 9843 @override
9541 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { 9844 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
9542 BooleanLiteral copy = 9845 BooleanLiteral copy =
9543 new BooleanLiteral(_mapToken(node.literal), node.value); 9846 new BooleanLiteral(_mapToken(node.literal), node.value);
9544 copy.propagatedType = node.propagatedType; 9847 copy.propagatedType = node.propagatedType;
9545 copy.staticType = node.staticType; 9848 copy.staticType = node.staticType;
9546 return copy; 9849 return copy;
9547 } 9850 }
9548 9851
9549 @override 9852 @override
9550 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( 9853 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
9551 _mapToken(node.breakKeyword), _cloneNode(node.label), 9854 _mapToken(node.breakKeyword),
9855 _cloneNode(node.label),
9552 _mapToken(node.semicolon)); 9856 _mapToken(node.semicolon));
9553 9857
9554 @override 9858 @override
9555 CascadeExpression visitCascadeExpression(CascadeExpression node) { 9859 CascadeExpression visitCascadeExpression(CascadeExpression node) {
9556 CascadeExpression copy = new CascadeExpression( 9860 CascadeExpression copy = new CascadeExpression(
9557 _cloneNode(node.target), _cloneNodeList(node.cascadeSections)); 9861 _cloneNode(node.target), _cloneNodeList(node.cascadeSections));
9558 copy.propagatedType = node.propagatedType; 9862 copy.propagatedType = node.propagatedType;
9559 copy.staticType = node.staticType; 9863 copy.staticType = node.staticType;
9560 return copy; 9864 return copy;
9561 } 9865 }
9562 9866
9563 @override 9867 @override
9564 CatchClause visitCatchClause(CatchClause node) => new CatchClause( 9868 CatchClause visitCatchClause(CatchClause node) => new CatchClause(
9565 _mapToken(node.onKeyword), _cloneNode(node.exceptionType), 9869 _mapToken(node.onKeyword),
9566 _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis), 9870 _cloneNode(node.exceptionType),
9567 _cloneNode(node.exceptionParameter), _mapToken(node.comma), 9871 _mapToken(node.catchKeyword),
9568 _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis), 9872 _mapToken(node.leftParenthesis),
9873 _cloneNode(node.exceptionParameter),
9874 _mapToken(node.comma),
9875 _cloneNode(node.stackTraceParameter),
9876 _mapToken(node.rightParenthesis),
9569 _cloneNode(node.body)); 9877 _cloneNode(node.body));
9570 9878
9571 @override 9879 @override
9572 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { 9880 ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
9573 ClassDeclaration copy = new ClassDeclaration( 9881 ClassDeclaration copy = new ClassDeclaration(
9574 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9882 _cloneNode(node.documentationComment),
9575 _mapToken(node.abstractKeyword), _mapToken(node.classKeyword), 9883 _cloneNodeList(node.metadata),
9576 _cloneNode(node.name), _cloneNode(node.typeParameters), 9884 _mapToken(node.abstractKeyword),
9577 _cloneNode(node.extendsClause), _cloneNode(node.withClause), 9885 _mapToken(node.classKeyword),
9578 _cloneNode(node.implementsClause), _mapToken(node.leftBracket), 9886 _cloneNode(node.name),
9579 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 9887 _cloneNode(node.typeParameters),
9888 _cloneNode(node.extendsClause),
9889 _cloneNode(node.withClause),
9890 _cloneNode(node.implementsClause),
9891 _mapToken(node.leftBracket),
9892 _cloneNodeList(node.members),
9893 _mapToken(node.rightBracket));
9580 copy.nativeClause = _cloneNode(node.nativeClause); 9894 copy.nativeClause = _cloneNode(node.nativeClause);
9581 return copy; 9895 return copy;
9582 } 9896 }
9583 9897
9584 @override 9898 @override
9585 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( 9899 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
9586 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9900 _cloneNode(node.documentationComment),
9587 _mapToken(node.typedefKeyword), _cloneNode(node.name), 9901 _cloneNodeList(node.metadata),
9588 _cloneNode(node.typeParameters), _mapToken(node.equals), 9902 _mapToken(node.typedefKeyword),
9589 _mapToken(node.abstractKeyword), _cloneNode(node.superclass), 9903 _cloneNode(node.name),
9590 _cloneNode(node.withClause), _cloneNode(node.implementsClause), 9904 _cloneNode(node.typeParameters),
9905 _mapToken(node.equals),
9906 _mapToken(node.abstractKeyword),
9907 _cloneNode(node.superclass),
9908 _cloneNode(node.withClause),
9909 _cloneNode(node.implementsClause),
9591 _mapToken(node.semicolon)); 9910 _mapToken(node.semicolon));
9592 9911
9593 @override 9912 @override
9594 Comment visitComment(Comment node) { 9913 Comment visitComment(Comment node) {
9595 if (node.isDocumentation) { 9914 if (node.isDocumentation) {
9596 return Comment.createDocumentationCommentWithReferences( 9915 return Comment.createDocumentationCommentWithReferences(
9597 _mapTokens(node.tokens), _cloneNodeList(node.references)); 9916 _mapTokens(node.tokens), _cloneNodeList(node.references));
9598 } else if (node.isBlock) { 9917 } else if (node.isBlock) {
9599 return Comment.createBlockComment(_mapTokens(node.tokens)); 9918 return Comment.createBlockComment(_mapTokens(node.tokens));
9600 } 9919 }
9601 return Comment.createEndOfLineComment(_mapTokens(node.tokens)); 9920 return Comment.createEndOfLineComment(_mapTokens(node.tokens));
9602 } 9921 }
9603 9922
9604 @override 9923 @override
9605 CommentReference visitCommentReference(CommentReference node) => 9924 CommentReference visitCommentReference(CommentReference node) =>
9606 new CommentReference( 9925 new CommentReference(
9607 _mapToken(node.newKeyword), _cloneNode(node.identifier)); 9926 _mapToken(node.newKeyword), _cloneNode(node.identifier));
9608 9927
9609 @override 9928 @override
9610 CompilationUnit visitCompilationUnit(CompilationUnit node) { 9929 CompilationUnit visitCompilationUnit(CompilationUnit node) {
9611 CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken), 9930 CompilationUnit copy = new CompilationUnit(
9612 _cloneNode(node.scriptTag), _cloneNodeList(node.directives), 9931 _mapToken(node.beginToken),
9613 _cloneNodeList(node.declarations), _mapToken(node.endToken)); 9932 _cloneNode(node.scriptTag),
9933 _cloneNodeList(node.directives),
9934 _cloneNodeList(node.declarations),
9935 _mapToken(node.endToken));
9614 copy.lineInfo = node.lineInfo; 9936 copy.lineInfo = node.lineInfo;
9615 copy.element = node.element; 9937 copy.element = node.element;
9616 return copy; 9938 return copy;
9617 } 9939 }
9618 9940
9619 @override 9941 @override
9620 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { 9942 ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
9621 ConditionalExpression copy = new ConditionalExpression( 9943 ConditionalExpression copy = new ConditionalExpression(
9622 _cloneNode(node.condition), _mapToken(node.question), 9944 _cloneNode(node.condition),
9623 _cloneNode(node.thenExpression), _mapToken(node.colon), 9945 _mapToken(node.question),
9946 _cloneNode(node.thenExpression),
9947 _mapToken(node.colon),
9624 _cloneNode(node.elseExpression)); 9948 _cloneNode(node.elseExpression));
9625 copy.propagatedType = node.propagatedType; 9949 copy.propagatedType = node.propagatedType;
9626 copy.staticType = node.staticType; 9950 copy.staticType = node.staticType;
9627 return copy; 9951 return copy;
9628 } 9952 }
9629 9953
9630 @override 9954 @override
9631 ConstructorDeclaration visitConstructorDeclaration( 9955 ConstructorDeclaration visitConstructorDeclaration(
9632 ConstructorDeclaration node) { 9956 ConstructorDeclaration node) {
9633 ConstructorDeclaration copy = new ConstructorDeclaration( 9957 ConstructorDeclaration copy = new ConstructorDeclaration(
9634 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 9958 _cloneNode(node.documentationComment),
9635 _mapToken(node.externalKeyword), _mapToken(node.constKeyword), 9959 _cloneNodeList(node.metadata),
9636 _mapToken(node.factoryKeyword), _cloneNode(node.returnType), 9960 _mapToken(node.externalKeyword),
9637 _mapToken(node.period), _cloneNode(node.name), 9961 _mapToken(node.constKeyword),
9638 _cloneNode(node.parameters), _mapToken(node.separator), 9962 _mapToken(node.factoryKeyword),
9963 _cloneNode(node.returnType),
9964 _mapToken(node.period),
9965 _cloneNode(node.name),
9966 _cloneNode(node.parameters),
9967 _mapToken(node.separator),
9639 _cloneNodeList(node.initializers), 9968 _cloneNodeList(node.initializers),
9640 _cloneNode(node.redirectedConstructor), _cloneNode(node.body)); 9969 _cloneNode(node.redirectedConstructor),
9970 _cloneNode(node.body));
9641 copy.element = node.element; 9971 copy.element = node.element;
9642 return copy; 9972 return copy;
9643 } 9973 }
9644 9974
9645 @override 9975 @override
9646 ConstructorFieldInitializer visitConstructorFieldInitializer( 9976 ConstructorFieldInitializer visitConstructorFieldInitializer(
9647 ConstructorFieldInitializer node) => new ConstructorFieldInitializer( 9977 ConstructorFieldInitializer node) =>
9648 _mapToken(node.thisKeyword), _mapToken(node.period), 9978 new ConstructorFieldInitializer(
9649 _cloneNode(node.fieldName), _mapToken(node.equals), 9979 _mapToken(node.thisKeyword),
9650 _cloneNode(node.expression)); 9980 _mapToken(node.period),
9981 _cloneNode(node.fieldName),
9982 _mapToken(node.equals),
9983 _cloneNode(node.expression));
9651 9984
9652 @override 9985 @override
9653 ConstructorName visitConstructorName(ConstructorName node) { 9986 ConstructorName visitConstructorName(ConstructorName node) {
9654 ConstructorName copy = new ConstructorName( 9987 ConstructorName copy = new ConstructorName(
9655 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name)); 9988 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name));
9656 copy.staticElement = node.staticElement; 9989 copy.staticElement = node.staticElement;
9657 return copy; 9990 return copy;
9658 } 9991 }
9659 9992
9660 @override 9993 @override
9661 ContinueStatement visitContinueStatement(ContinueStatement node) => 9994 ContinueStatement visitContinueStatement(ContinueStatement node) =>
9662 new ContinueStatement(_mapToken(node.continueKeyword), 9995 new ContinueStatement(_mapToken(node.continueKeyword),
9663 _cloneNode(node.label), _mapToken(node.semicolon)); 9996 _cloneNode(node.label), _mapToken(node.semicolon));
9664 9997
9665 @override 9998 @override
9666 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => 9999 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
9667 new DeclaredIdentifier(_cloneNode(node.documentationComment), 10000 new DeclaredIdentifier(
9668 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10001 _cloneNode(node.documentationComment),
9669 _cloneNode(node.type), _cloneNode(node.identifier)); 10002 _cloneNodeList(node.metadata),
10003 _mapToken(node.keyword),
10004 _cloneNode(node.type),
10005 _cloneNode(node.identifier));
9670 10006
9671 @override 10007 @override
9672 DefaultFormalParameter visitDefaultFormalParameter( 10008 DefaultFormalParameter visitDefaultFormalParameter(
9673 DefaultFormalParameter node) => new DefaultFormalParameter( 10009 DefaultFormalParameter node) =>
9674 _cloneNode(node.parameter), node.kind, _mapToken(node.separator), 10010 new DefaultFormalParameter(_cloneNode(node.parameter), node.kind,
9675 _cloneNode(node.defaultValue)); 10011 _mapToken(node.separator), _cloneNode(node.defaultValue));
9676 10012
9677 @override 10013 @override
9678 DoStatement visitDoStatement(DoStatement node) => new DoStatement( 10014 DoStatement visitDoStatement(DoStatement node) => new DoStatement(
9679 _mapToken(node.doKeyword), _cloneNode(node.body), 10015 _mapToken(node.doKeyword),
9680 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10016 _cloneNode(node.body),
9681 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10017 _mapToken(node.whileKeyword),
10018 _mapToken(node.leftParenthesis),
10019 _cloneNode(node.condition),
10020 _mapToken(node.rightParenthesis),
9682 _mapToken(node.semicolon)); 10021 _mapToken(node.semicolon));
9683 10022
9684 @override 10023 @override
9685 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { 10024 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) {
9686 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); 10025 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value);
9687 copy.propagatedType = node.propagatedType; 10026 copy.propagatedType = node.propagatedType;
9688 copy.staticType = node.staticType; 10027 copy.staticType = node.staticType;
9689 return copy; 10028 return copy;
9690 } 10029 }
9691 10030
9692 @override 10031 @override
9693 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => 10032 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) =>
9694 new EmptyFunctionBody(_mapToken(node.semicolon)); 10033 new EmptyFunctionBody(_mapToken(node.semicolon));
9695 10034
9696 @override 10035 @override
9697 EmptyStatement visitEmptyStatement(EmptyStatement node) => 10036 EmptyStatement visitEmptyStatement(EmptyStatement node) =>
9698 new EmptyStatement(_mapToken(node.semicolon)); 10037 new EmptyStatement(_mapToken(node.semicolon));
9699 10038
9700 @override 10039 @override
9701 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => 10040 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) =>
9702 new EnumConstantDeclaration(_cloneNode(node.documentationComment), 10041 new EnumConstantDeclaration(_cloneNode(node.documentationComment),
9703 _cloneNodeList(node.metadata), _cloneNode(node.name)); 10042 _cloneNodeList(node.metadata), _cloneNode(node.name));
9704 10043
9705 @override 10044 @override
9706 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration( 10045 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(
9707 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10046 _cloneNode(node.documentationComment),
9708 _mapToken(node.enumKeyword), _cloneNode(node.name), 10047 _cloneNodeList(node.metadata),
9709 _mapToken(node.leftBracket), _cloneNodeList(node.constants), 10048 _mapToken(node.enumKeyword),
10049 _cloneNode(node.name),
10050 _mapToken(node.leftBracket),
10051 _cloneNodeList(node.constants),
9710 _mapToken(node.rightBracket)); 10052 _mapToken(node.rightBracket));
9711 10053
9712 @override 10054 @override
9713 ExportDirective visitExportDirective(ExportDirective node) { 10055 ExportDirective visitExportDirective(ExportDirective node) {
9714 ExportDirective copy = new ExportDirective( 10056 ExportDirective copy = new ExportDirective(
9715 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10057 _cloneNode(node.documentationComment),
9716 _mapToken(node.keyword), _cloneNode(node.uri), 10058 _cloneNodeList(node.metadata),
9717 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10059 _mapToken(node.keyword),
10060 _cloneNode(node.uri),
10061 _cloneNodeList(node.combinators),
10062 _mapToken(node.semicolon));
9718 copy.element = node.element; 10063 copy.element = node.element;
9719 return copy; 10064 return copy;
9720 } 10065 }
9721 10066
9722 @override 10067 @override
9723 ExpressionFunctionBody visitExpressionFunctionBody( 10068 ExpressionFunctionBody visitExpressionFunctionBody(
9724 ExpressionFunctionBody node) => new ExpressionFunctionBody( 10069 ExpressionFunctionBody node) =>
9725 _mapToken(node.keyword), _mapToken(node.functionDefinition), 10070 new ExpressionFunctionBody(
9726 _cloneNode(node.expression), _mapToken(node.semicolon)); 10071 _mapToken(node.keyword),
10072 _mapToken(node.functionDefinition),
10073 _cloneNode(node.expression),
10074 _mapToken(node.semicolon));
9727 10075
9728 @override 10076 @override
9729 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => 10077 ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
9730 new ExpressionStatement( 10078 new ExpressionStatement(
9731 _cloneNode(node.expression), _mapToken(node.semicolon)); 10079 _cloneNode(node.expression), _mapToken(node.semicolon));
9732 10080
9733 @override 10081 @override
9734 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( 10082 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause(
9735 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); 10083 _mapToken(node.extendsKeyword), _cloneNode(node.superclass));
9736 10084
9737 @override 10085 @override
9738 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => 10086 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
9739 new FieldDeclaration(_cloneNode(node.documentationComment), 10087 new FieldDeclaration(
9740 _cloneNodeList(node.metadata), _mapToken(node.staticKeyword), 10088 _cloneNode(node.documentationComment),
9741 _cloneNode(node.fields), _mapToken(node.semicolon)); 10089 _cloneNodeList(node.metadata),
10090 _mapToken(node.staticKeyword),
10091 _cloneNode(node.fields),
10092 _mapToken(node.semicolon));
9742 10093
9743 @override 10094 @override
9744 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => 10095 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
9745 new FieldFormalParameter(_cloneNode(node.documentationComment), 10096 new FieldFormalParameter(
9746 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10097 _cloneNode(node.documentationComment),
9747 _cloneNode(node.type), _mapToken(node.thisKeyword), 10098 _cloneNodeList(node.metadata),
9748 _mapToken(node.period), _cloneNode(node.identifier), 10099 _mapToken(node.keyword),
9749 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10100 _cloneNode(node.type),
10101 _mapToken(node.thisKeyword),
10102 _mapToken(node.period),
10103 _cloneNode(node.identifier),
10104 _cloneNode(node.typeParameters),
10105 _cloneNode(node.parameters));
9750 10106
9751 @override 10107 @override
9752 ForEachStatement visitForEachStatement(ForEachStatement node) { 10108 ForEachStatement visitForEachStatement(ForEachStatement node) {
9753 DeclaredIdentifier loopVariable = node.loopVariable; 10109 DeclaredIdentifier loopVariable = node.loopVariable;
9754 if (loopVariable == null) { 10110 if (loopVariable == null) {
9755 return new ForEachStatement.withReference(_mapToken(node.awaitKeyword), 10111 return new ForEachStatement.withReference(
9756 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10112 _mapToken(node.awaitKeyword),
9757 _cloneNode(node.identifier), _mapToken(node.inKeyword), 10113 _mapToken(node.forKeyword),
9758 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10114 _mapToken(node.leftParenthesis),
10115 _cloneNode(node.identifier),
10116 _mapToken(node.inKeyword),
10117 _cloneNode(node.iterable),
10118 _mapToken(node.rightParenthesis),
9759 _cloneNode(node.body)); 10119 _cloneNode(node.body));
9760 } 10120 }
9761 return new ForEachStatement.withDeclaration(_mapToken(node.awaitKeyword), 10121 return new ForEachStatement.withDeclaration(
9762 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10122 _mapToken(node.awaitKeyword),
9763 _cloneNode(loopVariable), _mapToken(node.inKeyword), 10123 _mapToken(node.forKeyword),
9764 _cloneNode(node.iterable), _mapToken(node.rightParenthesis), 10124 _mapToken(node.leftParenthesis),
10125 _cloneNode(loopVariable),
10126 _mapToken(node.inKeyword),
10127 _cloneNode(node.iterable),
10128 _mapToken(node.rightParenthesis),
9765 _cloneNode(node.body)); 10129 _cloneNode(node.body));
9766 } 10130 }
9767 10131
9768 @override 10132 @override
9769 FormalParameterList visitFormalParameterList(FormalParameterList node) => 10133 FormalParameterList visitFormalParameterList(FormalParameterList node) =>
9770 new FormalParameterList(_mapToken(node.leftParenthesis), 10134 new FormalParameterList(
9771 _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter), 10135 _mapToken(node.leftParenthesis),
9772 _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis)); 10136 _cloneNodeList(node.parameters),
10137 _mapToken(node.leftDelimiter),
10138 _mapToken(node.rightDelimiter),
10139 _mapToken(node.rightParenthesis));
9773 10140
9774 @override 10141 @override
9775 ForStatement visitForStatement(ForStatement node) => new ForStatement( 10142 ForStatement visitForStatement(ForStatement node) => new ForStatement(
9776 _mapToken(node.forKeyword), _mapToken(node.leftParenthesis), 10143 _mapToken(node.forKeyword),
9777 _cloneNode(node.variables), _cloneNode(node.initialization), 10144 _mapToken(node.leftParenthesis),
9778 _mapToken(node.leftSeparator), _cloneNode(node.condition), 10145 _cloneNode(node.variables),
9779 _mapToken(node.rightSeparator), _cloneNodeList(node.updaters), 10146 _cloneNode(node.initialization),
9780 _mapToken(node.rightParenthesis), _cloneNode(node.body)); 10147 _mapToken(node.leftSeparator),
10148 _cloneNode(node.condition),
10149 _mapToken(node.rightSeparator),
10150 _cloneNodeList(node.updaters),
10151 _mapToken(node.rightParenthesis),
10152 _cloneNode(node.body));
9781 10153
9782 @override 10154 @override
9783 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => 10155 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
9784 new FunctionDeclaration(_cloneNode(node.documentationComment), 10156 new FunctionDeclaration(
9785 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10157 _cloneNode(node.documentationComment),
9786 _cloneNode(node.returnType), _mapToken(node.propertyKeyword), 10158 _cloneNodeList(node.metadata),
9787 _cloneNode(node.name), _cloneNode(node.functionExpression)); 10159 _mapToken(node.externalKeyword),
10160 _cloneNode(node.returnType),
10161 _mapToken(node.propertyKeyword),
10162 _cloneNode(node.name),
10163 _cloneNode(node.functionExpression));
9788 10164
9789 @override 10165 @override
9790 FunctionDeclarationStatement visitFunctionDeclarationStatement( 10166 FunctionDeclarationStatement visitFunctionDeclarationStatement(
9791 FunctionDeclarationStatement node) => 10167 FunctionDeclarationStatement node) =>
9792 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration)); 10168 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration));
9793 10169
9794 @override 10170 @override
9795 FunctionExpression visitFunctionExpression(FunctionExpression node) { 10171 FunctionExpression visitFunctionExpression(FunctionExpression node) {
9796 FunctionExpression copy = new FunctionExpression( 10172 FunctionExpression copy = new FunctionExpression(
9797 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10173 _cloneNode(node.typeParameters),
10174 _cloneNode(node.parameters),
9798 _cloneNode(node.body)); 10175 _cloneNode(node.body));
9799 copy.element = node.element; 10176 copy.element = node.element;
9800 copy.propagatedType = node.propagatedType; 10177 copy.propagatedType = node.propagatedType;
9801 copy.staticType = node.staticType; 10178 copy.staticType = node.staticType;
9802 return copy; 10179 return copy;
9803 } 10180 }
9804 10181
9805 @override 10182 @override
9806 FunctionExpressionInvocation visitFunctionExpressionInvocation( 10183 FunctionExpressionInvocation visitFunctionExpressionInvocation(
9807 FunctionExpressionInvocation node) { 10184 FunctionExpressionInvocation node) {
9808 FunctionExpressionInvocation copy = new FunctionExpressionInvocation( 10185 FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
9809 _cloneNode(node.function), _cloneNode(node.typeArguments), 10186 _cloneNode(node.function),
10187 _cloneNode(node.typeArguments),
9810 _cloneNode(node.argumentList)); 10188 _cloneNode(node.argumentList));
9811 copy.propagatedElement = node.propagatedElement; 10189 copy.propagatedElement = node.propagatedElement;
9812 copy.propagatedType = node.propagatedType; 10190 copy.propagatedType = node.propagatedType;
9813 copy.staticElement = node.staticElement; 10191 copy.staticElement = node.staticElement;
9814 copy.staticType = node.staticType; 10192 copy.staticType = node.staticType;
9815 return copy; 10193 return copy;
9816 } 10194 }
9817 10195
9818 @override 10196 @override
9819 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => 10197 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
9820 new FunctionTypeAlias(_cloneNode(node.documentationComment), 10198 new FunctionTypeAlias(
9821 _cloneNodeList(node.metadata), _mapToken(node.typedefKeyword), 10199 _cloneNode(node.documentationComment),
9822 _cloneNode(node.returnType), _cloneNode(node.name), 10200 _cloneNodeList(node.metadata),
9823 _cloneNode(node.typeParameters), _cloneNode(node.parameters), 10201 _mapToken(node.typedefKeyword),
10202 _cloneNode(node.returnType),
10203 _cloneNode(node.name),
10204 _cloneNode(node.typeParameters),
10205 _cloneNode(node.parameters),
9824 _mapToken(node.semicolon)); 10206 _mapToken(node.semicolon));
9825 10207
9826 @override 10208 @override
9827 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( 10209 FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
9828 FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter( 10210 FunctionTypedFormalParameter node) =>
9829 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10211 new FunctionTypedFormalParameter(
9830 _cloneNode(node.returnType), _cloneNode(node.identifier), 10212 _cloneNode(node.documentationComment),
9831 _cloneNode(node.typeParameters), _cloneNode(node.parameters)); 10213 _cloneNodeList(node.metadata),
10214 _cloneNode(node.returnType),
10215 _cloneNode(node.identifier),
10216 _cloneNode(node.typeParameters),
10217 _cloneNode(node.parameters));
9832 10218
9833 @override 10219 @override
9834 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( 10220 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
9835 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames)); 10221 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames));
9836 10222
9837 @override 10223 @override
9838 IfStatement visitIfStatement(IfStatement node) => new IfStatement( 10224 IfStatement visitIfStatement(IfStatement node) => new IfStatement(
9839 _mapToken(node.ifKeyword), _mapToken(node.leftParenthesis), 10225 _mapToken(node.ifKeyword),
9840 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10226 _mapToken(node.leftParenthesis),
9841 _cloneNode(node.thenStatement), _mapToken(node.elseKeyword), 10227 _cloneNode(node.condition),
10228 _mapToken(node.rightParenthesis),
10229 _cloneNode(node.thenStatement),
10230 _mapToken(node.elseKeyword),
9842 _cloneNode(node.elseStatement)); 10231 _cloneNode(node.elseStatement));
9843 10232
9844 @override 10233 @override
9845 ImplementsClause visitImplementsClause(ImplementsClause node) => 10234 ImplementsClause visitImplementsClause(ImplementsClause node) =>
9846 new ImplementsClause( 10235 new ImplementsClause(
9847 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); 10236 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces));
9848 10237
9849 @override 10238 @override
9850 ImportDirective visitImportDirective(ImportDirective node) => 10239 ImportDirective visitImportDirective(ImportDirective node) =>
9851 new ImportDirective(_cloneNode(node.documentationComment), 10240 new ImportDirective(
9852 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10241 _cloneNode(node.documentationComment),
9853 _cloneNode(node.uri), _mapToken(node.deferredKeyword), 10242 _cloneNodeList(node.metadata),
9854 _mapToken(node.asKeyword), _cloneNode(node.prefix), 10243 _mapToken(node.keyword),
9855 _cloneNodeList(node.combinators), _mapToken(node.semicolon)); 10244 _cloneNode(node.uri),
10245 _mapToken(node.deferredKeyword),
10246 _mapToken(node.asKeyword),
10247 _cloneNode(node.prefix),
10248 _cloneNodeList(node.combinators),
10249 _mapToken(node.semicolon));
9856 10250
9857 @override 10251 @override
9858 IndexExpression visitIndexExpression(IndexExpression node) { 10252 IndexExpression visitIndexExpression(IndexExpression node) {
9859 Token period = _mapToken(node.period); 10253 Token period = _mapToken(node.period);
9860 IndexExpression copy; 10254 IndexExpression copy;
9861 if (period == null) { 10255 if (period == null) {
9862 copy = new IndexExpression.forTarget(_cloneNode(node.target), 10256 copy = new IndexExpression.forTarget(
9863 _mapToken(node.leftBracket), _cloneNode(node.index), 10257 _cloneNode(node.target),
10258 _mapToken(node.leftBracket),
10259 _cloneNode(node.index),
9864 _mapToken(node.rightBracket)); 10260 _mapToken(node.rightBracket));
9865 } else { 10261 } else {
9866 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), 10262 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket),
9867 _cloneNode(node.index), _mapToken(node.rightBracket)); 10263 _cloneNode(node.index), _mapToken(node.rightBracket));
9868 } 10264 }
9869 copy.auxiliaryElements = node.auxiliaryElements; 10265 copy.auxiliaryElements = node.auxiliaryElements;
9870 copy.propagatedElement = node.propagatedElement; 10266 copy.propagatedElement = node.propagatedElement;
9871 copy.propagatedType = node.propagatedType; 10267 copy.propagatedType = node.propagatedType;
9872 copy.staticElement = node.staticElement; 10268 copy.staticElement = node.staticElement;
9873 copy.staticType = node.staticType; 10269 copy.staticType = node.staticType;
9874 return copy; 10270 return copy;
9875 } 10271 }
9876 10272
9877 @override 10273 @override
9878 InstanceCreationExpression visitInstanceCreationExpression( 10274 InstanceCreationExpression visitInstanceCreationExpression(
9879 InstanceCreationExpression node) { 10275 InstanceCreationExpression node) {
9880 InstanceCreationExpression copy = new InstanceCreationExpression( 10276 InstanceCreationExpression copy = new InstanceCreationExpression(
9881 _mapToken(node.keyword), _cloneNode(node.constructorName), 10277 _mapToken(node.keyword),
10278 _cloneNode(node.constructorName),
9882 _cloneNode(node.argumentList)); 10279 _cloneNode(node.argumentList));
9883 copy.propagatedType = node.propagatedType; 10280 copy.propagatedType = node.propagatedType;
9884 copy.staticElement = node.staticElement; 10281 copy.staticElement = node.staticElement;
9885 copy.staticType = node.staticType; 10282 copy.staticType = node.staticType;
9886 return copy; 10283 return copy;
9887 } 10284 }
9888 10285
9889 @override 10286 @override
9890 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { 10287 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) {
9891 IntegerLiteral copy = 10288 IntegerLiteral copy =
9892 new IntegerLiteral(_mapToken(node.literal), node.value); 10289 new IntegerLiteral(_mapToken(node.literal), node.value);
9893 copy.propagatedType = node.propagatedType; 10290 copy.propagatedType = node.propagatedType;
9894 copy.staticType = node.staticType; 10291 copy.staticType = node.staticType;
9895 return copy; 10292 return copy;
9896 } 10293 }
9897 10294
9898 @override 10295 @override
9899 InterpolationExpression visitInterpolationExpression( 10296 InterpolationExpression visitInterpolationExpression(
9900 InterpolationExpression node) => new InterpolationExpression( 10297 InterpolationExpression node) =>
9901 _mapToken(node.leftBracket), _cloneNode(node.expression), 10298 new InterpolationExpression(_mapToken(node.leftBracket),
9902 _mapToken(node.rightBracket)); 10299 _cloneNode(node.expression), _mapToken(node.rightBracket));
9903 10300
9904 @override 10301 @override
9905 InterpolationString visitInterpolationString(InterpolationString node) => 10302 InterpolationString visitInterpolationString(InterpolationString node) =>
9906 new InterpolationString(_mapToken(node.contents), node.value); 10303 new InterpolationString(_mapToken(node.contents), node.value);
9907 10304
9908 @override 10305 @override
9909 IsExpression visitIsExpression(IsExpression node) { 10306 IsExpression visitIsExpression(IsExpression node) {
9910 IsExpression copy = new IsExpression(_cloneNode(node.expression), 10307 IsExpression copy = new IsExpression(
9911 _mapToken(node.isOperator), _mapToken(node.notOperator), 10308 _cloneNode(node.expression),
10309 _mapToken(node.isOperator),
10310 _mapToken(node.notOperator),
9912 _cloneNode(node.type)); 10311 _cloneNode(node.type));
9913 copy.propagatedType = node.propagatedType; 10312 copy.propagatedType = node.propagatedType;
9914 copy.staticType = node.staticType; 10313 copy.staticType = node.staticType;
9915 return copy; 10314 return copy;
9916 } 10315 }
9917 10316
9918 @override 10317 @override
9919 Label visitLabel(Label node) => 10318 Label visitLabel(Label node) =>
9920 new Label(_cloneNode(node.label), _mapToken(node.colon)); 10319 new Label(_cloneNode(node.label), _mapToken(node.colon));
9921 10320
9922 @override 10321 @override
9923 LabeledStatement visitLabeledStatement(LabeledStatement node) => 10322 LabeledStatement visitLabeledStatement(LabeledStatement node) =>
9924 new LabeledStatement( 10323 new LabeledStatement(
9925 _cloneNodeList(node.labels), _cloneNode(node.statement)); 10324 _cloneNodeList(node.labels), _cloneNode(node.statement));
9926 10325
9927 @override 10326 @override
9928 LibraryDirective visitLibraryDirective(LibraryDirective node) => 10327 LibraryDirective visitLibraryDirective(LibraryDirective node) =>
9929 new LibraryDirective(_cloneNode(node.documentationComment), 10328 new LibraryDirective(
9930 _cloneNodeList(node.metadata), _mapToken(node.libraryKeyword), 10329 _cloneNode(node.documentationComment),
9931 _cloneNode(node.name), _mapToken(node.semicolon)); 10330 _cloneNodeList(node.metadata),
10331 _mapToken(node.libraryKeyword),
10332 _cloneNode(node.name),
10333 _mapToken(node.semicolon));
9932 10334
9933 @override 10335 @override
9934 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { 10336 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
9935 LibraryIdentifier copy = 10337 LibraryIdentifier copy =
9936 new LibraryIdentifier(_cloneNodeList(node.components)); 10338 new LibraryIdentifier(_cloneNodeList(node.components));
9937 copy.propagatedType = node.propagatedType; 10339 copy.propagatedType = node.propagatedType;
9938 copy.staticType = node.staticType; 10340 copy.staticType = node.staticType;
9939 return copy; 10341 return copy;
9940 } 10342 }
9941 10343
9942 @override 10344 @override
9943 ListLiteral visitListLiteral(ListLiteral node) { 10345 ListLiteral visitListLiteral(ListLiteral node) {
9944 ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword), 10346 ListLiteral copy = new ListLiteral(
9945 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10347 _mapToken(node.constKeyword),
9946 _cloneNodeList(node.elements), _mapToken(node.rightBracket)); 10348 _cloneNode(node.typeArguments),
10349 _mapToken(node.leftBracket),
10350 _cloneNodeList(node.elements),
10351 _mapToken(node.rightBracket));
9947 copy.propagatedType = node.propagatedType; 10352 copy.propagatedType = node.propagatedType;
9948 copy.staticType = node.staticType; 10353 copy.staticType = node.staticType;
9949 return copy; 10354 return copy;
9950 } 10355 }
9951 10356
9952 @override 10357 @override
9953 MapLiteral visitMapLiteral(MapLiteral node) { 10358 MapLiteral visitMapLiteral(MapLiteral node) {
9954 MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword), 10359 MapLiteral copy = new MapLiteral(
9955 _cloneNode(node.typeArguments), _mapToken(node.leftBracket), 10360 _mapToken(node.constKeyword),
9956 _cloneNodeList(node.entries), _mapToken(node.rightBracket)); 10361 _cloneNode(node.typeArguments),
10362 _mapToken(node.leftBracket),
10363 _cloneNodeList(node.entries),
10364 _mapToken(node.rightBracket));
9957 copy.propagatedType = node.propagatedType; 10365 copy.propagatedType = node.propagatedType;
9958 copy.staticType = node.staticType; 10366 copy.staticType = node.staticType;
9959 return copy; 10367 return copy;
9960 } 10368 }
9961 10369
9962 @override 10370 @override
9963 MapLiteralEntry visitMapLiteralEntry( 10371 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
9964 MapLiteralEntry node) => new MapLiteralEntry( 10372 new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator),
9965 _cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value)); 10373 _cloneNode(node.value));
9966 10374
9967 @override 10375 @override
9968 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => 10376 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
9969 new MethodDeclaration(_cloneNode(node.documentationComment), 10377 new MethodDeclaration(
9970 _cloneNodeList(node.metadata), _mapToken(node.externalKeyword), 10378 _cloneNode(node.documentationComment),
9971 _mapToken(node.modifierKeyword), _cloneNode(node.returnType), 10379 _cloneNodeList(node.metadata),
9972 _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword), 10380 _mapToken(node.externalKeyword),
9973 _cloneNode(node.name), _cloneNode(node._typeParameters), 10381 _mapToken(node.modifierKeyword),
9974 _cloneNode(node.parameters), _cloneNode(node.body)); 10382 _cloneNode(node.returnType),
10383 _mapToken(node.propertyKeyword),
10384 _mapToken(node.operatorKeyword),
10385 _cloneNode(node.name),
10386 _cloneNode(node._typeParameters),
10387 _cloneNode(node.parameters),
10388 _cloneNode(node.body));
9975 10389
9976 @override 10390 @override
9977 MethodInvocation visitMethodInvocation(MethodInvocation node) { 10391 MethodInvocation visitMethodInvocation(MethodInvocation node) {
9978 MethodInvocation copy = new MethodInvocation(_cloneNode(node.target), 10392 MethodInvocation copy = new MethodInvocation(
9979 _mapToken(node.operator), _cloneNode(node.methodName), 10393 _cloneNode(node.target),
9980 _cloneNode(node.typeArguments), _cloneNode(node.argumentList)); 10394 _mapToken(node.operator),
10395 _cloneNode(node.methodName),
10396 _cloneNode(node.typeArguments),
10397 _cloneNode(node.argumentList));
9981 copy.propagatedType = node.propagatedType; 10398 copy.propagatedType = node.propagatedType;
9982 copy.staticType = node.staticType; 10399 copy.staticType = node.staticType;
9983 return copy; 10400 return copy;
9984 } 10401 }
9985 10402
9986 @override 10403 @override
9987 NamedExpression visitNamedExpression(NamedExpression node) { 10404 NamedExpression visitNamedExpression(NamedExpression node) {
9988 NamedExpression copy = 10405 NamedExpression copy =
9989 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression)); 10406 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression));
9990 copy.propagatedType = node.propagatedType; 10407 copy.propagatedType = node.propagatedType;
(...skipping 15 matching lines...) Expand all
10006 NullLiteral copy = new NullLiteral(_mapToken(node.literal)); 10423 NullLiteral copy = new NullLiteral(_mapToken(node.literal));
10007 copy.propagatedType = node.propagatedType; 10424 copy.propagatedType = node.propagatedType;
10008 copy.staticType = node.staticType; 10425 copy.staticType = node.staticType;
10009 return copy; 10426 return copy;
10010 } 10427 }
10011 10428
10012 @override 10429 @override
10013 ParenthesizedExpression visitParenthesizedExpression( 10430 ParenthesizedExpression visitParenthesizedExpression(
10014 ParenthesizedExpression node) { 10431 ParenthesizedExpression node) {
10015 ParenthesizedExpression copy = new ParenthesizedExpression( 10432 ParenthesizedExpression copy = new ParenthesizedExpression(
10016 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10433 _mapToken(node.leftParenthesis),
10434 _cloneNode(node.expression),
10017 _mapToken(node.rightParenthesis)); 10435 _mapToken(node.rightParenthesis));
10018 copy.propagatedType = node.propagatedType; 10436 copy.propagatedType = node.propagatedType;
10019 copy.staticType = node.staticType; 10437 copy.staticType = node.staticType;
10020 return copy; 10438 return copy;
10021 } 10439 }
10022 10440
10023 @override 10441 @override
10024 PartDirective visitPartDirective(PartDirective node) { 10442 PartDirective visitPartDirective(PartDirective node) {
10025 PartDirective copy = new PartDirective( 10443 PartDirective copy = new PartDirective(
10026 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10444 _cloneNode(node.documentationComment),
10027 _mapToken(node.partKeyword), _cloneNode(node.uri), 10445 _cloneNodeList(node.metadata),
10446 _mapToken(node.partKeyword),
10447 _cloneNode(node.uri),
10028 _mapToken(node.semicolon)); 10448 _mapToken(node.semicolon));
10029 copy.element = node.element; 10449 copy.element = node.element;
10030 return copy; 10450 return copy;
10031 } 10451 }
10032 10452
10033 @override 10453 @override
10034 PartOfDirective visitPartOfDirective(PartOfDirective node) { 10454 PartOfDirective visitPartOfDirective(PartOfDirective node) {
10035 PartOfDirective copy = new PartOfDirective( 10455 PartOfDirective copy = new PartOfDirective(
10036 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10456 _cloneNode(node.documentationComment),
10037 _mapToken(node.partKeyword), _mapToken(node.ofKeyword), 10457 _cloneNodeList(node.metadata),
10038 _cloneNode(node.libraryName), _mapToken(node.semicolon)); 10458 _mapToken(node.partKeyword),
10459 _mapToken(node.ofKeyword),
10460 _cloneNode(node.libraryName),
10461 _mapToken(node.semicolon));
10039 copy.element = node.element; 10462 copy.element = node.element;
10040 return copy; 10463 return copy;
10041 } 10464 }
10042 10465
10043 @override 10466 @override
10044 PostfixExpression visitPostfixExpression(PostfixExpression node) { 10467 PostfixExpression visitPostfixExpression(PostfixExpression node) {
10045 PostfixExpression copy = new PostfixExpression( 10468 PostfixExpression copy = new PostfixExpression(
10046 _cloneNode(node.operand), _mapToken(node.operator)); 10469 _cloneNode(node.operand), _mapToken(node.operator));
10047 copy.propagatedElement = node.propagatedElement; 10470 copy.propagatedElement = node.propagatedElement;
10048 copy.propagatedType = node.propagatedType; 10471 copy.propagatedType = node.propagatedType;
(...skipping 28 matching lines...) Expand all
10077 _mapToken(node.operator), _cloneNode(node.propertyName)); 10500 _mapToken(node.operator), _cloneNode(node.propertyName));
10078 copy.propagatedType = node.propagatedType; 10501 copy.propagatedType = node.propagatedType;
10079 copy.staticType = node.staticType; 10502 copy.staticType = node.staticType;
10080 return copy; 10503 return copy;
10081 } 10504 }
10082 10505
10083 @override 10506 @override
10084 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( 10507 RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
10085 RedirectingConstructorInvocation node) { 10508 RedirectingConstructorInvocation node) {
10086 RedirectingConstructorInvocation copy = 10509 RedirectingConstructorInvocation copy =
10087 new RedirectingConstructorInvocation(_mapToken(node.thisKeyword), 10510 new RedirectingConstructorInvocation(
10088 _mapToken(node.period), _cloneNode(node.constructorName), 10511 _mapToken(node.thisKeyword),
10512 _mapToken(node.period),
10513 _cloneNode(node.constructorName),
10089 _cloneNode(node.argumentList)); 10514 _cloneNode(node.argumentList));
10090 copy.staticElement = node.staticElement; 10515 copy.staticElement = node.staticElement;
10091 return copy; 10516 return copy;
10092 } 10517 }
10093 10518
10094 @override 10519 @override
10095 RethrowExpression visitRethrowExpression(RethrowExpression node) { 10520 RethrowExpression visitRethrowExpression(RethrowExpression node) {
10096 RethrowExpression copy = 10521 RethrowExpression copy =
10097 new RethrowExpression(_mapToken(node.rethrowKeyword)); 10522 new RethrowExpression(_mapToken(node.rethrowKeyword));
10098 copy.propagatedType = node.propagatedType; 10523 copy.propagatedType = node.propagatedType;
10099 copy.staticType = node.staticType; 10524 copy.staticType = node.staticType;
10100 return copy; 10525 return copy;
10101 } 10526 }
10102 10527
10103 @override 10528 @override
10104 ReturnStatement visitReturnStatement(ReturnStatement node) => 10529 ReturnStatement visitReturnStatement(ReturnStatement node) =>
10105 new ReturnStatement(_mapToken(node.returnKeyword), 10530 new ReturnStatement(_mapToken(node.returnKeyword),
10106 _cloneNode(node.expression), _mapToken(node.semicolon)); 10531 _cloneNode(node.expression), _mapToken(node.semicolon));
10107 10532
10108 @override 10533 @override
10109 ScriptTag visitScriptTag(ScriptTag node) => 10534 ScriptTag visitScriptTag(ScriptTag node) =>
10110 new ScriptTag(_mapToken(node.scriptTag)); 10535 new ScriptTag(_mapToken(node.scriptTag));
10111 10536
10112 @override 10537 @override
10113 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( 10538 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator(
10114 _mapToken(node.keyword), _cloneNodeList(node.shownNames)); 10539 _mapToken(node.keyword), _cloneNodeList(node.shownNames));
10115 10540
10116 @override 10541 @override
10117 SimpleFormalParameter visitSimpleFormalParameter( 10542 SimpleFormalParameter visitSimpleFormalParameter(
10118 SimpleFormalParameter node) => new SimpleFormalParameter( 10543 SimpleFormalParameter node) =>
10119 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10544 new SimpleFormalParameter(
10120 _mapToken(node.keyword), _cloneNode(node.type), 10545 _cloneNode(node.documentationComment),
10121 _cloneNode(node.identifier)); 10546 _cloneNodeList(node.metadata),
10547 _mapToken(node.keyword),
10548 _cloneNode(node.type),
10549 _cloneNode(node.identifier));
10122 10550
10123 @override 10551 @override
10124 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { 10552 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
10125 Token mappedToken = _mapToken(node.token); 10553 Token mappedToken = _mapToken(node.token);
10126 if (mappedToken == null) { 10554 if (mappedToken == null) {
10127 // This only happens for SimpleIdentifiers created by the parser as part 10555 // This only happens for SimpleIdentifiers created by the parser as part
10128 // of scanning documentation comments (the tokens for those identifiers 10556 // of scanning documentation comments (the tokens for those identifiers
10129 // are not in the original token stream and hence do not get copied). 10557 // are not in the original token stream and hence do not get copied).
10130 // This extra check can be removed if the scanner is changed to scan 10558 // This extra check can be removed if the scanner is changed to scan
10131 // documentation comments for the parser. 10559 // documentation comments for the parser.
(...skipping 23 matching lines...) Expand all
10155 new StringInterpolation(_cloneNodeList(node.elements)); 10583 new StringInterpolation(_cloneNodeList(node.elements));
10156 copy.propagatedType = node.propagatedType; 10584 copy.propagatedType = node.propagatedType;
10157 copy.staticType = node.staticType; 10585 copy.staticType = node.staticType;
10158 return copy; 10586 return copy;
10159 } 10587 }
10160 10588
10161 @override 10589 @override
10162 SuperConstructorInvocation visitSuperConstructorInvocation( 10590 SuperConstructorInvocation visitSuperConstructorInvocation(
10163 SuperConstructorInvocation node) { 10591 SuperConstructorInvocation node) {
10164 SuperConstructorInvocation copy = new SuperConstructorInvocation( 10592 SuperConstructorInvocation copy = new SuperConstructorInvocation(
10165 _mapToken(node.superKeyword), _mapToken(node.period), 10593 _mapToken(node.superKeyword),
10166 _cloneNode(node.constructorName), _cloneNode(node.argumentList)); 10594 _mapToken(node.period),
10595 _cloneNode(node.constructorName),
10596 _cloneNode(node.argumentList));
10167 copy.staticElement = node.staticElement; 10597 copy.staticElement = node.staticElement;
10168 return copy; 10598 return copy;
10169 } 10599 }
10170 10600
10171 @override 10601 @override
10172 SuperExpression visitSuperExpression(SuperExpression node) { 10602 SuperExpression visitSuperExpression(SuperExpression node) {
10173 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword)); 10603 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword));
10174 copy.propagatedType = node.propagatedType; 10604 copy.propagatedType = node.propagatedType;
10175 copy.staticType = node.staticType; 10605 copy.staticType = node.staticType;
10176 return copy; 10606 return copy;
10177 } 10607 }
10178 10608
10179 @override 10609 @override
10180 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( 10610 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
10181 _cloneNodeList(node.labels), _mapToken(node.keyword), 10611 _cloneNodeList(node.labels),
10182 _cloneNode(node.expression), _mapToken(node.colon), 10612 _mapToken(node.keyword),
10613 _cloneNode(node.expression),
10614 _mapToken(node.colon),
10183 _cloneNodeList(node.statements)); 10615 _cloneNodeList(node.statements));
10184 10616
10185 @override 10617 @override
10186 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( 10618 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
10187 _cloneNodeList(node.labels), _mapToken(node.keyword), 10619 _cloneNodeList(node.labels),
10188 _mapToken(node.colon), _cloneNodeList(node.statements)); 10620 _mapToken(node.keyword),
10621 _mapToken(node.colon),
10622 _cloneNodeList(node.statements));
10189 10623
10190 @override 10624 @override
10191 SwitchStatement visitSwitchStatement(SwitchStatement node) => 10625 SwitchStatement visitSwitchStatement(SwitchStatement node) =>
10192 new SwitchStatement(_mapToken(node.switchKeyword), 10626 new SwitchStatement(
10193 _mapToken(node.leftParenthesis), _cloneNode(node.expression), 10627 _mapToken(node.switchKeyword),
10194 _mapToken(node.rightParenthesis), _mapToken(node.leftBracket), 10628 _mapToken(node.leftParenthesis),
10195 _cloneNodeList(node.members), _mapToken(node.rightBracket)); 10629 _cloneNode(node.expression),
10630 _mapToken(node.rightParenthesis),
10631 _mapToken(node.leftBracket),
10632 _cloneNodeList(node.members),
10633 _mapToken(node.rightBracket));
10196 10634
10197 @override 10635 @override
10198 AstNode visitSymbolLiteral(SymbolLiteral node) { 10636 AstNode visitSymbolLiteral(SymbolLiteral node) {
10199 SymbolLiteral copy = new SymbolLiteral( 10637 SymbolLiteral copy = new SymbolLiteral(
10200 _mapToken(node.poundSign), _mapTokens(node.components)); 10638 _mapToken(node.poundSign), _mapTokens(node.components));
10201 copy.propagatedType = node.propagatedType; 10639 copy.propagatedType = node.propagatedType;
10202 copy.staticType = node.staticType; 10640 copy.staticType = node.staticType;
10203 return copy; 10641 return copy;
10204 } 10642 }
10205 10643
10206 @override 10644 @override
10207 ThisExpression visitThisExpression(ThisExpression node) { 10645 ThisExpression visitThisExpression(ThisExpression node) {
10208 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword)); 10646 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword));
10209 copy.propagatedType = node.propagatedType; 10647 copy.propagatedType = node.propagatedType;
10210 copy.staticType = node.staticType; 10648 copy.staticType = node.staticType;
10211 return copy; 10649 return copy;
10212 } 10650 }
10213 10651
10214 @override 10652 @override
10215 ThrowExpression visitThrowExpression(ThrowExpression node) { 10653 ThrowExpression visitThrowExpression(ThrowExpression node) {
10216 ThrowExpression copy = new ThrowExpression( 10654 ThrowExpression copy = new ThrowExpression(
10217 _mapToken(node.throwKeyword), _cloneNode(node.expression)); 10655 _mapToken(node.throwKeyword), _cloneNode(node.expression));
10218 copy.propagatedType = node.propagatedType; 10656 copy.propagatedType = node.propagatedType;
10219 copy.staticType = node.staticType; 10657 copy.staticType = node.staticType;
10220 return copy; 10658 return copy;
10221 } 10659 }
10222 10660
10223 @override 10661 @override
10224 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( 10662 TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
10225 TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration( 10663 TopLevelVariableDeclaration node) =>
10226 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10664 new TopLevelVariableDeclaration(
10227 _cloneNode(node.variables), _mapToken(node.semicolon)); 10665 _cloneNode(node.documentationComment),
10666 _cloneNodeList(node.metadata),
10667 _cloneNode(node.variables),
10668 _mapToken(node.semicolon));
10228 10669
10229 @override 10670 @override
10230 TryStatement visitTryStatement(TryStatement node) => new TryStatement( 10671 TryStatement visitTryStatement(TryStatement node) => new TryStatement(
10231 _mapToken(node.tryKeyword), _cloneNode(node.body), 10672 _mapToken(node.tryKeyword),
10232 _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword), 10673 _cloneNode(node.body),
10674 _cloneNodeList(node.catchClauses),
10675 _mapToken(node.finallyKeyword),
10233 _cloneNode(node.finallyBlock)); 10676 _cloneNode(node.finallyBlock));
10234 10677
10235 @override 10678 @override
10236 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => 10679 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) =>
10237 new TypeArgumentList(_mapToken(node.leftBracket), 10680 new TypeArgumentList(_mapToken(node.leftBracket),
10238 _cloneNodeList(node.arguments), _mapToken(node.rightBracket)); 10681 _cloneNodeList(node.arguments), _mapToken(node.rightBracket));
10239 10682
10240 @override 10683 @override
10241 TypeName visitTypeName(TypeName node) { 10684 TypeName visitTypeName(TypeName node) {
10242 TypeName copy = 10685 TypeName copy =
10243 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments)); 10686 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments));
10244 copy.type = node.type; 10687 copy.type = node.type;
10245 return copy; 10688 return copy;
10246 } 10689 }
10247 10690
10248 @override 10691 @override
10249 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( 10692 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
10250 _cloneNode(node.documentationComment), _cloneNodeList(node.metadata), 10693 _cloneNode(node.documentationComment),
10251 _cloneNode(node.name), _mapToken(node.extendsKeyword), 10694 _cloneNodeList(node.metadata),
10695 _cloneNode(node.name),
10696 _mapToken(node.extendsKeyword),
10252 _cloneNode(node.bound)); 10697 _cloneNode(node.bound));
10253 10698
10254 @override 10699 @override
10255 TypeParameterList visitTypeParameterList(TypeParameterList node) => 10700 TypeParameterList visitTypeParameterList(TypeParameterList node) =>
10256 new TypeParameterList(_mapToken(node.leftBracket), 10701 new TypeParameterList(_mapToken(node.leftBracket),
10257 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); 10702 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket));
10258 10703
10259 @override 10704 @override
10260 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => 10705 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) =>
10261 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals), 10706 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals),
10262 _cloneNode(node.initializer)); 10707 _cloneNode(node.initializer));
10263 10708
10264 @override 10709 @override
10265 VariableDeclarationList visitVariableDeclarationList( 10710 VariableDeclarationList visitVariableDeclarationList(
10266 VariableDeclarationList node) => new VariableDeclarationList(null, 10711 VariableDeclarationList node) =>
10267 _cloneNodeList(node.metadata), _mapToken(node.keyword), 10712 new VariableDeclarationList(
10268 _cloneNode(node.type), _cloneNodeList(node.variables)); 10713 null,
10714 _cloneNodeList(node.metadata),
10715 _mapToken(node.keyword),
10716 _cloneNode(node.type),
10717 _cloneNodeList(node.variables));
10269 10718
10270 @override 10719 @override
10271 VariableDeclarationStatement visitVariableDeclarationStatement( 10720 VariableDeclarationStatement visitVariableDeclarationStatement(
10272 VariableDeclarationStatement node) => new VariableDeclarationStatement( 10721 VariableDeclarationStatement node) =>
10273 _cloneNode(node.variables), _mapToken(node.semicolon)); 10722 new VariableDeclarationStatement(
10723 _cloneNode(node.variables), _mapToken(node.semicolon));
10274 10724
10275 @override 10725 @override
10276 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( 10726 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
10277 _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis), 10727 _mapToken(node.whileKeyword),
10278 _cloneNode(node.condition), _mapToken(node.rightParenthesis), 10728 _mapToken(node.leftParenthesis),
10729 _cloneNode(node.condition),
10730 _mapToken(node.rightParenthesis),
10279 _cloneNode(node.body)); 10731 _cloneNode(node.body));
10280 10732
10281 @override 10733 @override
10282 WithClause visitWithClause(WithClause node) => new WithClause( 10734 WithClause visitWithClause(WithClause node) => new WithClause(
10283 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes)); 10735 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes));
10284 10736
10285 @override 10737 @override
10286 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( 10738 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
10287 _mapToken(node.yieldKeyword), _mapToken(node.star), 10739 _mapToken(node.yieldKeyword),
10288 _cloneNode(node.expression), _mapToken(node.semicolon)); 10740 _mapToken(node.star),
10741 _cloneNode(node.expression),
10742 _mapToken(node.semicolon));
10289 10743
10290 AstNode _cloneNode(AstNode node) { 10744 AstNode _cloneNode(AstNode node) {
10291 if (node == null) { 10745 if (node == null) {
10292 return null; 10746 return null;
10293 } 10747 }
10294 if (identical(node, _oldNode)) { 10748 if (identical(node, _oldNode)) {
10295 return _newNode; 10749 return _newNode;
10296 } 10750 }
10297 return node.accept(this) as AstNode; 10751 return node.accept(this) as AstNode;
10298 } 10752 }
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
10834 */ 11288 */
10835 class InterpolationString extends InterpolationElement { 11289 class InterpolationString extends InterpolationElement {
10836 /** 11290 /**
10837 * The characters that will be added to the string. 11291 * The characters that will be added to the string.
10838 */ 11292 */
10839 Token contents; 11293 Token contents;
10840 11294
10841 /** 11295 /**
10842 * The value of the literal. 11296 * The value of the literal.
10843 */ 11297 */
10844 String _value; 11298 String value;
10845 11299
10846 /** 11300 /**
10847 * Initialize a newly created string of characters that are part of a string 11301 * Initialize a newly created string of characters that are part of a string
10848 * interpolation. 11302 * interpolation.
10849 */ 11303 */
10850 InterpolationString(this.contents, String value) { 11304 InterpolationString(this.contents, this.value);
10851 _value = value;
10852 }
10853 11305
10854 @override 11306 @override
10855 Token get beginToken => contents; 11307 Token get beginToken => contents;
10856 11308
10857 @override 11309 @override
10858 Iterable get childEntities => new ChildEntities()..add(contents); 11310 Iterable get childEntities => new ChildEntities()..add(contents);
10859 11311
10860 /** 11312 /**
10861 * Return the offset of the after-last contents character. 11313 * Return the offset of the after-last contents character.
10862 */ 11314 */
10863 int get contentsEnd { 11315 int get contentsEnd {
10864 String lexeme = contents.lexeme; 11316 String lexeme = contents.lexeme;
10865 return offset + new StringLexemeHelper(lexeme, true, true).end; 11317 return offset + new StringLexemeHelper(lexeme, true, true).end;
10866 } 11318 }
10867 11319
10868 /** 11320 /**
10869 * Return the offset of the first contents character. 11321 * Return the offset of the first contents character.
10870 */ 11322 */
10871 int get contentsOffset { 11323 int get contentsOffset {
10872 int offset = contents.offset; 11324 int offset = contents.offset;
10873 String lexeme = contents.lexeme; 11325 String lexeme = contents.lexeme;
10874 return offset + new StringLexemeHelper(lexeme, true, true).start; 11326 return offset + new StringLexemeHelper(lexeme, true, true).start;
10875 } 11327 }
10876 11328
10877 @override 11329 @override
10878 Token get endToken => contents; 11330 Token get endToken => contents;
10879 11331
10880 /**
10881 * Return the value of the literal.
10882 */
10883 String get value => _value;
10884
10885 /**
10886 * Set the value of the literal to the given [string].
10887 */
10888 void set value(String string) {
10889 _value = string;
10890 }
10891
10892 @override 11332 @override
10893 accept(AstVisitor visitor) => visitor.visitInterpolationString(this); 11333 accept(AstVisitor visitor) => visitor.visitInterpolationString(this);
10894 11334
10895 @override 11335 @override
10896 void visitChildren(AstVisitor visitor) {} 11336 void visitChildren(AstVisitor visitor) {}
10897 } 11337 }
10898 11338
10899 /** 11339 /**
10900 * An is expression. 11340 * An is expression.
10901 * 11341 *
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
11575 * Initialize a newly created method declaration. Either or both of the 12015 * Initialize a newly created method declaration. Either or both of the
11576 * [comment] and [metadata] can be `null` if the declaration does not have the 12016 * [comment] and [metadata] can be `null` if the declaration does not have the
11577 * corresponding attribute. The [externalKeyword] can be `null` if the method 12017 * corresponding attribute. The [externalKeyword] can be `null` if the method
11578 * is not external. The [modifierKeyword] can be `null` if the method is 12018 * is not external. The [modifierKeyword] can be `null` if the method is
11579 * neither abstract nor static. The [returnType] can be `null` if no return 12019 * neither abstract nor static. The [returnType] can be `null` if no return
11580 * type was specified. The [propertyKeyword] can be `null` if the method is 12020 * type was specified. The [propertyKeyword] can be `null` if the method is
11581 * neither a getter or a setter. The [operatorKeyword] can be `null` if the 12021 * neither a getter or a setter. The [operatorKeyword] can be `null` if the
11582 * method does not implement an operator. The [parameters] must be `null` if 12022 * method does not implement an operator. The [parameters] must be `null` if
11583 * this method declares a getter. 12023 * this method declares a getter.
11584 */ 12024 */
11585 MethodDeclaration(Comment comment, List<Annotation> metadata, 12025 MethodDeclaration(
11586 this.externalKeyword, this.modifierKeyword, TypeName returnType, 12026 Comment comment,
11587 this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name, 12027 List<Annotation> metadata,
11588 TypeParameterList typeParameters, FormalParameterList parameters, 12028 this.externalKeyword,
12029 this.modifierKeyword,
12030 TypeName returnType,
12031 this.propertyKeyword,
12032 this.operatorKeyword,
12033 SimpleIdentifier name,
12034 TypeParameterList typeParameters,
12035 FormalParameterList parameters,
11589 FunctionBody body) 12036 FunctionBody body)
11590 : super(comment, metadata) { 12037 : super(comment, metadata) {
11591 _returnType = _becomeParentOf(returnType); 12038 _returnType = _becomeParentOf(returnType);
11592 _name = _becomeParentOf(name); 12039 _name = _becomeParentOf(name);
11593 _typeParameters = _becomeParentOf(typeParameters); 12040 _typeParameters = _becomeParentOf(typeParameters);
11594 _parameters = _becomeParentOf(parameters); 12041 _parameters = _becomeParentOf(parameters);
11595 _body = _becomeParentOf(body); 12042 _body = _becomeParentOf(body);
11596 } 12043 }
11597 12044
11598 /** 12045 /**
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
11782 12229
11783 /** 12230 /**
11784 * The list of arguments to the method. 12231 * The list of arguments to the method.
11785 */ 12232 */
11786 ArgumentList _argumentList; 12233 ArgumentList _argumentList;
11787 12234
11788 /** 12235 /**
11789 * Initialize a newly created method invocation. The [target] and [operator] 12236 * Initialize a newly created method invocation. The [target] and [operator]
11790 * can be `null` if there is no target. 12237 * can be `null` if there is no target.
11791 */ 12238 */
11792 MethodInvocation(Expression target, this.operator, 12239 MethodInvocation(
11793 SimpleIdentifier methodName, TypeArgumentList typeArguments, 12240 Expression target,
12241 this.operator,
12242 SimpleIdentifier methodName,
12243 TypeArgumentList typeArguments,
11794 ArgumentList argumentList) { 12244 ArgumentList argumentList) {
11795 _target = _becomeParentOf(target); 12245 _target = _becomeParentOf(target);
11796 _methodName = _becomeParentOf(methodName); 12246 _methodName = _becomeParentOf(methodName);
11797 _typeArguments = _becomeParentOf(typeArguments); 12247 _typeArguments = _becomeParentOf(typeArguments);
11798 _argumentList = _becomeParentOf(argumentList); 12248 _argumentList = _becomeParentOf(argumentList);
11799 } 12249 }
11800 12250
11801 /** 12251 /**
11802 * Return the list of arguments to the method. 12252 * Return the list of arguments to the method.
11803 */ 12253 */
(...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after
13740 14190
13741 @override 14191 @override
13742 ParameterKind get kind { 14192 ParameterKind get kind {
13743 AstNode parent = this.parent; 14193 AstNode parent = this.parent;
13744 if (parent is DefaultFormalParameter) { 14194 if (parent is DefaultFormalParameter) {
13745 return parent.kind; 14195 return parent.kind;
13746 } 14196 }
13747 return ParameterKind.REQUIRED; 14197 return ParameterKind.REQUIRED;
13748 } 14198 }
13749 14199
13750 /** 14200 @override
13751 * Return the annotations associated with this parameter.
13752 */
13753 NodeList<Annotation> get metadata => _metadata; 14201 NodeList<Annotation> get metadata => _metadata;
13754 14202
13755 /** 14203 /**
13756 * Set the metadata associated with this node to the given [metadata]. 14204 * Set the metadata associated with this node to the given [metadata].
13757 */ 14205 */
13758 void set metadata(List<Annotation> metadata) { 14206 void set metadata(List<Annotation> metadata) {
13759 _metadata.clear(); 14207 _metadata.clear();
13760 _metadata.addAll(metadata); 14208 _metadata.addAll(metadata);
13761 } 14209 }
13762 14210
(...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after
16012 R visitPrefixedIdentifier(PrefixedIdentifier node) => null; 16460 R visitPrefixedIdentifier(PrefixedIdentifier node) => null;
16013 16461
16014 @override 16462 @override
16015 R visitPrefixExpression(PrefixExpression node) => null; 16463 R visitPrefixExpression(PrefixExpression node) => null;
16016 16464
16017 @override 16465 @override
16018 R visitPropertyAccess(PropertyAccess node) => null; 16466 R visitPropertyAccess(PropertyAccess node) => null;
16019 16467
16020 @override 16468 @override
16021 R visitRedirectingConstructorInvocation( 16469 R visitRedirectingConstructorInvocation(
16022 RedirectingConstructorInvocation node) => null; 16470 RedirectingConstructorInvocation node) =>
16471 null;
16023 16472
16024 @override 16473 @override
16025 R visitRethrowExpression(RethrowExpression node) => null; 16474 R visitRethrowExpression(RethrowExpression node) => null;
16026 16475
16027 @override 16476 @override
16028 R visitReturnStatement(ReturnStatement node) => null; 16477 R visitReturnStatement(ReturnStatement node) => null;
16029 16478
16030 @override 16479 @override
16031 R visitScriptTag(ScriptTag node) => null; 16480 R visitScriptTag(ScriptTag node) => null;
16032 16481
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
17233 17682
17234 /** 17683 /**
17235 * The right curly bracket. 17684 * The right curly bracket.
17236 */ 17685 */
17237 Token rightBracket; 17686 Token rightBracket;
17238 17687
17239 /** 17688 /**
17240 * Initialize a newly created switch statement. The list of [members] can be 17689 * Initialize a newly created switch statement. The list of [members] can be
17241 * `null` if there are no switch members. 17690 * `null` if there are no switch members.
17242 */ 17691 */
17243 SwitchStatement(this.switchKeyword, this.leftParenthesis, 17692 SwitchStatement(
17244 Expression expression, this.rightParenthesis, this.leftBracket, 17693 this.switchKeyword,
17245 List<SwitchMember> members, this.rightBracket) { 17694 this.leftParenthesis,
17695 Expression expression,
17696 this.rightParenthesis,
17697 this.leftBracket,
17698 List<SwitchMember> members,
17699 this.rightBracket) {
17246 _expression = _becomeParentOf(expression); 17700 _expression = _becomeParentOf(expression);
17247 _members = new NodeList<SwitchMember>(this, members); 17701 _members = new NodeList<SwitchMember>(this, members);
17248 } 17702 }
17249 17703
17250 @override 17704 @override
17251 Token get beginToken => switchKeyword; 17705 Token get beginToken => switchKeyword;
17252 17706
17253 @override 17707 @override
17254 Iterable get childEntities => new ChildEntities() 17708 Iterable get childEntities => new ChildEntities()
17255 ..add(switchKeyword) 17709 ..add(switchKeyword)
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
17608 _writer.print(node.operator.lexeme); 18062 _writer.print(node.operator.lexeme);
17609 _writer.print(' '); 18063 _writer.print(' ');
17610 _visitNode(node.rightHandSide); 18064 _visitNode(node.rightHandSide);
17611 return null; 18065 return null;
17612 } 18066 }
17613 18067
17614 @override 18068 @override
17615 Object visitAwaitExpression(AwaitExpression node) { 18069 Object visitAwaitExpression(AwaitExpression node) {
17616 _writer.print("await "); 18070 _writer.print("await ");
17617 _visitNode(node.expression); 18071 _visitNode(node.expression);
17618 _writer.print(";");
17619 return null; 18072 return null;
17620 } 18073 }
17621 18074
17622 @override 18075 @override
17623 Object visitBinaryExpression(BinaryExpression node) { 18076 Object visitBinaryExpression(BinaryExpression node) {
17624 _visitNode(node.leftOperand); 18077 _visitNode(node.leftOperand);
17625 _writer.print(' '); 18078 _writer.print(' ');
17626 _writer.print(node.operator.lexeme); 18079 _writer.print(node.operator.lexeme);
17627 _writer.print(' '); 18080 _writer.print(' ');
17628 _visitNode(node.rightOperand); 18081 _visitNode(node.rightOperand);
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
17977 _writer.print(";"); 18430 _writer.print(";");
17978 _visitNodeListWithSeparatorAndPrefix(" ", node.updaters, ", "); 18431 _visitNodeListWithSeparatorAndPrefix(" ", node.updaters, ", ");
17979 _writer.print(") "); 18432 _writer.print(") ");
17980 _visitNode(node.body); 18433 _visitNode(node.body);
17981 return null; 18434 return null;
17982 } 18435 }
17983 18436
17984 @override 18437 @override
17985 Object visitFunctionDeclaration(FunctionDeclaration node) { 18438 Object visitFunctionDeclaration(FunctionDeclaration node) {
17986 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " "); 18439 _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
18440 _visitTokenWithSuffix(node.externalKeyword, " ");
17987 _visitNodeWithSuffix(node.returnType, " "); 18441 _visitNodeWithSuffix(node.returnType, " ");
17988 _visitTokenWithSuffix(node.propertyKeyword, " "); 18442 _visitTokenWithSuffix(node.propertyKeyword, " ");
17989 _visitNode(node.name); 18443 _visitNode(node.name);
17990 _visitNode(node.functionExpression); 18444 _visitNode(node.functionExpression);
17991 return null; 18445 return null;
17992 } 18446 }
17993 18447
17994 @override 18448 @override
17995 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) { 18449 Object visitFunctionDeclarationStatement(FunctionDeclarationStatement node) {
17996 _visitNode(node.functionDeclaration); 18450 _visitNode(node.functionDeclaration);
17997 return null; 18451 return null;
17998 } 18452 }
17999 18453
18000 @override 18454 @override
18001 Object visitFunctionExpression(FunctionExpression node) { 18455 Object visitFunctionExpression(FunctionExpression node) {
18002 _visitNode(node.typeParameters); 18456 _visitNode(node.typeParameters);
18003 _visitNode(node.parameters); 18457 _visitNode(node.parameters);
18004 _writer.print(' '); 18458 if (node.body is! EmptyFunctionBody) {
18459 _writer.print(' ');
18460 }
18005 _visitNode(node.body); 18461 _visitNode(node.body);
18006 return null; 18462 return null;
18007 } 18463 }
18008 18464
18009 @override 18465 @override
18010 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { 18466 Object visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
18011 _visitNode(node.function); 18467 _visitNode(node.function);
18012 _visitNode(node.typeArguments); 18468 _visitNode(node.typeArguments);
18013 _visitNode(node.argumentList); 18469 _visitNode(node.argumentList);
18014 return null; 18470 return null;
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after
19453 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node); 19909 R visitPrefixedIdentifier(PrefixedIdentifier node) => visitNode(node);
19454 19910
19455 @override 19911 @override
19456 R visitPrefixExpression(PrefixExpression node) => visitNode(node); 19912 R visitPrefixExpression(PrefixExpression node) => visitNode(node);
19457 19913
19458 @override 19914 @override
19459 R visitPropertyAccess(PropertyAccess node) => visitNode(node); 19915 R visitPropertyAccess(PropertyAccess node) => visitNode(node);
19460 19916
19461 @override 19917 @override
19462 R visitRedirectingConstructorInvocation( 19918 R visitRedirectingConstructorInvocation(
19463 RedirectingConstructorInvocation node) => visitNode(node); 19919 RedirectingConstructorInvocation node) =>
19920 visitNode(node);
19464 19921
19465 @override 19922 @override
19466 R visitRethrowExpression(RethrowExpression node) => visitNode(node); 19923 R visitRethrowExpression(RethrowExpression node) => visitNode(node);
19467 19924
19468 @override 19925 @override
19469 R visitReturnStatement(ReturnStatement node) => visitNode(node); 19926 R visitReturnStatement(ReturnStatement node) => visitNode(node);
19470 19927
19471 @override 19928 @override
19472 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag); 19929 R visitScriptTag(ScriptTag scriptTag) => visitNode(scriptTag);
19473 19930
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
20207 } 20664 }
20208 20665
20209 @override 20666 @override
20210 accept(AstVisitor visitor) => visitor.visitYieldStatement(this); 20667 accept(AstVisitor visitor) => visitor.visitYieldStatement(this);
20211 20668
20212 @override 20669 @override
20213 void visitChildren(AstVisitor visitor) { 20670 void visitChildren(AstVisitor visitor) {
20214 _safelyVisitChild(_expression, visitor); 20671 _safelyVisitChild(_expression, visitor);
20215 } 20672 }
20216 } 20673 }
OLDNEW
« no previous file with comments | « packages/analyzer/lib/src/error.dart ('k') | packages/analyzer/lib/src/generated/constant.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698