OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.dart.ast.utilities; | 5 library analyzer.src.dart.ast.utilities; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
| 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
10 import 'package:analyzer/dart/ast/token.dart'; | 11 import 'package:analyzer/dart/ast/token.dart'; |
11 import 'package:analyzer/dart/ast/visitor.dart'; | 12 import 'package:analyzer/dart/ast/visitor.dart'; |
12 import 'package:analyzer/dart/element/element.dart'; | 13 import 'package:analyzer/dart/element/element.dart'; |
13 import 'package:analyzer/exception/exception.dart'; | 14 import 'package:analyzer/exception/exception.dart'; |
14 import 'package:analyzer/src/dart/ast/ast.dart'; | 15 import 'package:analyzer/src/dart/ast/ast.dart'; |
15 import 'package:analyzer/src/dart/ast/token.dart'; | 16 import 'package:analyzer/src/dart/ast/token.dart'; |
16 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine; | 17 import 'package:analyzer/src/generated/engine.dart' show AnalysisEngine; |
17 import 'package:analyzer/src/generated/java_core.dart'; | 18 import 'package:analyzer/src/generated/java_core.dart'; |
18 import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap; | 19 import 'package:analyzer/src/generated/utilities_collection.dart' show TokenMap; |
19 import 'package:analyzer/src/generated/utilities_dart.dart'; | 20 import 'package:analyzer/src/generated/utilities_dart.dart'; |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 */ | 114 */ |
114 List<Token> cloneTokenList(List<Token> tokens) { | 115 List<Token> cloneTokenList(List<Token> tokens) { |
115 if (cloneTokens) { | 116 if (cloneTokens) { |
116 return tokens.map(cloneToken).toList(); | 117 return tokens.map(cloneToken).toList(); |
117 } | 118 } |
118 return tokens; | 119 return tokens; |
119 } | 120 } |
120 | 121 |
121 @override | 122 @override |
122 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => | 123 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => |
123 new AdjacentStrings(cloneNodeList(node.strings)); | 124 astFactory.adjacentStrings(cloneNodeList(node.strings)); |
124 | 125 |
125 @override | 126 @override |
126 Annotation visitAnnotation(Annotation node) => new Annotation( | 127 Annotation visitAnnotation(Annotation node) => astFactory.annotation( |
127 cloneToken(node.atSign), | 128 cloneToken(node.atSign), |
128 cloneNode(node.name), | 129 cloneNode(node.name), |
129 cloneToken(node.period), | 130 cloneToken(node.period), |
130 cloneNode(node.constructorName), | 131 cloneNode(node.constructorName), |
131 cloneNode(node.arguments)); | 132 cloneNode(node.arguments)); |
132 | 133 |
133 @override | 134 @override |
134 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( | 135 ArgumentList visitArgumentList(ArgumentList node) => astFactory.argumentList( |
135 cloneToken(node.leftParenthesis), | 136 cloneToken(node.leftParenthesis), |
136 cloneNodeList(node.arguments), | 137 cloneNodeList(node.arguments), |
137 cloneToken(node.rightParenthesis)); | 138 cloneToken(node.rightParenthesis)); |
138 | 139 |
139 @override | 140 @override |
140 AsExpression visitAsExpression(AsExpression node) => new AsExpression( | 141 AsExpression visitAsExpression(AsExpression node) => astFactory.asExpression( |
141 cloneNode(node.expression), | 142 cloneNode(node.expression), |
142 cloneToken(node.asOperator), | 143 cloneToken(node.asOperator), |
143 cloneNode(node.type)); | 144 cloneNode(node.type)); |
144 | 145 |
145 @override | 146 @override |
146 AstNode visitAssertInitializer(AssertInitializer node) => | 147 AstNode visitAssertInitializer(AssertInitializer node) => |
147 new AssertInitializer( | 148 astFactory.assertInitializer( |
148 cloneToken(node.assertKeyword), | 149 cloneToken(node.assertKeyword), |
149 cloneToken(node.leftParenthesis), | 150 cloneToken(node.leftParenthesis), |
150 cloneNode(node.condition), | 151 cloneNode(node.condition), |
151 cloneToken(node.comma), | 152 cloneToken(node.comma), |
152 cloneNode(node.message), | 153 cloneNode(node.message), |
153 cloneToken(node.rightParenthesis)); | 154 cloneToken(node.rightParenthesis)); |
154 | 155 |
155 @override | 156 @override |
156 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( | 157 AstNode visitAssertStatement(AssertStatement node) => |
157 cloneToken(node.assertKeyword), | 158 astFactory.assertStatement( |
158 cloneToken(node.leftParenthesis), | 159 cloneToken(node.assertKeyword), |
159 cloneNode(node.condition), | 160 cloneToken(node.leftParenthesis), |
160 cloneToken(node.comma), | 161 cloneNode(node.condition), |
161 cloneNode(node.message), | 162 cloneToken(node.comma), |
162 cloneToken(node.rightParenthesis), | 163 cloneNode(node.message), |
163 cloneToken(node.semicolon)); | 164 cloneToken(node.rightParenthesis), |
| 165 cloneToken(node.semicolon)); |
164 | 166 |
165 @override | 167 @override |
166 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => | 168 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) => |
167 new AssignmentExpression(cloneNode(node.leftHandSide), | 169 astFactory.assignmentExpression(cloneNode(node.leftHandSide), |
168 cloneToken(node.operator), cloneNode(node.rightHandSide)); | 170 cloneToken(node.operator), cloneNode(node.rightHandSide)); |
169 | 171 |
170 @override | 172 @override |
171 AwaitExpression visitAwaitExpression(AwaitExpression node) => | 173 AwaitExpression visitAwaitExpression(AwaitExpression node) => |
172 new AwaitExpression( | 174 astFactory.awaitExpression( |
173 cloneToken(node.awaitKeyword), cloneNode(node.expression)); | 175 cloneToken(node.awaitKeyword), cloneNode(node.expression)); |
174 | 176 |
175 @override | 177 @override |
176 BinaryExpression visitBinaryExpression(BinaryExpression node) => | 178 BinaryExpression visitBinaryExpression(BinaryExpression node) => |
177 new BinaryExpression(cloneNode(node.leftOperand), | 179 astFactory.binaryExpression(cloneNode(node.leftOperand), |
178 cloneToken(node.operator), cloneNode(node.rightOperand)); | 180 cloneToken(node.operator), cloneNode(node.rightOperand)); |
179 | 181 |
180 @override | 182 @override |
181 Block visitBlock(Block node) => new Block(cloneToken(node.leftBracket), | 183 Block visitBlock(Block node) => astFactory.block(cloneToken(node.leftBracket), |
182 cloneNodeList(node.statements), cloneToken(node.rightBracket)); | 184 cloneNodeList(node.statements), cloneToken(node.rightBracket)); |
183 | 185 |
184 @override | 186 @override |
185 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => | 187 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => |
186 new BlockFunctionBody(cloneToken(node.keyword), cloneToken(node.star), | 188 astFactory.blockFunctionBody(cloneToken(node.keyword), |
187 cloneNode(node.block)); | 189 cloneToken(node.star), cloneNode(node.block)); |
188 | 190 |
189 @override | 191 @override |
190 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => | 192 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) => |
191 new BooleanLiteral(cloneToken(node.literal), node.value); | 193 astFactory.booleanLiteral(cloneToken(node.literal), node.value); |
192 | 194 |
193 @override | 195 @override |
194 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( | 196 BreakStatement visitBreakStatement(BreakStatement node) => |
195 cloneToken(node.breakKeyword), | 197 astFactory.breakStatement(cloneToken(node.breakKeyword), |
196 cloneNode(node.label), | 198 cloneNode(node.label), cloneToken(node.semicolon)); |
197 cloneToken(node.semicolon)); | |
198 | 199 |
199 @override | 200 @override |
200 CascadeExpression visitCascadeExpression(CascadeExpression node) => | 201 CascadeExpression visitCascadeExpression(CascadeExpression node) => |
201 new CascadeExpression( | 202 astFactory.cascadeExpression( |
202 cloneNode(node.target), cloneNodeList(node.cascadeSections)); | 203 cloneNode(node.target), cloneNodeList(node.cascadeSections)); |
203 | 204 |
204 @override | 205 @override |
205 CatchClause visitCatchClause(CatchClause node) => new CatchClause( | 206 CatchClause visitCatchClause(CatchClause node) => astFactory.catchClause( |
206 cloneToken(node.onKeyword), | 207 cloneToken(node.onKeyword), |
207 cloneNode(node.exceptionType), | 208 cloneNode(node.exceptionType), |
208 cloneToken(node.catchKeyword), | 209 cloneToken(node.catchKeyword), |
209 cloneToken(node.leftParenthesis), | 210 cloneToken(node.leftParenthesis), |
210 cloneNode(node.exceptionParameter), | 211 cloneNode(node.exceptionParameter), |
211 cloneToken(node.comma), | 212 cloneToken(node.comma), |
212 cloneNode(node.stackTraceParameter), | 213 cloneNode(node.stackTraceParameter), |
213 cloneToken(node.rightParenthesis), | 214 cloneToken(node.rightParenthesis), |
214 cloneNode(node.body)); | 215 cloneNode(node.body)); |
215 | 216 |
216 @override | 217 @override |
217 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { | 218 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { |
218 ClassDeclaration copy = new ClassDeclaration( | 219 ClassDeclaration copy = astFactory.classDeclaration( |
219 cloneNode(node.documentationComment), | 220 cloneNode(node.documentationComment), |
220 cloneNodeList(node.metadata), | 221 cloneNodeList(node.metadata), |
221 cloneToken(node.abstractKeyword), | 222 cloneToken(node.abstractKeyword), |
222 cloneToken(node.classKeyword), | 223 cloneToken(node.classKeyword), |
223 cloneNode(node.name), | 224 cloneNode(node.name), |
224 cloneNode(node.typeParameters), | 225 cloneNode(node.typeParameters), |
225 cloneNode(node.extendsClause), | 226 cloneNode(node.extendsClause), |
226 cloneNode(node.withClause), | 227 cloneNode(node.withClause), |
227 cloneNode(node.implementsClause), | 228 cloneNode(node.implementsClause), |
228 cloneToken(node.leftBracket), | 229 cloneToken(node.leftBracket), |
229 cloneNodeList(node.members), | 230 cloneNodeList(node.members), |
230 cloneToken(node.rightBracket)); | 231 cloneToken(node.rightBracket)); |
231 copy.nativeClause = cloneNode(node.nativeClause); | 232 copy.nativeClause = cloneNode(node.nativeClause); |
232 return copy; | 233 return copy; |
233 } | 234 } |
234 | 235 |
235 @override | 236 @override |
236 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) { | 237 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) { |
237 cloneToken(node.abstractKeyword); | 238 cloneToken(node.abstractKeyword); |
238 return new ClassTypeAlias( | 239 return astFactory.classTypeAlias( |
239 cloneNode(node.documentationComment), | 240 cloneNode(node.documentationComment), |
240 cloneNodeList(node.metadata), | 241 cloneNodeList(node.metadata), |
241 cloneToken(node.typedefKeyword), | 242 cloneToken(node.typedefKeyword), |
242 cloneNode(node.name), | 243 cloneNode(node.name), |
243 cloneNode(node.typeParameters), | 244 cloneNode(node.typeParameters), |
244 cloneToken(node.equals), | 245 cloneToken(node.equals), |
245 cloneToken(node.abstractKeyword), | 246 cloneToken(node.abstractKeyword), |
246 cloneNode(node.superclass), | 247 cloneNode(node.superclass), |
247 cloneNode(node.withClause), | 248 cloneNode(node.withClause), |
248 cloneNode(node.implementsClause), | 249 cloneNode(node.implementsClause), |
249 cloneToken(node.semicolon)); | 250 cloneToken(node.semicolon)); |
250 } | 251 } |
251 | 252 |
252 @override | 253 @override |
253 Comment visitComment(Comment node) { | 254 Comment visitComment(Comment node) { |
254 if (node.isDocumentation) { | 255 if (node.isDocumentation) { |
255 return Comment.createDocumentationCommentWithReferences( | 256 return astFactory.documentationComment( |
256 cloneTokenList(node.tokens), cloneNodeList(node.references)); | 257 cloneTokenList(node.tokens), cloneNodeList(node.references)); |
257 } else if (node.isBlock) { | 258 } else if (node.isBlock) { |
258 return Comment.createBlockComment(cloneTokenList(node.tokens)); | 259 return astFactory.blockComment(cloneTokenList(node.tokens)); |
259 } | 260 } |
260 return Comment.createEndOfLineComment(cloneTokenList(node.tokens)); | 261 return astFactory.endOfLineComment(cloneTokenList(node.tokens)); |
261 } | 262 } |
262 | 263 |
263 @override | 264 @override |
264 CommentReference visitCommentReference(CommentReference node) => | 265 CommentReference visitCommentReference(CommentReference node) => |
265 new CommentReference( | 266 astFactory.commentReference( |
266 cloneToken(node.newKeyword), cloneNode(node.identifier)); | 267 cloneToken(node.newKeyword), cloneNode(node.identifier)); |
267 | 268 |
268 @override | 269 @override |
269 CompilationUnit visitCompilationUnit(CompilationUnit node) { | 270 CompilationUnit visitCompilationUnit(CompilationUnit node) { |
270 CompilationUnit clone = new CompilationUnit( | 271 CompilationUnit clone = astFactory.compilationUnit( |
271 cloneToken(node.beginToken), | 272 cloneToken(node.beginToken), |
272 cloneNode(node.scriptTag), | 273 cloneNode(node.scriptTag), |
273 cloneNodeList(node.directives), | 274 cloneNodeList(node.directives), |
274 cloneNodeList(node.declarations), | 275 cloneNodeList(node.declarations), |
275 cloneToken(node.endToken)); | 276 cloneToken(node.endToken)); |
276 clone.lineInfo = node.lineInfo; | 277 clone.lineInfo = node.lineInfo; |
277 return clone; | 278 return clone; |
278 } | 279 } |
279 | 280 |
280 @override | 281 @override |
281 ConditionalExpression visitConditionalExpression( | 282 ConditionalExpression visitConditionalExpression( |
282 ConditionalExpression node) => | 283 ConditionalExpression node) => |
283 new ConditionalExpression( | 284 astFactory.conditionalExpression( |
284 cloneNode(node.condition), | 285 cloneNode(node.condition), |
285 cloneToken(node.question), | 286 cloneToken(node.question), |
286 cloneNode(node.thenExpression), | 287 cloneNode(node.thenExpression), |
287 cloneToken(node.colon), | 288 cloneToken(node.colon), |
288 cloneNode(node.elseExpression)); | 289 cloneNode(node.elseExpression)); |
289 | 290 |
290 @override | 291 @override |
291 Configuration visitConfiguration(Configuration node) => new Configuration( | 292 Configuration visitConfiguration(Configuration node) => |
292 cloneToken(node.ifKeyword), | 293 astFactory.configuration( |
293 cloneToken(node.leftParenthesis), | 294 cloneToken(node.ifKeyword), |
294 cloneNode(node.name), | 295 cloneToken(node.leftParenthesis), |
295 cloneToken(node.equalToken), | 296 cloneNode(node.name), |
296 cloneNode(node.value), | 297 cloneToken(node.equalToken), |
297 cloneToken(node.rightParenthesis), | 298 cloneNode(node.value), |
298 cloneNode(node.uri)); | 299 cloneToken(node.rightParenthesis), |
| 300 cloneNode(node.uri)); |
299 | 301 |
300 @override | 302 @override |
301 ConstructorDeclaration visitConstructorDeclaration( | 303 ConstructorDeclaration visitConstructorDeclaration( |
302 ConstructorDeclaration node) => | 304 ConstructorDeclaration node) => |
303 new ConstructorDeclaration( | 305 astFactory.constructorDeclaration( |
304 cloneNode(node.documentationComment), | 306 cloneNode(node.documentationComment), |
305 cloneNodeList(node.metadata), | 307 cloneNodeList(node.metadata), |
306 cloneToken(node.externalKeyword), | 308 cloneToken(node.externalKeyword), |
307 cloneToken(node.constKeyword), | 309 cloneToken(node.constKeyword), |
308 cloneToken(node.factoryKeyword), | 310 cloneToken(node.factoryKeyword), |
309 cloneNode(node.returnType), | 311 cloneNode(node.returnType), |
310 cloneToken(node.period), | 312 cloneToken(node.period), |
311 cloneNode(node.name), | 313 cloneNode(node.name), |
312 cloneNode(node.parameters), | 314 cloneNode(node.parameters), |
313 cloneToken(node.separator), | 315 cloneToken(node.separator), |
314 cloneNodeList(node.initializers), | 316 cloneNodeList(node.initializers), |
315 cloneNode(node.redirectedConstructor), | 317 cloneNode(node.redirectedConstructor), |
316 cloneNode(node.body)); | 318 cloneNode(node.body)); |
317 | 319 |
318 @override | 320 @override |
319 ConstructorFieldInitializer visitConstructorFieldInitializer( | 321 ConstructorFieldInitializer visitConstructorFieldInitializer( |
320 ConstructorFieldInitializer node) => | 322 ConstructorFieldInitializer node) => |
321 new ConstructorFieldInitializer( | 323 astFactory.constructorFieldInitializer( |
322 cloneToken(node.thisKeyword), | 324 cloneToken(node.thisKeyword), |
323 cloneToken(node.period), | 325 cloneToken(node.period), |
324 cloneNode(node.fieldName), | 326 cloneNode(node.fieldName), |
325 cloneToken(node.equals), | 327 cloneToken(node.equals), |
326 cloneNode(node.expression)); | 328 cloneNode(node.expression)); |
327 | 329 |
328 @override | 330 @override |
329 ConstructorName visitConstructorName(ConstructorName node) => | 331 ConstructorName visitConstructorName(ConstructorName node) => |
330 new ConstructorName( | 332 astFactory.constructorName( |
331 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name)); | 333 cloneNode(node.type), cloneToken(node.period), cloneNode(node.name)); |
332 | 334 |
333 @override | 335 @override |
334 ContinueStatement visitContinueStatement(ContinueStatement node) => | 336 ContinueStatement visitContinueStatement(ContinueStatement node) => |
335 new ContinueStatement(cloneToken(node.continueKeyword), | 337 astFactory.continueStatement(cloneToken(node.continueKeyword), |
336 cloneNode(node.label), cloneToken(node.semicolon)); | 338 cloneNode(node.label), cloneToken(node.semicolon)); |
337 | 339 |
338 @override | 340 @override |
339 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => | 341 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => |
340 new DeclaredIdentifier( | 342 astFactory.declaredIdentifier( |
341 cloneNode(node.documentationComment), | 343 cloneNode(node.documentationComment), |
342 cloneNodeList(node.metadata), | 344 cloneNodeList(node.metadata), |
343 cloneToken(node.keyword), | 345 cloneToken(node.keyword), |
344 cloneNode(node.type), | 346 cloneNode(node.type), |
345 cloneNode(node.identifier)); | 347 cloneNode(node.identifier)); |
346 | 348 |
347 @override | 349 @override |
348 DefaultFormalParameter visitDefaultFormalParameter( | 350 DefaultFormalParameter visitDefaultFormalParameter( |
349 DefaultFormalParameter node) => | 351 DefaultFormalParameter node) => |
350 new DefaultFormalParameter(cloneNode(node.parameter), node.kind, | 352 astFactory.defaultFormalParameter(cloneNode(node.parameter), node.kind, |
351 cloneToken(node.separator), cloneNode(node.defaultValue)); | 353 cloneToken(node.separator), cloneNode(node.defaultValue)); |
352 | 354 |
353 @override | 355 @override |
354 DoStatement visitDoStatement(DoStatement node) => new DoStatement( | 356 DoStatement visitDoStatement(DoStatement node) => astFactory.doStatement( |
355 cloneToken(node.doKeyword), | 357 cloneToken(node.doKeyword), |
356 cloneNode(node.body), | 358 cloneNode(node.body), |
357 cloneToken(node.whileKeyword), | 359 cloneToken(node.whileKeyword), |
358 cloneToken(node.leftParenthesis), | 360 cloneToken(node.leftParenthesis), |
359 cloneNode(node.condition), | 361 cloneNode(node.condition), |
360 cloneToken(node.rightParenthesis), | 362 cloneToken(node.rightParenthesis), |
361 cloneToken(node.semicolon)); | 363 cloneToken(node.semicolon)); |
362 | 364 |
363 @override | 365 @override |
364 DottedName visitDottedName(DottedName node) => | 366 DottedName visitDottedName(DottedName node) => |
365 new DottedName(cloneNodeList(node.components)); | 367 astFactory.dottedName(cloneNodeList(node.components)); |
366 | 368 |
367 @override | 369 @override |
368 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => | 370 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) => |
369 new DoubleLiteral(cloneToken(node.literal), node.value); | 371 astFactory.doubleLiteral(cloneToken(node.literal), node.value); |
370 | 372 |
371 @override | 373 @override |
372 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => | 374 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => |
373 new EmptyFunctionBody(cloneToken(node.semicolon)); | 375 astFactory.emptyFunctionBody(cloneToken(node.semicolon)); |
374 | 376 |
375 @override | 377 @override |
376 EmptyStatement visitEmptyStatement(EmptyStatement node) => | 378 EmptyStatement visitEmptyStatement(EmptyStatement node) => |
377 new EmptyStatement(cloneToken(node.semicolon)); | 379 astFactory.emptyStatement(cloneToken(node.semicolon)); |
378 | 380 |
379 @override | 381 @override |
380 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => | 382 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => |
381 new EnumConstantDeclaration(cloneNode(node.documentationComment), | 383 astFactory.enumConstantDeclaration(cloneNode(node.documentationComment), |
382 cloneNodeList(node.metadata), cloneNode(node.name)); | 384 cloneNodeList(node.metadata), cloneNode(node.name)); |
383 | 385 |
384 @override | 386 @override |
385 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) => | 387 EnumDeclaration visitEnumDeclaration(EnumDeclaration node) => |
386 new EnumDeclaration( | 388 astFactory.enumDeclaration( |
387 cloneNode(node.documentationComment), | 389 cloneNode(node.documentationComment), |
388 cloneNodeList(node.metadata), | 390 cloneNodeList(node.metadata), |
389 cloneToken(node.enumKeyword), | 391 cloneToken(node.enumKeyword), |
390 cloneNode(node.name), | 392 cloneNode(node.name), |
391 cloneToken(node.leftBracket), | 393 cloneToken(node.leftBracket), |
392 cloneNodeList(node.constants), | 394 cloneNodeList(node.constants), |
393 cloneToken(node.rightBracket)); | 395 cloneToken(node.rightBracket)); |
394 | 396 |
395 @override | 397 @override |
396 ExportDirective visitExportDirective(ExportDirective node) { | 398 ExportDirective visitExportDirective(ExportDirective node) { |
397 ExportDirectiveImpl directive = new ExportDirective( | 399 ExportDirectiveImpl directive = astFactory.exportDirective( |
398 cloneNode(node.documentationComment), | 400 cloneNode(node.documentationComment), |
399 cloneNodeList(node.metadata), | 401 cloneNodeList(node.metadata), |
400 cloneToken(node.keyword), | 402 cloneToken(node.keyword), |
401 cloneNode(node.uri), | 403 cloneNode(node.uri), |
402 cloneNodeList(node.configurations), | 404 cloneNodeList(node.configurations), |
403 cloneNodeList(node.combinators), | 405 cloneNodeList(node.combinators), |
404 cloneToken(node.semicolon)); | 406 cloneToken(node.semicolon)); |
405 directive.selectedUriContent = node.selectedUriContent; | 407 directive.selectedUriContent = node.selectedUriContent; |
406 directive.selectedSource = node.selectedSource; | 408 directive.selectedSource = node.selectedSource; |
407 directive.uriSource = node.uriSource; | 409 directive.uriSource = node.uriSource; |
408 directive.uriContent = node.uriContent; | 410 directive.uriContent = node.uriContent; |
409 return directive; | 411 return directive; |
410 } | 412 } |
411 | 413 |
412 @override | 414 @override |
413 ExpressionFunctionBody visitExpressionFunctionBody( | 415 ExpressionFunctionBody visitExpressionFunctionBody( |
414 ExpressionFunctionBody node) => | 416 ExpressionFunctionBody node) => |
415 new ExpressionFunctionBody( | 417 astFactory.expressionFunctionBody( |
416 cloneToken(node.keyword), | 418 cloneToken(node.keyword), |
417 cloneToken(node.functionDefinition), | 419 cloneToken(node.functionDefinition), |
418 cloneNode(node.expression), | 420 cloneNode(node.expression), |
419 cloneToken(node.semicolon)); | 421 cloneToken(node.semicolon)); |
420 | 422 |
421 @override | 423 @override |
422 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => | 424 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => |
423 new ExpressionStatement( | 425 astFactory.expressionStatement( |
424 cloneNode(node.expression), cloneToken(node.semicolon)); | 426 cloneNode(node.expression), cloneToken(node.semicolon)); |
425 | 427 |
426 @override | 428 @override |
427 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( | 429 ExtendsClause visitExtendsClause(ExtendsClause node) => |
428 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); | 430 astFactory.extendsClause( |
| 431 cloneToken(node.extendsKeyword), cloneNode(node.superclass)); |
429 | 432 |
430 @override | 433 @override |
431 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => | 434 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => |
432 new FieldDeclaration( | 435 astFactory.fieldDeclaration( |
433 cloneNode(node.documentationComment), | 436 cloneNode(node.documentationComment), |
434 cloneNodeList(node.metadata), | 437 cloneNodeList(node.metadata), |
435 cloneToken(node.staticKeyword), | 438 cloneToken(node.staticKeyword), |
436 cloneNode(node.fields), | 439 cloneNode(node.fields), |
437 cloneToken(node.semicolon)); | 440 cloneToken(node.semicolon)); |
438 | 441 |
439 @override | 442 @override |
440 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => | 443 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => |
441 new FieldFormalParameter( | 444 astFactory.fieldFormalParameter( |
442 cloneNode(node.documentationComment), | 445 cloneNode(node.documentationComment), |
443 cloneNodeList(node.metadata), | 446 cloneNodeList(node.metadata), |
444 cloneToken(node.keyword), | 447 cloneToken(node.keyword), |
445 cloneNode(node.type), | 448 cloneNode(node.type), |
446 cloneToken(node.thisKeyword), | 449 cloneToken(node.thisKeyword), |
447 cloneToken(node.period), | 450 cloneToken(node.period), |
448 cloneNode(node.identifier), | 451 cloneNode(node.identifier), |
449 cloneNode(node.typeParameters), | 452 cloneNode(node.typeParameters), |
450 cloneNode(node.parameters)); | 453 cloneNode(node.parameters)); |
451 | 454 |
452 @override | 455 @override |
453 ForEachStatement visitForEachStatement(ForEachStatement node) { | 456 ForEachStatement visitForEachStatement(ForEachStatement node) { |
454 DeclaredIdentifier loopVariable = node.loopVariable; | 457 DeclaredIdentifier loopVariable = node.loopVariable; |
455 if (loopVariable == null) { | 458 if (loopVariable == null) { |
456 return new ForEachStatement.withReference( | 459 return astFactory.forEachStatementWithReference( |
457 cloneToken(node.awaitKeyword), | 460 cloneToken(node.awaitKeyword), |
458 cloneToken(node.forKeyword), | 461 cloneToken(node.forKeyword), |
459 cloneToken(node.leftParenthesis), | 462 cloneToken(node.leftParenthesis), |
460 cloneNode(node.identifier), | 463 cloneNode(node.identifier), |
461 cloneToken(node.inKeyword), | 464 cloneToken(node.inKeyword), |
462 cloneNode(node.iterable), | 465 cloneNode(node.iterable), |
463 cloneToken(node.rightParenthesis), | 466 cloneToken(node.rightParenthesis), |
464 cloneNode(node.body)); | 467 cloneNode(node.body)); |
465 } | 468 } |
466 return new ForEachStatement.withDeclaration( | 469 return astFactory.forEachStatementWithDeclaration( |
467 cloneToken(node.awaitKeyword), | 470 cloneToken(node.awaitKeyword), |
468 cloneToken(node.forKeyword), | 471 cloneToken(node.forKeyword), |
469 cloneToken(node.leftParenthesis), | 472 cloneToken(node.leftParenthesis), |
470 cloneNode(loopVariable), | 473 cloneNode(loopVariable), |
471 cloneToken(node.inKeyword), | 474 cloneToken(node.inKeyword), |
472 cloneNode(node.iterable), | 475 cloneNode(node.iterable), |
473 cloneToken(node.rightParenthesis), | 476 cloneToken(node.rightParenthesis), |
474 cloneNode(node.body)); | 477 cloneNode(node.body)); |
475 } | 478 } |
476 | 479 |
477 @override | 480 @override |
478 FormalParameterList visitFormalParameterList(FormalParameterList node) => | 481 FormalParameterList visitFormalParameterList(FormalParameterList node) => |
479 new FormalParameterList( | 482 astFactory.formalParameterList( |
480 cloneToken(node.leftParenthesis), | 483 cloneToken(node.leftParenthesis), |
481 cloneNodeList(node.parameters), | 484 cloneNodeList(node.parameters), |
482 cloneToken(node.leftDelimiter), | 485 cloneToken(node.leftDelimiter), |
483 cloneToken(node.rightDelimiter), | 486 cloneToken(node.rightDelimiter), |
484 cloneToken(node.rightParenthesis)); | 487 cloneToken(node.rightParenthesis)); |
485 | 488 |
486 @override | 489 @override |
487 ForStatement visitForStatement(ForStatement node) => new ForStatement( | 490 ForStatement visitForStatement(ForStatement node) => astFactory.forStatement( |
488 cloneToken(node.forKeyword), | 491 cloneToken(node.forKeyword), |
489 cloneToken(node.leftParenthesis), | 492 cloneToken(node.leftParenthesis), |
490 cloneNode(node.variables), | 493 cloneNode(node.variables), |
491 cloneNode(node.initialization), | 494 cloneNode(node.initialization), |
492 cloneToken(node.leftSeparator), | 495 cloneToken(node.leftSeparator), |
493 cloneNode(node.condition), | 496 cloneNode(node.condition), |
494 cloneToken(node.rightSeparator), | 497 cloneToken(node.rightSeparator), |
495 cloneNodeList(node.updaters), | 498 cloneNodeList(node.updaters), |
496 cloneToken(node.rightParenthesis), | 499 cloneToken(node.rightParenthesis), |
497 cloneNode(node.body)); | 500 cloneNode(node.body)); |
498 | 501 |
499 @override | 502 @override |
500 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => | 503 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => |
501 new FunctionDeclaration( | 504 astFactory.functionDeclaration( |
502 cloneNode(node.documentationComment), | 505 cloneNode(node.documentationComment), |
503 cloneNodeList(node.metadata), | 506 cloneNodeList(node.metadata), |
504 cloneToken(node.externalKeyword), | 507 cloneToken(node.externalKeyword), |
505 cloneNode(node.returnType), | 508 cloneNode(node.returnType), |
506 cloneToken(node.propertyKeyword), | 509 cloneToken(node.propertyKeyword), |
507 cloneNode(node.name), | 510 cloneNode(node.name), |
508 cloneNode(node.functionExpression)); | 511 cloneNode(node.functionExpression)); |
509 | 512 |
510 @override | 513 @override |
511 FunctionDeclarationStatement visitFunctionDeclarationStatement( | 514 FunctionDeclarationStatement visitFunctionDeclarationStatement( |
512 FunctionDeclarationStatement node) => | 515 FunctionDeclarationStatement node) => |
513 new FunctionDeclarationStatement(cloneNode(node.functionDeclaration)); | 516 astFactory |
| 517 .functionDeclarationStatement(cloneNode(node.functionDeclaration)); |
514 | 518 |
515 @override | 519 @override |
516 FunctionExpression visitFunctionExpression(FunctionExpression node) => | 520 FunctionExpression visitFunctionExpression(FunctionExpression node) => |
517 new FunctionExpression(cloneNode(node.typeParameters), | 521 astFactory.functionExpression(cloneNode(node.typeParameters), |
518 cloneNode(node.parameters), cloneNode(node.body)); | 522 cloneNode(node.parameters), cloneNode(node.body)); |
519 | 523 |
520 @override | 524 @override |
521 FunctionExpressionInvocation visitFunctionExpressionInvocation( | 525 FunctionExpressionInvocation visitFunctionExpressionInvocation( |
522 FunctionExpressionInvocation node) => | 526 FunctionExpressionInvocation node) => |
523 new FunctionExpressionInvocation(cloneNode(node.function), | 527 astFactory.functionExpressionInvocation(cloneNode(node.function), |
524 cloneNode(node.typeArguments), cloneNode(node.argumentList)); | 528 cloneNode(node.typeArguments), cloneNode(node.argumentList)); |
525 | 529 |
526 @override | 530 @override |
527 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => | 531 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => |
528 new FunctionTypeAlias( | 532 astFactory.functionTypeAlias( |
529 cloneNode(node.documentationComment), | 533 cloneNode(node.documentationComment), |
530 cloneNodeList(node.metadata), | 534 cloneNodeList(node.metadata), |
531 cloneToken(node.typedefKeyword), | 535 cloneToken(node.typedefKeyword), |
532 cloneNode(node.returnType), | 536 cloneNode(node.returnType), |
533 cloneNode(node.name), | 537 cloneNode(node.name), |
534 cloneNode(node.typeParameters), | 538 cloneNode(node.typeParameters), |
535 cloneNode(node.parameters), | 539 cloneNode(node.parameters), |
536 cloneToken(node.semicolon)); | 540 cloneToken(node.semicolon)); |
537 | 541 |
538 @override | 542 @override |
539 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( | 543 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( |
540 FunctionTypedFormalParameter node) => | 544 FunctionTypedFormalParameter node) => |
541 new FunctionTypedFormalParameter( | 545 astFactory.functionTypedFormalParameter( |
542 cloneNode(node.documentationComment), | 546 cloneNode(node.documentationComment), |
543 cloneNodeList(node.metadata), | 547 cloneNodeList(node.metadata), |
544 cloneNode(node.returnType), | 548 cloneNode(node.returnType), |
545 cloneNode(node.identifier), | 549 cloneNode(node.identifier), |
546 cloneNode(node.typeParameters), | 550 cloneNode(node.typeParameters), |
547 cloneNode(node.parameters)); | 551 cloneNode(node.parameters)); |
548 | 552 |
549 @override | 553 @override |
550 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( | 554 HideCombinator visitHideCombinator(HideCombinator node) => |
551 cloneToken(node.keyword), cloneNodeList(node.hiddenNames)); | 555 astFactory.hideCombinator( |
| 556 cloneToken(node.keyword), cloneNodeList(node.hiddenNames)); |
552 | 557 |
553 @override | 558 @override |
554 IfStatement visitIfStatement(IfStatement node) => new IfStatement( | 559 IfStatement visitIfStatement(IfStatement node) => astFactory.ifStatement( |
555 cloneToken(node.ifKeyword), | 560 cloneToken(node.ifKeyword), |
556 cloneToken(node.leftParenthesis), | 561 cloneToken(node.leftParenthesis), |
557 cloneNode(node.condition), | 562 cloneNode(node.condition), |
558 cloneToken(node.rightParenthesis), | 563 cloneToken(node.rightParenthesis), |
559 cloneNode(node.thenStatement), | 564 cloneNode(node.thenStatement), |
560 cloneToken(node.elseKeyword), | 565 cloneToken(node.elseKeyword), |
561 cloneNode(node.elseStatement)); | 566 cloneNode(node.elseStatement)); |
562 | 567 |
563 @override | 568 @override |
564 ImplementsClause visitImplementsClause(ImplementsClause node) => | 569 ImplementsClause visitImplementsClause(ImplementsClause node) => |
565 new ImplementsClause( | 570 astFactory.implementsClause( |
566 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); | 571 cloneToken(node.implementsKeyword), cloneNodeList(node.interfaces)); |
567 | 572 |
568 @override | 573 @override |
569 ImportDirective visitImportDirective(ImportDirective node) { | 574 ImportDirective visitImportDirective(ImportDirective node) { |
570 ImportDirectiveImpl directive = new ImportDirective( | 575 ImportDirectiveImpl directive = astFactory.importDirective( |
571 cloneNode(node.documentationComment), | 576 cloneNode(node.documentationComment), |
572 cloneNodeList(node.metadata), | 577 cloneNodeList(node.metadata), |
573 cloneToken(node.keyword), | 578 cloneToken(node.keyword), |
574 cloneNode(node.uri), | 579 cloneNode(node.uri), |
575 cloneNodeList(node.configurations), | 580 cloneNodeList(node.configurations), |
576 cloneToken(node.deferredKeyword), | 581 cloneToken(node.deferredKeyword), |
577 cloneToken(node.asKeyword), | 582 cloneToken(node.asKeyword), |
578 cloneNode(node.prefix), | 583 cloneNode(node.prefix), |
579 cloneNodeList(node.combinators), | 584 cloneNodeList(node.combinators), |
580 cloneToken(node.semicolon)); | 585 cloneToken(node.semicolon)); |
581 directive.selectedUriContent = node.selectedUriContent; | 586 directive.selectedUriContent = node.selectedUriContent; |
582 directive.selectedSource = node.selectedSource; | 587 directive.selectedSource = node.selectedSource; |
583 directive.uriSource = node.uriSource; | 588 directive.uriSource = node.uriSource; |
584 directive.uriContent = node.uriContent; | 589 directive.uriContent = node.uriContent; |
585 return directive; | 590 return directive; |
586 } | 591 } |
587 | 592 |
588 @override | 593 @override |
589 IndexExpression visitIndexExpression(IndexExpression node) { | 594 IndexExpression visitIndexExpression(IndexExpression node) { |
590 Token period = node.period; | 595 Token period = node.period; |
591 if (period == null) { | 596 if (period == null) { |
592 return new IndexExpression.forTarget( | 597 return astFactory.indexExpressionForTarget( |
593 cloneNode(node.target), | 598 cloneNode(node.target), |
594 cloneToken(node.leftBracket), | 599 cloneToken(node.leftBracket), |
595 cloneNode(node.index), | 600 cloneNode(node.index), |
596 cloneToken(node.rightBracket)); | 601 cloneToken(node.rightBracket)); |
597 } else { | 602 } else { |
598 return new IndexExpression.forCascade( | 603 return astFactory.indexExpressionForCascade( |
599 cloneToken(period), | 604 cloneToken(period), |
600 cloneToken(node.leftBracket), | 605 cloneToken(node.leftBracket), |
601 cloneNode(node.index), | 606 cloneNode(node.index), |
602 cloneToken(node.rightBracket)); | 607 cloneToken(node.rightBracket)); |
603 } | 608 } |
604 } | 609 } |
605 | 610 |
606 @override | 611 @override |
607 InstanceCreationExpression visitInstanceCreationExpression( | 612 InstanceCreationExpression visitInstanceCreationExpression( |
608 InstanceCreationExpression node) => | 613 InstanceCreationExpression node) => |
609 new InstanceCreationExpression(cloneToken(node.keyword), | 614 astFactory.instanceCreationExpression(cloneToken(node.keyword), |
610 cloneNode(node.constructorName), cloneNode(node.argumentList)); | 615 cloneNode(node.constructorName), cloneNode(node.argumentList)); |
611 | 616 |
612 @override | 617 @override |
613 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => | 618 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) => |
614 new IntegerLiteral(cloneToken(node.literal), node.value); | 619 astFactory.integerLiteral(cloneToken(node.literal), node.value); |
615 | 620 |
616 @override | 621 @override |
617 InterpolationExpression visitInterpolationExpression( | 622 InterpolationExpression visitInterpolationExpression( |
618 InterpolationExpression node) => | 623 InterpolationExpression node) => |
619 new InterpolationExpression(cloneToken(node.leftBracket), | 624 astFactory.interpolationExpression(cloneToken(node.leftBracket), |
620 cloneNode(node.expression), cloneToken(node.rightBracket)); | 625 cloneNode(node.expression), cloneToken(node.rightBracket)); |
621 | 626 |
622 @override | 627 @override |
623 InterpolationString visitInterpolationString(InterpolationString node) => | 628 InterpolationString visitInterpolationString(InterpolationString node) => |
624 new InterpolationString(cloneToken(node.contents), node.value); | 629 astFactory.interpolationString(cloneToken(node.contents), node.value); |
625 | 630 |
626 @override | 631 @override |
627 IsExpression visitIsExpression(IsExpression node) => new IsExpression( | 632 IsExpression visitIsExpression(IsExpression node) => astFactory.isExpression( |
628 cloneNode(node.expression), | 633 cloneNode(node.expression), |
629 cloneToken(node.isOperator), | 634 cloneToken(node.isOperator), |
630 cloneToken(node.notOperator), | 635 cloneToken(node.notOperator), |
631 cloneNode(node.type)); | 636 cloneNode(node.type)); |
632 | 637 |
633 @override | 638 @override |
634 Label visitLabel(Label node) => | 639 Label visitLabel(Label node) => |
635 new Label(cloneNode(node.label), cloneToken(node.colon)); | 640 astFactory.label(cloneNode(node.label), cloneToken(node.colon)); |
636 | 641 |
637 @override | 642 @override |
638 LabeledStatement visitLabeledStatement(LabeledStatement node) => | 643 LabeledStatement visitLabeledStatement(LabeledStatement node) => astFactory |
639 new LabeledStatement( | 644 .labeledStatement(cloneNodeList(node.labels), cloneNode(node.statement)); |
640 cloneNodeList(node.labels), cloneNode(node.statement)); | |
641 | 645 |
642 @override | 646 @override |
643 LibraryDirective visitLibraryDirective(LibraryDirective node) => | 647 LibraryDirective visitLibraryDirective(LibraryDirective node) => |
644 new LibraryDirective( | 648 astFactory.libraryDirective( |
645 cloneNode(node.documentationComment), | 649 cloneNode(node.documentationComment), |
646 cloneNodeList(node.metadata), | 650 cloneNodeList(node.metadata), |
647 cloneToken(node.libraryKeyword), | 651 cloneToken(node.libraryKeyword), |
648 cloneNode(node.name), | 652 cloneNode(node.name), |
649 cloneToken(node.semicolon)); | 653 cloneToken(node.semicolon)); |
650 | 654 |
651 @override | 655 @override |
652 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => | 656 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) => |
653 new LibraryIdentifier(cloneNodeList(node.components)); | 657 astFactory.libraryIdentifier(cloneNodeList(node.components)); |
654 | 658 |
655 @override | 659 @override |
656 ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral( | 660 ListLiteral visitListLiteral(ListLiteral node) => astFactory.listLiteral( |
657 cloneToken(node.constKeyword), | 661 cloneToken(node.constKeyword), |
658 cloneNode(node.typeArguments), | 662 cloneNode(node.typeArguments), |
659 cloneToken(node.leftBracket), | 663 cloneToken(node.leftBracket), |
660 cloneNodeList(node.elements), | 664 cloneNodeList(node.elements), |
661 cloneToken(node.rightBracket)); | 665 cloneToken(node.rightBracket)); |
662 | 666 |
663 @override | 667 @override |
664 MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral( | 668 MapLiteral visitMapLiteral(MapLiteral node) => astFactory.mapLiteral( |
665 cloneToken(node.constKeyword), | 669 cloneToken(node.constKeyword), |
666 cloneNode(node.typeArguments), | 670 cloneNode(node.typeArguments), |
667 cloneToken(node.leftBracket), | 671 cloneToken(node.leftBracket), |
668 cloneNodeList(node.entries), | 672 cloneNodeList(node.entries), |
669 cloneToken(node.rightBracket)); | 673 cloneToken(node.rightBracket)); |
670 | 674 |
671 @override | 675 @override |
672 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => | 676 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => |
673 new MapLiteralEntry(cloneNode(node.key), cloneToken(node.separator), | 677 astFactory.mapLiteralEntry(cloneNode(node.key), |
674 cloneNode(node.value)); | 678 cloneToken(node.separator), cloneNode(node.value)); |
675 | 679 |
676 @override | 680 @override |
677 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => | 681 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => |
678 new MethodDeclaration( | 682 astFactory.methodDeclaration( |
679 cloneNode(node.documentationComment), | 683 cloneNode(node.documentationComment), |
680 cloneNodeList(node.metadata), | 684 cloneNodeList(node.metadata), |
681 cloneToken(node.externalKeyword), | 685 cloneToken(node.externalKeyword), |
682 cloneToken(node.modifierKeyword), | 686 cloneToken(node.modifierKeyword), |
683 cloneNode(node.returnType), | 687 cloneNode(node.returnType), |
684 cloneToken(node.propertyKeyword), | 688 cloneToken(node.propertyKeyword), |
685 cloneToken(node.operatorKeyword), | 689 cloneToken(node.operatorKeyword), |
686 cloneNode(node.name), | 690 cloneNode(node.name), |
687 cloneNode(node.typeParameters), | 691 cloneNode(node.typeParameters), |
688 cloneNode(node.parameters), | 692 cloneNode(node.parameters), |
689 cloneNode(node.body)); | 693 cloneNode(node.body)); |
690 | 694 |
691 @override | 695 @override |
692 MethodInvocation visitMethodInvocation(MethodInvocation node) => | 696 MethodInvocation visitMethodInvocation(MethodInvocation node) => |
693 new MethodInvocation( | 697 astFactory.methodInvocation( |
694 cloneNode(node.target), | 698 cloneNode(node.target), |
695 cloneToken(node.operator), | 699 cloneToken(node.operator), |
696 cloneNode(node.methodName), | 700 cloneNode(node.methodName), |
697 cloneNode(node.typeArguments), | 701 cloneNode(node.typeArguments), |
698 cloneNode(node.argumentList)); | 702 cloneNode(node.argumentList)); |
699 | 703 |
700 @override | 704 @override |
701 NamedExpression visitNamedExpression(NamedExpression node) => | 705 NamedExpression visitNamedExpression(NamedExpression node) => astFactory |
702 new NamedExpression(cloneNode(node.name), cloneNode(node.expression)); | 706 .namedExpression(cloneNode(node.name), cloneNode(node.expression)); |
703 | 707 |
704 @override | 708 @override |
705 AstNode visitNativeClause(NativeClause node) => | 709 AstNode visitNativeClause(NativeClause node) => astFactory.nativeClause( |
706 new NativeClause(cloneToken(node.nativeKeyword), cloneNode(node.name)); | 710 cloneToken(node.nativeKeyword), cloneNode(node.name)); |
707 | 711 |
708 @override | 712 @override |
709 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => | 713 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => |
710 new NativeFunctionBody(cloneToken(node.nativeKeyword), | 714 astFactory.nativeFunctionBody(cloneToken(node.nativeKeyword), |
711 cloneNode(node.stringLiteral), cloneToken(node.semicolon)); | 715 cloneNode(node.stringLiteral), cloneToken(node.semicolon)); |
712 | 716 |
713 @override | 717 @override |
714 NullLiteral visitNullLiteral(NullLiteral node) => | 718 NullLiteral visitNullLiteral(NullLiteral node) => |
715 new NullLiteral(cloneToken(node.literal)); | 719 astFactory.nullLiteral(cloneToken(node.literal)); |
716 | 720 |
717 @override | 721 @override |
718 ParenthesizedExpression visitParenthesizedExpression( | 722 ParenthesizedExpression visitParenthesizedExpression( |
719 ParenthesizedExpression node) => | 723 ParenthesizedExpression node) => |
720 new ParenthesizedExpression(cloneToken(node.leftParenthesis), | 724 astFactory.parenthesizedExpression(cloneToken(node.leftParenthesis), |
721 cloneNode(node.expression), cloneToken(node.rightParenthesis)); | 725 cloneNode(node.expression), cloneToken(node.rightParenthesis)); |
722 | 726 |
723 @override | 727 @override |
724 PartDirective visitPartDirective(PartDirective node) { | 728 PartDirective visitPartDirective(PartDirective node) { |
725 PartDirective directive = new PartDirective( | 729 PartDirective directive = astFactory.partDirective( |
726 cloneNode(node.documentationComment), | 730 cloneNode(node.documentationComment), |
727 cloneNodeList(node.metadata), | 731 cloneNodeList(node.metadata), |
728 cloneToken(node.partKeyword), | 732 cloneToken(node.partKeyword), |
729 cloneNode(node.uri), | 733 cloneNode(node.uri), |
730 cloneToken(node.semicolon)); | 734 cloneToken(node.semicolon)); |
731 directive.uriSource = node.uriSource; | 735 directive.uriSource = node.uriSource; |
732 directive.uriContent = node.uriContent; | 736 directive.uriContent = node.uriContent; |
733 return directive; | 737 return directive; |
734 } | 738 } |
735 | 739 |
736 @override | 740 @override |
737 PartOfDirective visitPartOfDirective(PartOfDirective node) => | 741 PartOfDirective visitPartOfDirective(PartOfDirective node) => |
738 new PartOfDirective( | 742 astFactory.partOfDirective( |
739 cloneNode(node.documentationComment), | 743 cloneNode(node.documentationComment), |
740 cloneNodeList(node.metadata), | 744 cloneNodeList(node.metadata), |
741 cloneToken(node.partKeyword), | 745 cloneToken(node.partKeyword), |
742 cloneToken(node.ofKeyword), | 746 cloneToken(node.ofKeyword), |
743 cloneNode(node.uri), | 747 cloneNode(node.uri), |
744 cloneNode(node.libraryName), | 748 cloneNode(node.libraryName), |
745 cloneToken(node.semicolon)); | 749 cloneToken(node.semicolon)); |
746 | 750 |
747 @override | 751 @override |
748 PostfixExpression visitPostfixExpression(PostfixExpression node) => | 752 PostfixExpression visitPostfixExpression(PostfixExpression node) => astFactory |
749 new PostfixExpression(cloneNode(node.operand), cloneToken(node.operator)); | 753 .postfixExpression(cloneNode(node.operand), cloneToken(node.operator)); |
750 | 754 |
751 @override | 755 @override |
752 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => | 756 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) => |
753 new PrefixedIdentifier(cloneNode(node.prefix), cloneToken(node.period), | 757 astFactory.prefixedIdentifier(cloneNode(node.prefix), |
754 cloneNode(node.identifier)); | 758 cloneToken(node.period), cloneNode(node.identifier)); |
755 | 759 |
756 @override | 760 @override |
757 PrefixExpression visitPrefixExpression(PrefixExpression node) => | 761 PrefixExpression visitPrefixExpression(PrefixExpression node) => astFactory |
758 new PrefixExpression(cloneToken(node.operator), cloneNode(node.operand)); | 762 .prefixExpression(cloneToken(node.operator), cloneNode(node.operand)); |
759 | 763 |
760 @override | 764 @override |
761 PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess( | 765 PropertyAccess visitPropertyAccess(PropertyAccess node) => |
762 cloneNode(node.target), | 766 astFactory.propertyAccess(cloneNode(node.target), |
763 cloneToken(node.operator), | 767 cloneToken(node.operator), cloneNode(node.propertyName)); |
764 cloneNode(node.propertyName)); | |
765 | 768 |
766 @override | 769 @override |
767 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( | 770 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( |
768 RedirectingConstructorInvocation node) => | 771 RedirectingConstructorInvocation node) => |
769 new RedirectingConstructorInvocation( | 772 astFactory.redirectingConstructorInvocation( |
770 cloneToken(node.thisKeyword), | 773 cloneToken(node.thisKeyword), |
771 cloneToken(node.period), | 774 cloneToken(node.period), |
772 cloneNode(node.constructorName), | 775 cloneNode(node.constructorName), |
773 cloneNode(node.argumentList)); | 776 cloneNode(node.argumentList)); |
774 | 777 |
775 @override | 778 @override |
776 RethrowExpression visitRethrowExpression(RethrowExpression node) => | 779 RethrowExpression visitRethrowExpression(RethrowExpression node) => |
777 new RethrowExpression(cloneToken(node.rethrowKeyword)); | 780 astFactory.rethrowExpression(cloneToken(node.rethrowKeyword)); |
778 | 781 |
779 @override | 782 @override |
780 ReturnStatement visitReturnStatement(ReturnStatement node) => | 783 ReturnStatement visitReturnStatement(ReturnStatement node) => |
781 new ReturnStatement(cloneToken(node.returnKeyword), | 784 astFactory.returnStatement(cloneToken(node.returnKeyword), |
782 cloneNode(node.expression), cloneToken(node.semicolon)); | 785 cloneNode(node.expression), cloneToken(node.semicolon)); |
783 | 786 |
784 @override | 787 @override |
785 ScriptTag visitScriptTag(ScriptTag node) => | 788 ScriptTag visitScriptTag(ScriptTag node) => |
786 new ScriptTag(cloneToken(node.scriptTag)); | 789 astFactory.scriptTag(cloneToken(node.scriptTag)); |
787 | 790 |
788 @override | 791 @override |
789 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( | 792 ShowCombinator visitShowCombinator(ShowCombinator node) => astFactory |
790 cloneToken(node.keyword), cloneNodeList(node.shownNames)); | 793 .showCombinator(cloneToken(node.keyword), cloneNodeList(node.shownNames)); |
791 | 794 |
792 @override | 795 @override |
793 SimpleFormalParameter visitSimpleFormalParameter( | 796 SimpleFormalParameter visitSimpleFormalParameter( |
794 SimpleFormalParameter node) => | 797 SimpleFormalParameter node) => |
795 new SimpleFormalParameter( | 798 astFactory.simpleFormalParameter( |
796 cloneNode(node.documentationComment), | 799 cloneNode(node.documentationComment), |
797 cloneNodeList(node.metadata), | 800 cloneNodeList(node.metadata), |
798 cloneToken(node.keyword), | 801 cloneToken(node.keyword), |
799 cloneNode(node.type), | 802 cloneNode(node.type), |
800 cloneNode(node.identifier)); | 803 cloneNode(node.identifier)); |
801 | 804 |
802 @override | 805 @override |
803 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => | 806 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) => |
804 new SimpleIdentifier(cloneToken(node.token), | 807 astFactory.simpleIdentifier(cloneToken(node.token), |
805 isDeclaration: node.inDeclarationContext()); | 808 isDeclaration: node.inDeclarationContext()); |
806 | 809 |
807 @override | 810 @override |
808 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => | 811 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) => |
809 new SimpleStringLiteral(cloneToken(node.literal), node.value); | 812 astFactory.simpleStringLiteral(cloneToken(node.literal), node.value); |
810 | 813 |
811 @override | 814 @override |
812 StringInterpolation visitStringInterpolation(StringInterpolation node) => | 815 StringInterpolation visitStringInterpolation(StringInterpolation node) => |
813 new StringInterpolation(cloneNodeList(node.elements)); | 816 astFactory.stringInterpolation(cloneNodeList(node.elements)); |
814 | 817 |
815 @override | 818 @override |
816 SuperConstructorInvocation visitSuperConstructorInvocation( | 819 SuperConstructorInvocation visitSuperConstructorInvocation( |
817 SuperConstructorInvocation node) => | 820 SuperConstructorInvocation node) => |
818 new SuperConstructorInvocation( | 821 astFactory.superConstructorInvocation( |
819 cloneToken(node.superKeyword), | 822 cloneToken(node.superKeyword), |
820 cloneToken(node.period), | 823 cloneToken(node.period), |
821 cloneNode(node.constructorName), | 824 cloneNode(node.constructorName), |
822 cloneNode(node.argumentList)); | 825 cloneNode(node.argumentList)); |
823 | 826 |
824 @override | 827 @override |
825 SuperExpression visitSuperExpression(SuperExpression node) => | 828 SuperExpression visitSuperExpression(SuperExpression node) => |
826 new SuperExpression(cloneToken(node.superKeyword)); | 829 astFactory.superExpression(cloneToken(node.superKeyword)); |
827 | 830 |
828 @override | 831 @override |
829 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( | 832 SwitchCase visitSwitchCase(SwitchCase node) => astFactory.switchCase( |
830 cloneNodeList(node.labels), | 833 cloneNodeList(node.labels), |
831 cloneToken(node.keyword), | 834 cloneToken(node.keyword), |
832 cloneNode(node.expression), | 835 cloneNode(node.expression), |
833 cloneToken(node.colon), | 836 cloneToken(node.colon), |
834 cloneNodeList(node.statements)); | 837 cloneNodeList(node.statements)); |
835 | 838 |
836 @override | 839 @override |
837 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( | 840 SwitchDefault visitSwitchDefault(SwitchDefault node) => |
838 cloneNodeList(node.labels), | 841 astFactory.switchDefault( |
839 cloneToken(node.keyword), | 842 cloneNodeList(node.labels), |
840 cloneToken(node.colon), | 843 cloneToken(node.keyword), |
841 cloneNodeList(node.statements)); | 844 cloneToken(node.colon), |
| 845 cloneNodeList(node.statements)); |
842 | 846 |
843 @override | 847 @override |
844 SwitchStatement visitSwitchStatement(SwitchStatement node) => | 848 SwitchStatement visitSwitchStatement(SwitchStatement node) => |
845 new SwitchStatement( | 849 astFactory.switchStatement( |
846 cloneToken(node.switchKeyword), | 850 cloneToken(node.switchKeyword), |
847 cloneToken(node.leftParenthesis), | 851 cloneToken(node.leftParenthesis), |
848 cloneNode(node.expression), | 852 cloneNode(node.expression), |
849 cloneToken(node.rightParenthesis), | 853 cloneToken(node.rightParenthesis), |
850 cloneToken(node.leftBracket), | 854 cloneToken(node.leftBracket), |
851 cloneNodeList(node.members), | 855 cloneNodeList(node.members), |
852 cloneToken(node.rightBracket)); | 856 cloneToken(node.rightBracket)); |
853 | 857 |
854 @override | 858 @override |
855 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral( | 859 SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => |
856 cloneToken(node.poundSign), cloneTokenList(node.components)); | 860 astFactory.symbolLiteral( |
| 861 cloneToken(node.poundSign), cloneTokenList(node.components)); |
857 | 862 |
858 @override | 863 @override |
859 ThisExpression visitThisExpression(ThisExpression node) => | 864 ThisExpression visitThisExpression(ThisExpression node) => |
860 new ThisExpression(cloneToken(node.thisKeyword)); | 865 astFactory.thisExpression(cloneToken(node.thisKeyword)); |
861 | 866 |
862 @override | 867 @override |
863 ThrowExpression visitThrowExpression(ThrowExpression node) => | 868 ThrowExpression visitThrowExpression(ThrowExpression node) => |
864 new ThrowExpression( | 869 astFactory.throwExpression( |
865 cloneToken(node.throwKeyword), cloneNode(node.expression)); | 870 cloneToken(node.throwKeyword), cloneNode(node.expression)); |
866 | 871 |
867 @override | 872 @override |
868 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( | 873 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( |
869 TopLevelVariableDeclaration node) => | 874 TopLevelVariableDeclaration node) => |
870 new TopLevelVariableDeclaration( | 875 astFactory.topLevelVariableDeclaration( |
871 cloneNode(node.documentationComment), | 876 cloneNode(node.documentationComment), |
872 cloneNodeList(node.metadata), | 877 cloneNodeList(node.metadata), |
873 cloneNode(node.variables), | 878 cloneNode(node.variables), |
874 cloneToken(node.semicolon)); | 879 cloneToken(node.semicolon)); |
875 | 880 |
876 @override | 881 @override |
877 TryStatement visitTryStatement(TryStatement node) => new TryStatement( | 882 TryStatement visitTryStatement(TryStatement node) => astFactory.tryStatement( |
878 cloneToken(node.tryKeyword), | 883 cloneToken(node.tryKeyword), |
879 cloneNode(node.body), | 884 cloneNode(node.body), |
880 cloneNodeList(node.catchClauses), | 885 cloneNodeList(node.catchClauses), |
881 cloneToken(node.finallyKeyword), | 886 cloneToken(node.finallyKeyword), |
882 cloneNode(node.finallyBlock)); | 887 cloneNode(node.finallyBlock)); |
883 | 888 |
884 @override | 889 @override |
885 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => | 890 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => |
886 new TypeArgumentList(cloneToken(node.leftBracket), | 891 astFactory.typeArgumentList(cloneToken(node.leftBracket), |
887 cloneNodeList(node.arguments), cloneToken(node.rightBracket)); | 892 cloneNodeList(node.arguments), cloneToken(node.rightBracket)); |
888 | 893 |
889 @override | 894 @override |
890 TypeName visitTypeName(TypeName node) => | 895 TypeName visitTypeName(TypeName node) => |
891 new TypeName(cloneNode(node.name), cloneNode(node.typeArguments)); | 896 astFactory.typeName(cloneNode(node.name), cloneNode(node.typeArguments)); |
892 | 897 |
893 @override | 898 @override |
894 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( | 899 TypeParameter visitTypeParameter(TypeParameter node) => |
895 cloneNode(node.documentationComment), | 900 astFactory.typeParameter( |
896 cloneNodeList(node.metadata), | 901 cloneNode(node.documentationComment), |
897 cloneNode(node.name), | 902 cloneNodeList(node.metadata), |
898 cloneToken(node.extendsKeyword), | 903 cloneNode(node.name), |
899 cloneNode(node.bound)); | 904 cloneToken(node.extendsKeyword), |
| 905 cloneNode(node.bound)); |
900 | 906 |
901 @override | 907 @override |
902 TypeParameterList visitTypeParameterList(TypeParameterList node) => | 908 TypeParameterList visitTypeParameterList(TypeParameterList node) => |
903 new TypeParameterList(cloneToken(node.leftBracket), | 909 astFactory.typeParameterList(cloneToken(node.leftBracket), |
904 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); | 910 cloneNodeList(node.typeParameters), cloneToken(node.rightBracket)); |
905 | 911 |
906 @override | 912 @override |
907 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => | 913 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => |
908 new VariableDeclaration(cloneNode(node.name), cloneToken(node.equals), | 914 astFactory.variableDeclaration(cloneNode(node.name), |
909 cloneNode(node.initializer)); | 915 cloneToken(node.equals), cloneNode(node.initializer)); |
910 | 916 |
911 @override | 917 @override |
912 VariableDeclarationList visitVariableDeclarationList( | 918 VariableDeclarationList visitVariableDeclarationList( |
913 VariableDeclarationList node) => | 919 VariableDeclarationList node) => |
914 new VariableDeclarationList( | 920 astFactory.variableDeclarationList( |
915 cloneNode(node.documentationComment), | 921 cloneNode(node.documentationComment), |
916 cloneNodeList(node.metadata), | 922 cloneNodeList(node.metadata), |
917 cloneToken(node.keyword), | 923 cloneToken(node.keyword), |
918 cloneNode(node.type), | 924 cloneNode(node.type), |
919 cloneNodeList(node.variables)); | 925 cloneNodeList(node.variables)); |
920 | 926 |
921 @override | 927 @override |
922 VariableDeclarationStatement visitVariableDeclarationStatement( | 928 VariableDeclarationStatement visitVariableDeclarationStatement( |
923 VariableDeclarationStatement node) => | 929 VariableDeclarationStatement node) => |
924 new VariableDeclarationStatement( | 930 astFactory.variableDeclarationStatement( |
925 cloneNode(node.variables), cloneToken(node.semicolon)); | 931 cloneNode(node.variables), cloneToken(node.semicolon)); |
926 | 932 |
927 @override | 933 @override |
928 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( | 934 WhileStatement visitWhileStatement(WhileStatement node) => |
929 cloneToken(node.whileKeyword), | 935 astFactory.whileStatement( |
930 cloneToken(node.leftParenthesis), | 936 cloneToken(node.whileKeyword), |
931 cloneNode(node.condition), | 937 cloneToken(node.leftParenthesis), |
932 cloneToken(node.rightParenthesis), | 938 cloneNode(node.condition), |
933 cloneNode(node.body)); | 939 cloneToken(node.rightParenthesis), |
| 940 cloneNode(node.body)); |
934 | 941 |
935 @override | 942 @override |
936 WithClause visitWithClause(WithClause node) => new WithClause( | 943 WithClause visitWithClause(WithClause node) => astFactory.withClause( |
937 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes)); | 944 cloneToken(node.withKeyword), cloneNodeList(node.mixinTypes)); |
938 | 945 |
939 @override | 946 @override |
940 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( | 947 YieldStatement visitYieldStatement(YieldStatement node) => |
941 cloneToken(node.yieldKeyword), | 948 astFactory.yieldStatement( |
942 cloneToken(node.star), | 949 cloneToken(node.yieldKeyword), |
943 cloneNode(node.expression), | 950 cloneToken(node.star), |
944 cloneToken(node.semicolon)); | 951 cloneNode(node.expression), |
| 952 cloneToken(node.semicolon)); |
945 | 953 |
946 /** | 954 /** |
947 * Clone all token starting from the given [token] up to a token that has | 955 * Clone all token starting from the given [token] up to a token that has |
948 * offset greater then [stopAfter], and put mapping from originals to clones | 956 * offset greater then [stopAfter], and put mapping from originals to clones |
949 * into [_clonedTokens]. | 957 * into [_clonedTokens]. |
950 * | 958 * |
951 * We cannot clone tokens as we visit nodes because not every token is a part | 959 * We cannot clone tokens as we visit nodes because not every token is a part |
952 * of a node, E.g. commas in argument lists are not represented in AST. But | 960 * of a node, E.g. commas in argument lists are not represented in AST. But |
953 * we need to the sequence of tokens that is identical to the original one. | 961 * we need to the sequence of tokens that is identical to the original one. |
954 */ | 962 */ |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 | 2756 |
2749 /** | 2757 /** |
2750 * Construct a new instance that will replace the [oldNode] with the [newNode] | 2758 * Construct a new instance that will replace the [oldNode] with the [newNode] |
2751 * in the process of cloning an existing AST structure. The [tokenMap] is a | 2759 * in the process of cloning an existing AST structure. The [tokenMap] is a |
2752 * mapping of old tokens to new tokens. | 2760 * mapping of old tokens to new tokens. |
2753 */ | 2761 */ |
2754 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); | 2762 IncrementalAstCloner(this._oldNode, this._newNode, this._tokenMap); |
2755 | 2763 |
2756 @override | 2764 @override |
2757 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => | 2765 AdjacentStrings visitAdjacentStrings(AdjacentStrings node) => |
2758 new AdjacentStrings(_cloneNodeList(node.strings)); | 2766 astFactory.adjacentStrings(_cloneNodeList(node.strings)); |
2759 | 2767 |
2760 @override | 2768 @override |
2761 Annotation visitAnnotation(Annotation node) { | 2769 Annotation visitAnnotation(Annotation node) { |
2762 Annotation copy = new Annotation( | 2770 Annotation copy = astFactory.annotation( |
2763 _mapToken(node.atSign), | 2771 _mapToken(node.atSign), |
2764 _cloneNode(node.name), | 2772 _cloneNode(node.name), |
2765 _mapToken(node.period), | 2773 _mapToken(node.period), |
2766 _cloneNode(node.constructorName), | 2774 _cloneNode(node.constructorName), |
2767 _cloneNode(node.arguments)); | 2775 _cloneNode(node.arguments)); |
2768 copy.element = node.element; | 2776 copy.element = node.element; |
2769 return copy; | 2777 return copy; |
2770 } | 2778 } |
2771 | 2779 |
2772 @override | 2780 @override |
2773 ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList( | 2781 ArgumentList visitArgumentList(ArgumentList node) => astFactory.argumentList( |
2774 _mapToken(node.leftParenthesis), | 2782 _mapToken(node.leftParenthesis), |
2775 _cloneNodeList(node.arguments), | 2783 _cloneNodeList(node.arguments), |
2776 _mapToken(node.rightParenthesis)); | 2784 _mapToken(node.rightParenthesis)); |
2777 | 2785 |
2778 @override | 2786 @override |
2779 AsExpression visitAsExpression(AsExpression node) { | 2787 AsExpression visitAsExpression(AsExpression node) { |
2780 AsExpression copy = new AsExpression(_cloneNode(node.expression), | 2788 AsExpression copy = astFactory.asExpression(_cloneNode(node.expression), |
2781 _mapToken(node.asOperator), _cloneNode(node.type)); | 2789 _mapToken(node.asOperator), _cloneNode(node.type)); |
2782 copy.propagatedType = node.propagatedType; | 2790 copy.propagatedType = node.propagatedType; |
2783 copy.staticType = node.staticType; | 2791 copy.staticType = node.staticType; |
2784 return copy; | 2792 return copy; |
2785 } | 2793 } |
2786 | 2794 |
2787 @override | 2795 @override |
2788 AstNode visitAssertInitializer(AssertInitializer node) => | 2796 AstNode visitAssertInitializer(AssertInitializer node) => |
2789 new AssertInitializer( | 2797 astFactory.assertInitializer( |
2790 _mapToken(node.assertKeyword), | 2798 _mapToken(node.assertKeyword), |
2791 _mapToken(node.leftParenthesis), | 2799 _mapToken(node.leftParenthesis), |
2792 _cloneNode(node.condition), | 2800 _cloneNode(node.condition), |
2793 _mapToken(node.comma), | 2801 _mapToken(node.comma), |
2794 _cloneNode(node.message), | 2802 _cloneNode(node.message), |
2795 _mapToken(node.rightParenthesis)); | 2803 _mapToken(node.rightParenthesis)); |
2796 | 2804 |
2797 @override | 2805 @override |
2798 AstNode visitAssertStatement(AssertStatement node) => new AssertStatement( | 2806 AstNode visitAssertStatement(AssertStatement node) => |
2799 _mapToken(node.assertKeyword), | 2807 astFactory.assertStatement( |
2800 _mapToken(node.leftParenthesis), | 2808 _mapToken(node.assertKeyword), |
2801 _cloneNode(node.condition), | 2809 _mapToken(node.leftParenthesis), |
2802 _mapToken(node.comma), | 2810 _cloneNode(node.condition), |
2803 _cloneNode(node.message), | 2811 _mapToken(node.comma), |
2804 _mapToken(node.rightParenthesis), | 2812 _cloneNode(node.message), |
2805 _mapToken(node.semicolon)); | 2813 _mapToken(node.rightParenthesis), |
| 2814 _mapToken(node.semicolon)); |
2806 | 2815 |
2807 @override | 2816 @override |
2808 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { | 2817 AssignmentExpression visitAssignmentExpression(AssignmentExpression node) { |
2809 AssignmentExpression copy = new AssignmentExpression( | 2818 AssignmentExpression copy = astFactory.assignmentExpression( |
2810 _cloneNode(node.leftHandSide), | 2819 _cloneNode(node.leftHandSide), |
2811 _mapToken(node.operator), | 2820 _mapToken(node.operator), |
2812 _cloneNode(node.rightHandSide)); | 2821 _cloneNode(node.rightHandSide)); |
2813 copy.propagatedElement = node.propagatedElement; | 2822 copy.propagatedElement = node.propagatedElement; |
2814 copy.propagatedType = node.propagatedType; | 2823 copy.propagatedType = node.propagatedType; |
2815 copy.staticElement = node.staticElement; | 2824 copy.staticElement = node.staticElement; |
2816 copy.staticType = node.staticType; | 2825 copy.staticType = node.staticType; |
2817 return copy; | 2826 return copy; |
2818 } | 2827 } |
2819 | 2828 |
2820 @override | 2829 @override |
2821 AwaitExpression visitAwaitExpression(AwaitExpression node) => | 2830 AwaitExpression visitAwaitExpression(AwaitExpression node) => |
2822 new AwaitExpression( | 2831 astFactory.awaitExpression( |
2823 _mapToken(node.awaitKeyword), _cloneNode(node.expression)); | 2832 _mapToken(node.awaitKeyword), _cloneNode(node.expression)); |
2824 | 2833 |
2825 @override | 2834 @override |
2826 BinaryExpression visitBinaryExpression(BinaryExpression node) { | 2835 BinaryExpression visitBinaryExpression(BinaryExpression node) { |
2827 BinaryExpression copy = new BinaryExpression(_cloneNode(node.leftOperand), | 2836 BinaryExpression copy = astFactory.binaryExpression( |
2828 _mapToken(node.operator), _cloneNode(node.rightOperand)); | 2837 _cloneNode(node.leftOperand), |
| 2838 _mapToken(node.operator), |
| 2839 _cloneNode(node.rightOperand)); |
2829 copy.propagatedElement = node.propagatedElement; | 2840 copy.propagatedElement = node.propagatedElement; |
2830 copy.propagatedType = node.propagatedType; | 2841 copy.propagatedType = node.propagatedType; |
2831 copy.staticElement = node.staticElement; | 2842 copy.staticElement = node.staticElement; |
2832 copy.staticType = node.staticType; | 2843 copy.staticType = node.staticType; |
2833 return copy; | 2844 return copy; |
2834 } | 2845 } |
2835 | 2846 |
2836 @override | 2847 @override |
2837 Block visitBlock(Block node) => new Block(_mapToken(node.leftBracket), | 2848 Block visitBlock(Block node) => astFactory.block(_mapToken(node.leftBracket), |
2838 _cloneNodeList(node.statements), _mapToken(node.rightBracket)); | 2849 _cloneNodeList(node.statements), _mapToken(node.rightBracket)); |
2839 | 2850 |
2840 @override | 2851 @override |
2841 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => | 2852 BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) => |
2842 new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star), | 2853 astFactory.blockFunctionBody(_mapToken(node.keyword), |
2843 _cloneNode(node.block)); | 2854 _mapToken(node.star), _cloneNode(node.block)); |
2844 | 2855 |
2845 @override | 2856 @override |
2846 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { | 2857 BooleanLiteral visitBooleanLiteral(BooleanLiteral node) { |
2847 BooleanLiteral copy = | 2858 BooleanLiteral copy = |
2848 new BooleanLiteral(_mapToken(node.literal), node.value); | 2859 astFactory.booleanLiteral(_mapToken(node.literal), node.value); |
2849 copy.propagatedType = node.propagatedType; | 2860 copy.propagatedType = node.propagatedType; |
2850 copy.staticType = node.staticType; | 2861 copy.staticType = node.staticType; |
2851 return copy; | 2862 return copy; |
2852 } | 2863 } |
2853 | 2864 |
2854 @override | 2865 @override |
2855 BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement( | 2866 BreakStatement visitBreakStatement(BreakStatement node) => |
2856 _mapToken(node.breakKeyword), | 2867 astFactory.breakStatement(_mapToken(node.breakKeyword), |
2857 _cloneNode(node.label), | 2868 _cloneNode(node.label), _mapToken(node.semicolon)); |
2858 _mapToken(node.semicolon)); | |
2859 | 2869 |
2860 @override | 2870 @override |
2861 CascadeExpression visitCascadeExpression(CascadeExpression node) { | 2871 CascadeExpression visitCascadeExpression(CascadeExpression node) { |
2862 CascadeExpression copy = new CascadeExpression( | 2872 CascadeExpression copy = astFactory.cascadeExpression( |
2863 _cloneNode(node.target), _cloneNodeList(node.cascadeSections)); | 2873 _cloneNode(node.target), _cloneNodeList(node.cascadeSections)); |
2864 copy.propagatedType = node.propagatedType; | 2874 copy.propagatedType = node.propagatedType; |
2865 copy.staticType = node.staticType; | 2875 copy.staticType = node.staticType; |
2866 return copy; | 2876 return copy; |
2867 } | 2877 } |
2868 | 2878 |
2869 @override | 2879 @override |
2870 CatchClause visitCatchClause(CatchClause node) => new CatchClause( | 2880 CatchClause visitCatchClause(CatchClause node) => astFactory.catchClause( |
2871 _mapToken(node.onKeyword), | 2881 _mapToken(node.onKeyword), |
2872 _cloneNode(node.exceptionType), | 2882 _cloneNode(node.exceptionType), |
2873 _mapToken(node.catchKeyword), | 2883 _mapToken(node.catchKeyword), |
2874 _mapToken(node.leftParenthesis), | 2884 _mapToken(node.leftParenthesis), |
2875 _cloneNode(node.exceptionParameter), | 2885 _cloneNode(node.exceptionParameter), |
2876 _mapToken(node.comma), | 2886 _mapToken(node.comma), |
2877 _cloneNode(node.stackTraceParameter), | 2887 _cloneNode(node.stackTraceParameter), |
2878 _mapToken(node.rightParenthesis), | 2888 _mapToken(node.rightParenthesis), |
2879 _cloneNode(node.body)); | 2889 _cloneNode(node.body)); |
2880 | 2890 |
2881 @override | 2891 @override |
2882 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { | 2892 ClassDeclaration visitClassDeclaration(ClassDeclaration node) { |
2883 ClassDeclaration copy = new ClassDeclaration( | 2893 ClassDeclaration copy = astFactory.classDeclaration( |
2884 _cloneNode(node.documentationComment), | 2894 _cloneNode(node.documentationComment), |
2885 _cloneNodeList(node.metadata), | 2895 _cloneNodeList(node.metadata), |
2886 _mapToken(node.abstractKeyword), | 2896 _mapToken(node.abstractKeyword), |
2887 _mapToken(node.classKeyword), | 2897 _mapToken(node.classKeyword), |
2888 _cloneNode(node.name), | 2898 _cloneNode(node.name), |
2889 _cloneNode(node.typeParameters), | 2899 _cloneNode(node.typeParameters), |
2890 _cloneNode(node.extendsClause), | 2900 _cloneNode(node.extendsClause), |
2891 _cloneNode(node.withClause), | 2901 _cloneNode(node.withClause), |
2892 _cloneNode(node.implementsClause), | 2902 _cloneNode(node.implementsClause), |
2893 _mapToken(node.leftBracket), | 2903 _mapToken(node.leftBracket), |
2894 _cloneNodeList(node.members), | 2904 _cloneNodeList(node.members), |
2895 _mapToken(node.rightBracket)); | 2905 _mapToken(node.rightBracket)); |
2896 copy.nativeClause = _cloneNode(node.nativeClause); | 2906 copy.nativeClause = _cloneNode(node.nativeClause); |
2897 return copy; | 2907 return copy; |
2898 } | 2908 } |
2899 | 2909 |
2900 @override | 2910 @override |
2901 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias( | 2911 ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => |
2902 _cloneNode(node.documentationComment), | 2912 astFactory.classTypeAlias( |
2903 _cloneNodeList(node.metadata), | 2913 _cloneNode(node.documentationComment), |
2904 _mapToken(node.typedefKeyword), | 2914 _cloneNodeList(node.metadata), |
2905 _cloneNode(node.name), | 2915 _mapToken(node.typedefKeyword), |
2906 _cloneNode(node.typeParameters), | 2916 _cloneNode(node.name), |
2907 _mapToken(node.equals), | 2917 _cloneNode(node.typeParameters), |
2908 _mapToken(node.abstractKeyword), | 2918 _mapToken(node.equals), |
2909 _cloneNode(node.superclass), | 2919 _mapToken(node.abstractKeyword), |
2910 _cloneNode(node.withClause), | 2920 _cloneNode(node.superclass), |
2911 _cloneNode(node.implementsClause), | 2921 _cloneNode(node.withClause), |
2912 _mapToken(node.semicolon)); | 2922 _cloneNode(node.implementsClause), |
| 2923 _mapToken(node.semicolon)); |
2913 | 2924 |
2914 @override | 2925 @override |
2915 Comment visitComment(Comment node) { | 2926 Comment visitComment(Comment node) { |
2916 if (node.isDocumentation) { | 2927 if (node.isDocumentation) { |
2917 return Comment.createDocumentationCommentWithReferences( | 2928 return astFactory.documentationComment( |
2918 _mapTokens(node.tokens), _cloneNodeList(node.references)); | 2929 _mapTokens(node.tokens), _cloneNodeList(node.references)); |
2919 } else if (node.isBlock) { | 2930 } else if (node.isBlock) { |
2920 return Comment.createBlockComment(_mapTokens(node.tokens)); | 2931 return astFactory.blockComment(_mapTokens(node.tokens)); |
2921 } | 2932 } |
2922 return Comment.createEndOfLineComment(_mapTokens(node.tokens)); | 2933 return astFactory.endOfLineComment(_mapTokens(node.tokens)); |
2923 } | 2934 } |
2924 | 2935 |
2925 @override | 2936 @override |
2926 CommentReference visitCommentReference(CommentReference node) => | 2937 CommentReference visitCommentReference(CommentReference node) => |
2927 new CommentReference( | 2938 astFactory.commentReference( |
2928 _mapToken(node.newKeyword), _cloneNode(node.identifier)); | 2939 _mapToken(node.newKeyword), _cloneNode(node.identifier)); |
2929 | 2940 |
2930 @override | 2941 @override |
2931 CompilationUnit visitCompilationUnit(CompilationUnit node) { | 2942 CompilationUnit visitCompilationUnit(CompilationUnit node) { |
2932 CompilationUnit copy = new CompilationUnit( | 2943 CompilationUnit copy = astFactory.compilationUnit( |
2933 _mapToken(node.beginToken), | 2944 _mapToken(node.beginToken), |
2934 _cloneNode(node.scriptTag), | 2945 _cloneNode(node.scriptTag), |
2935 _cloneNodeList(node.directives), | 2946 _cloneNodeList(node.directives), |
2936 _cloneNodeList(node.declarations), | 2947 _cloneNodeList(node.declarations), |
2937 _mapToken(node.endToken)); | 2948 _mapToken(node.endToken)); |
2938 copy.lineInfo = node.lineInfo; | 2949 copy.lineInfo = node.lineInfo; |
2939 copy.element = node.element; | 2950 copy.element = node.element; |
2940 return copy; | 2951 return copy; |
2941 } | 2952 } |
2942 | 2953 |
2943 @override | 2954 @override |
2944 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { | 2955 ConditionalExpression visitConditionalExpression(ConditionalExpression node) { |
2945 ConditionalExpression copy = new ConditionalExpression( | 2956 ConditionalExpression copy = astFactory.conditionalExpression( |
2946 _cloneNode(node.condition), | 2957 _cloneNode(node.condition), |
2947 _mapToken(node.question), | 2958 _mapToken(node.question), |
2948 _cloneNode(node.thenExpression), | 2959 _cloneNode(node.thenExpression), |
2949 _mapToken(node.colon), | 2960 _mapToken(node.colon), |
2950 _cloneNode(node.elseExpression)); | 2961 _cloneNode(node.elseExpression)); |
2951 copy.propagatedType = node.propagatedType; | 2962 copy.propagatedType = node.propagatedType; |
2952 copy.staticType = node.staticType; | 2963 copy.staticType = node.staticType; |
2953 return copy; | 2964 return copy; |
2954 } | 2965 } |
2955 | 2966 |
2956 @override | 2967 @override |
2957 Configuration visitConfiguration(Configuration node) => new Configuration( | 2968 Configuration visitConfiguration(Configuration node) => |
2958 _mapToken(node.ifKeyword), | 2969 astFactory.configuration( |
2959 _mapToken(node.leftParenthesis), | 2970 _mapToken(node.ifKeyword), |
2960 _cloneNode(node.name), | 2971 _mapToken(node.leftParenthesis), |
2961 _mapToken(node.equalToken), | 2972 _cloneNode(node.name), |
2962 _cloneNode(node.value), | 2973 _mapToken(node.equalToken), |
2963 _mapToken(node.rightParenthesis), | 2974 _cloneNode(node.value), |
2964 _cloneNode(node.uri)); | 2975 _mapToken(node.rightParenthesis), |
| 2976 _cloneNode(node.uri)); |
2965 | 2977 |
2966 @override | 2978 @override |
2967 ConstructorDeclaration visitConstructorDeclaration( | 2979 ConstructorDeclaration visitConstructorDeclaration( |
2968 ConstructorDeclaration node) { | 2980 ConstructorDeclaration node) { |
2969 ConstructorDeclaration copy = new ConstructorDeclaration( | 2981 ConstructorDeclaration copy = astFactory.constructorDeclaration( |
2970 _cloneNode(node.documentationComment), | 2982 _cloneNode(node.documentationComment), |
2971 _cloneNodeList(node.metadata), | 2983 _cloneNodeList(node.metadata), |
2972 _mapToken(node.externalKeyword), | 2984 _mapToken(node.externalKeyword), |
2973 _mapToken(node.constKeyword), | 2985 _mapToken(node.constKeyword), |
2974 _mapToken(node.factoryKeyword), | 2986 _mapToken(node.factoryKeyword), |
2975 _cloneNode(node.returnType), | 2987 _cloneNode(node.returnType), |
2976 _mapToken(node.period), | 2988 _mapToken(node.period), |
2977 _cloneNode(node.name), | 2989 _cloneNode(node.name), |
2978 _cloneNode(node.parameters), | 2990 _cloneNode(node.parameters), |
2979 _mapToken(node.separator), | 2991 _mapToken(node.separator), |
2980 _cloneNodeList(node.initializers), | 2992 _cloneNodeList(node.initializers), |
2981 _cloneNode(node.redirectedConstructor), | 2993 _cloneNode(node.redirectedConstructor), |
2982 _cloneNode(node.body)); | 2994 _cloneNode(node.body)); |
2983 copy.element = node.element; | 2995 copy.element = node.element; |
2984 return copy; | 2996 return copy; |
2985 } | 2997 } |
2986 | 2998 |
2987 @override | 2999 @override |
2988 ConstructorFieldInitializer visitConstructorFieldInitializer( | 3000 ConstructorFieldInitializer visitConstructorFieldInitializer( |
2989 ConstructorFieldInitializer node) => | 3001 ConstructorFieldInitializer node) => |
2990 new ConstructorFieldInitializer( | 3002 astFactory.constructorFieldInitializer( |
2991 _mapToken(node.thisKeyword), | 3003 _mapToken(node.thisKeyword), |
2992 _mapToken(node.period), | 3004 _mapToken(node.period), |
2993 _cloneNode(node.fieldName), | 3005 _cloneNode(node.fieldName), |
2994 _mapToken(node.equals), | 3006 _mapToken(node.equals), |
2995 _cloneNode(node.expression)); | 3007 _cloneNode(node.expression)); |
2996 | 3008 |
2997 @override | 3009 @override |
2998 ConstructorName visitConstructorName(ConstructorName node) { | 3010 ConstructorName visitConstructorName(ConstructorName node) { |
2999 ConstructorName copy = new ConstructorName( | 3011 ConstructorName copy = astFactory.constructorName( |
3000 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name)); | 3012 _cloneNode(node.type), _mapToken(node.period), _cloneNode(node.name)); |
3001 copy.staticElement = node.staticElement; | 3013 copy.staticElement = node.staticElement; |
3002 return copy; | 3014 return copy; |
3003 } | 3015 } |
3004 | 3016 |
3005 @override | 3017 @override |
3006 ContinueStatement visitContinueStatement(ContinueStatement node) => | 3018 ContinueStatement visitContinueStatement(ContinueStatement node) => |
3007 new ContinueStatement(_mapToken(node.continueKeyword), | 3019 astFactory.continueStatement(_mapToken(node.continueKeyword), |
3008 _cloneNode(node.label), _mapToken(node.semicolon)); | 3020 _cloneNode(node.label), _mapToken(node.semicolon)); |
3009 | 3021 |
3010 @override | 3022 @override |
3011 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => | 3023 DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) => |
3012 new DeclaredIdentifier( | 3024 astFactory.declaredIdentifier( |
3013 _cloneNode(node.documentationComment), | 3025 _cloneNode(node.documentationComment), |
3014 _cloneNodeList(node.metadata), | 3026 _cloneNodeList(node.metadata), |
3015 _mapToken(node.keyword), | 3027 _mapToken(node.keyword), |
3016 _cloneNode(node.type), | 3028 _cloneNode(node.type), |
3017 _cloneNode(node.identifier)); | 3029 _cloneNode(node.identifier)); |
3018 | 3030 |
3019 @override | 3031 @override |
3020 DefaultFormalParameter visitDefaultFormalParameter( | 3032 DefaultFormalParameter visitDefaultFormalParameter( |
3021 DefaultFormalParameter node) => | 3033 DefaultFormalParameter node) => |
3022 new DefaultFormalParameter(_cloneNode(node.parameter), node.kind, | 3034 astFactory.defaultFormalParameter(_cloneNode(node.parameter), node.kind, |
3023 _mapToken(node.separator), _cloneNode(node.defaultValue)); | 3035 _mapToken(node.separator), _cloneNode(node.defaultValue)); |
3024 | 3036 |
3025 @override | 3037 @override |
3026 DoStatement visitDoStatement(DoStatement node) => new DoStatement( | 3038 DoStatement visitDoStatement(DoStatement node) => astFactory.doStatement( |
3027 _mapToken(node.doKeyword), | 3039 _mapToken(node.doKeyword), |
3028 _cloneNode(node.body), | 3040 _cloneNode(node.body), |
3029 _mapToken(node.whileKeyword), | 3041 _mapToken(node.whileKeyword), |
3030 _mapToken(node.leftParenthesis), | 3042 _mapToken(node.leftParenthesis), |
3031 _cloneNode(node.condition), | 3043 _cloneNode(node.condition), |
3032 _mapToken(node.rightParenthesis), | 3044 _mapToken(node.rightParenthesis), |
3033 _mapToken(node.semicolon)); | 3045 _mapToken(node.semicolon)); |
3034 | 3046 |
3035 @override | 3047 @override |
3036 DottedName visitDottedName(DottedName node) => | 3048 DottedName visitDottedName(DottedName node) => |
3037 new DottedName(_cloneNodeList(node.components)); | 3049 astFactory.dottedName(_cloneNodeList(node.components)); |
3038 | 3050 |
3039 @override | 3051 @override |
3040 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { | 3052 DoubleLiteral visitDoubleLiteral(DoubleLiteral node) { |
3041 DoubleLiteral copy = new DoubleLiteral(_mapToken(node.literal), node.value); | 3053 DoubleLiteral copy = |
| 3054 astFactory.doubleLiteral(_mapToken(node.literal), node.value); |
3042 copy.propagatedType = node.propagatedType; | 3055 copy.propagatedType = node.propagatedType; |
3043 copy.staticType = node.staticType; | 3056 copy.staticType = node.staticType; |
3044 return copy; | 3057 return copy; |
3045 } | 3058 } |
3046 | 3059 |
3047 @override | 3060 @override |
3048 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => | 3061 EmptyFunctionBody visitEmptyFunctionBody(EmptyFunctionBody node) => |
3049 new EmptyFunctionBody(_mapToken(node.semicolon)); | 3062 astFactory.emptyFunctionBody(_mapToken(node.semicolon)); |
3050 | 3063 |
3051 @override | 3064 @override |
3052 EmptyStatement visitEmptyStatement(EmptyStatement node) => | 3065 EmptyStatement visitEmptyStatement(EmptyStatement node) => |
3053 new EmptyStatement(_mapToken(node.semicolon)); | 3066 astFactory.emptyStatement(_mapToken(node.semicolon)); |
3054 | 3067 |
3055 @override | 3068 @override |
3056 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => | 3069 AstNode visitEnumConstantDeclaration(EnumConstantDeclaration node) => |
3057 new EnumConstantDeclaration(_cloneNode(node.documentationComment), | 3070 astFactory.enumConstantDeclaration(_cloneNode(node.documentationComment), |
3058 _cloneNodeList(node.metadata), _cloneNode(node.name)); | 3071 _cloneNodeList(node.metadata), _cloneNode(node.name)); |
3059 | 3072 |
3060 @override | 3073 @override |
3061 AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration( | 3074 AstNode visitEnumDeclaration(EnumDeclaration node) => |
3062 _cloneNode(node.documentationComment), | 3075 astFactory.enumDeclaration( |
3063 _cloneNodeList(node.metadata), | 3076 _cloneNode(node.documentationComment), |
3064 _mapToken(node.enumKeyword), | 3077 _cloneNodeList(node.metadata), |
3065 _cloneNode(node.name), | 3078 _mapToken(node.enumKeyword), |
3066 _mapToken(node.leftBracket), | 3079 _cloneNode(node.name), |
3067 _cloneNodeList(node.constants), | 3080 _mapToken(node.leftBracket), |
3068 _mapToken(node.rightBracket)); | 3081 _cloneNodeList(node.constants), |
| 3082 _mapToken(node.rightBracket)); |
3069 | 3083 |
3070 @override | 3084 @override |
3071 ExportDirective visitExportDirective(ExportDirective node) { | 3085 ExportDirective visitExportDirective(ExportDirective node) { |
3072 ExportDirective copy = new ExportDirective( | 3086 ExportDirective copy = astFactory.exportDirective( |
3073 _cloneNode(node.documentationComment), | 3087 _cloneNode(node.documentationComment), |
3074 _cloneNodeList(node.metadata), | 3088 _cloneNodeList(node.metadata), |
3075 _mapToken(node.keyword), | 3089 _mapToken(node.keyword), |
3076 _cloneNode(node.uri), | 3090 _cloneNode(node.uri), |
3077 _cloneNodeList(node.configurations), | 3091 _cloneNodeList(node.configurations), |
3078 _cloneNodeList(node.combinators), | 3092 _cloneNodeList(node.combinators), |
3079 _mapToken(node.semicolon)); | 3093 _mapToken(node.semicolon)); |
3080 copy.element = node.element; | 3094 copy.element = node.element; |
3081 return copy; | 3095 return copy; |
3082 } | 3096 } |
3083 | 3097 |
3084 @override | 3098 @override |
3085 ExpressionFunctionBody visitExpressionFunctionBody( | 3099 ExpressionFunctionBody visitExpressionFunctionBody( |
3086 ExpressionFunctionBody node) => | 3100 ExpressionFunctionBody node) => |
3087 new ExpressionFunctionBody( | 3101 astFactory.expressionFunctionBody( |
3088 _mapToken(node.keyword), | 3102 _mapToken(node.keyword), |
3089 _mapToken(node.functionDefinition), | 3103 _mapToken(node.functionDefinition), |
3090 _cloneNode(node.expression), | 3104 _cloneNode(node.expression), |
3091 _mapToken(node.semicolon)); | 3105 _mapToken(node.semicolon)); |
3092 | 3106 |
3093 @override | 3107 @override |
3094 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => | 3108 ExpressionStatement visitExpressionStatement(ExpressionStatement node) => |
3095 new ExpressionStatement( | 3109 astFactory.expressionStatement( |
3096 _cloneNode(node.expression), _mapToken(node.semicolon)); | 3110 _cloneNode(node.expression), _mapToken(node.semicolon)); |
3097 | 3111 |
3098 @override | 3112 @override |
3099 ExtendsClause visitExtendsClause(ExtendsClause node) => new ExtendsClause( | 3113 ExtendsClause visitExtendsClause(ExtendsClause node) => |
3100 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); | 3114 astFactory.extendsClause( |
| 3115 _mapToken(node.extendsKeyword), _cloneNode(node.superclass)); |
3101 | 3116 |
3102 @override | 3117 @override |
3103 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => | 3118 FieldDeclaration visitFieldDeclaration(FieldDeclaration node) => |
3104 new FieldDeclaration( | 3119 astFactory.fieldDeclaration( |
3105 _cloneNode(node.documentationComment), | 3120 _cloneNode(node.documentationComment), |
3106 _cloneNodeList(node.metadata), | 3121 _cloneNodeList(node.metadata), |
3107 _mapToken(node.staticKeyword), | 3122 _mapToken(node.staticKeyword), |
3108 _cloneNode(node.fields), | 3123 _cloneNode(node.fields), |
3109 _mapToken(node.semicolon)); | 3124 _mapToken(node.semicolon)); |
3110 | 3125 |
3111 @override | 3126 @override |
3112 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => | 3127 FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) => |
3113 new FieldFormalParameter( | 3128 astFactory.fieldFormalParameter( |
3114 _cloneNode(node.documentationComment), | 3129 _cloneNode(node.documentationComment), |
3115 _cloneNodeList(node.metadata), | 3130 _cloneNodeList(node.metadata), |
3116 _mapToken(node.keyword), | 3131 _mapToken(node.keyword), |
3117 _cloneNode(node.type), | 3132 _cloneNode(node.type), |
3118 _mapToken(node.thisKeyword), | 3133 _mapToken(node.thisKeyword), |
3119 _mapToken(node.period), | 3134 _mapToken(node.period), |
3120 _cloneNode(node.identifier), | 3135 _cloneNode(node.identifier), |
3121 _cloneNode(node.typeParameters), | 3136 _cloneNode(node.typeParameters), |
3122 _cloneNode(node.parameters)); | 3137 _cloneNode(node.parameters)); |
3123 | 3138 |
3124 @override | 3139 @override |
3125 ForEachStatement visitForEachStatement(ForEachStatement node) { | 3140 ForEachStatement visitForEachStatement(ForEachStatement node) { |
3126 DeclaredIdentifier loopVariable = node.loopVariable; | 3141 DeclaredIdentifier loopVariable = node.loopVariable; |
3127 if (loopVariable == null) { | 3142 if (loopVariable == null) { |
3128 return new ForEachStatement.withReference( | 3143 return astFactory.forEachStatementWithReference( |
3129 _mapToken(node.awaitKeyword), | 3144 _mapToken(node.awaitKeyword), |
3130 _mapToken(node.forKeyword), | 3145 _mapToken(node.forKeyword), |
3131 _mapToken(node.leftParenthesis), | 3146 _mapToken(node.leftParenthesis), |
3132 _cloneNode(node.identifier), | 3147 _cloneNode(node.identifier), |
3133 _mapToken(node.inKeyword), | 3148 _mapToken(node.inKeyword), |
3134 _cloneNode(node.iterable), | 3149 _cloneNode(node.iterable), |
3135 _mapToken(node.rightParenthesis), | 3150 _mapToken(node.rightParenthesis), |
3136 _cloneNode(node.body)); | 3151 _cloneNode(node.body)); |
3137 } | 3152 } |
3138 return new ForEachStatement.withDeclaration( | 3153 return astFactory.forEachStatementWithDeclaration( |
3139 _mapToken(node.awaitKeyword), | 3154 _mapToken(node.awaitKeyword), |
3140 _mapToken(node.forKeyword), | 3155 _mapToken(node.forKeyword), |
3141 _mapToken(node.leftParenthesis), | 3156 _mapToken(node.leftParenthesis), |
3142 _cloneNode(loopVariable), | 3157 _cloneNode(loopVariable), |
3143 _mapToken(node.inKeyword), | 3158 _mapToken(node.inKeyword), |
3144 _cloneNode(node.iterable), | 3159 _cloneNode(node.iterable), |
3145 _mapToken(node.rightParenthesis), | 3160 _mapToken(node.rightParenthesis), |
3146 _cloneNode(node.body)); | 3161 _cloneNode(node.body)); |
3147 } | 3162 } |
3148 | 3163 |
3149 @override | 3164 @override |
3150 FormalParameterList visitFormalParameterList(FormalParameterList node) => | 3165 FormalParameterList visitFormalParameterList(FormalParameterList node) => |
3151 new FormalParameterList( | 3166 astFactory.formalParameterList( |
3152 _mapToken(node.leftParenthesis), | 3167 _mapToken(node.leftParenthesis), |
3153 _cloneNodeList(node.parameters), | 3168 _cloneNodeList(node.parameters), |
3154 _mapToken(node.leftDelimiter), | 3169 _mapToken(node.leftDelimiter), |
3155 _mapToken(node.rightDelimiter), | 3170 _mapToken(node.rightDelimiter), |
3156 _mapToken(node.rightParenthesis)); | 3171 _mapToken(node.rightParenthesis)); |
3157 | 3172 |
3158 @override | 3173 @override |
3159 ForStatement visitForStatement(ForStatement node) => new ForStatement( | 3174 ForStatement visitForStatement(ForStatement node) => astFactory.forStatement( |
3160 _mapToken(node.forKeyword), | 3175 _mapToken(node.forKeyword), |
3161 _mapToken(node.leftParenthesis), | 3176 _mapToken(node.leftParenthesis), |
3162 _cloneNode(node.variables), | 3177 _cloneNode(node.variables), |
3163 _cloneNode(node.initialization), | 3178 _cloneNode(node.initialization), |
3164 _mapToken(node.leftSeparator), | 3179 _mapToken(node.leftSeparator), |
3165 _cloneNode(node.condition), | 3180 _cloneNode(node.condition), |
3166 _mapToken(node.rightSeparator), | 3181 _mapToken(node.rightSeparator), |
3167 _cloneNodeList(node.updaters), | 3182 _cloneNodeList(node.updaters), |
3168 _mapToken(node.rightParenthesis), | 3183 _mapToken(node.rightParenthesis), |
3169 _cloneNode(node.body)); | 3184 _cloneNode(node.body)); |
3170 | 3185 |
3171 @override | 3186 @override |
3172 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => | 3187 FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) => |
3173 new FunctionDeclaration( | 3188 astFactory.functionDeclaration( |
3174 _cloneNode(node.documentationComment), | 3189 _cloneNode(node.documentationComment), |
3175 _cloneNodeList(node.metadata), | 3190 _cloneNodeList(node.metadata), |
3176 _mapToken(node.externalKeyword), | 3191 _mapToken(node.externalKeyword), |
3177 _cloneNode(node.returnType), | 3192 _cloneNode(node.returnType), |
3178 _mapToken(node.propertyKeyword), | 3193 _mapToken(node.propertyKeyword), |
3179 _cloneNode(node.name), | 3194 _cloneNode(node.name), |
3180 _cloneNode(node.functionExpression)); | 3195 _cloneNode(node.functionExpression)); |
3181 | 3196 |
3182 @override | 3197 @override |
3183 FunctionDeclarationStatement visitFunctionDeclarationStatement( | 3198 FunctionDeclarationStatement visitFunctionDeclarationStatement( |
3184 FunctionDeclarationStatement node) => | 3199 FunctionDeclarationStatement node) => |
3185 new FunctionDeclarationStatement(_cloneNode(node.functionDeclaration)); | 3200 astFactory |
| 3201 .functionDeclarationStatement(_cloneNode(node.functionDeclaration)); |
3186 | 3202 |
3187 @override | 3203 @override |
3188 FunctionExpression visitFunctionExpression(FunctionExpression node) { | 3204 FunctionExpression visitFunctionExpression(FunctionExpression node) { |
3189 FunctionExpression copy = new FunctionExpression( | 3205 FunctionExpression copy = astFactory.functionExpression( |
3190 _cloneNode(node.typeParameters), | 3206 _cloneNode(node.typeParameters), |
3191 _cloneNode(node.parameters), | 3207 _cloneNode(node.parameters), |
3192 _cloneNode(node.body)); | 3208 _cloneNode(node.body)); |
3193 copy.element = node.element; | 3209 copy.element = node.element; |
3194 copy.propagatedType = node.propagatedType; | 3210 copy.propagatedType = node.propagatedType; |
3195 copy.staticType = node.staticType; | 3211 copy.staticType = node.staticType; |
3196 return copy; | 3212 return copy; |
3197 } | 3213 } |
3198 | 3214 |
3199 @override | 3215 @override |
3200 FunctionExpressionInvocation visitFunctionExpressionInvocation( | 3216 FunctionExpressionInvocation visitFunctionExpressionInvocation( |
3201 FunctionExpressionInvocation node) { | 3217 FunctionExpressionInvocation node) { |
3202 FunctionExpressionInvocation copy = new FunctionExpressionInvocation( | 3218 FunctionExpressionInvocation copy = astFactory.functionExpressionInvocation( |
3203 _cloneNode(node.function), | 3219 _cloneNode(node.function), |
3204 _cloneNode(node.typeArguments), | 3220 _cloneNode(node.typeArguments), |
3205 _cloneNode(node.argumentList)); | 3221 _cloneNode(node.argumentList)); |
3206 copy.propagatedElement = node.propagatedElement; | 3222 copy.propagatedElement = node.propagatedElement; |
3207 copy.propagatedType = node.propagatedType; | 3223 copy.propagatedType = node.propagatedType; |
3208 copy.staticElement = node.staticElement; | 3224 copy.staticElement = node.staticElement; |
3209 copy.staticType = node.staticType; | 3225 copy.staticType = node.staticType; |
3210 return copy; | 3226 return copy; |
3211 } | 3227 } |
3212 | 3228 |
3213 @override | 3229 @override |
3214 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => | 3230 FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) => |
3215 new FunctionTypeAlias( | 3231 astFactory.functionTypeAlias( |
3216 _cloneNode(node.documentationComment), | 3232 _cloneNode(node.documentationComment), |
3217 _cloneNodeList(node.metadata), | 3233 _cloneNodeList(node.metadata), |
3218 _mapToken(node.typedefKeyword), | 3234 _mapToken(node.typedefKeyword), |
3219 _cloneNode(node.returnType), | 3235 _cloneNode(node.returnType), |
3220 _cloneNode(node.name), | 3236 _cloneNode(node.name), |
3221 _cloneNode(node.typeParameters), | 3237 _cloneNode(node.typeParameters), |
3222 _cloneNode(node.parameters), | 3238 _cloneNode(node.parameters), |
3223 _mapToken(node.semicolon)); | 3239 _mapToken(node.semicolon)); |
3224 | 3240 |
3225 @override | 3241 @override |
3226 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( | 3242 FunctionTypedFormalParameter visitFunctionTypedFormalParameter( |
3227 FunctionTypedFormalParameter node) => | 3243 FunctionTypedFormalParameter node) => |
3228 new FunctionTypedFormalParameter( | 3244 astFactory.functionTypedFormalParameter( |
3229 _cloneNode(node.documentationComment), | 3245 _cloneNode(node.documentationComment), |
3230 _cloneNodeList(node.metadata), | 3246 _cloneNodeList(node.metadata), |
3231 _cloneNode(node.returnType), | 3247 _cloneNode(node.returnType), |
3232 _cloneNode(node.identifier), | 3248 _cloneNode(node.identifier), |
3233 _cloneNode(node.typeParameters), | 3249 _cloneNode(node.typeParameters), |
3234 _cloneNode(node.parameters)); | 3250 _cloneNode(node.parameters)); |
3235 | 3251 |
3236 @override | 3252 @override |
3237 HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator( | 3253 HideCombinator visitHideCombinator(HideCombinator node) => |
3238 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames)); | 3254 astFactory.hideCombinator( |
| 3255 _mapToken(node.keyword), _cloneNodeList(node.hiddenNames)); |
3239 | 3256 |
3240 @override | 3257 @override |
3241 IfStatement visitIfStatement(IfStatement node) => new IfStatement( | 3258 IfStatement visitIfStatement(IfStatement node) => astFactory.ifStatement( |
3242 _mapToken(node.ifKeyword), | 3259 _mapToken(node.ifKeyword), |
3243 _mapToken(node.leftParenthesis), | 3260 _mapToken(node.leftParenthesis), |
3244 _cloneNode(node.condition), | 3261 _cloneNode(node.condition), |
3245 _mapToken(node.rightParenthesis), | 3262 _mapToken(node.rightParenthesis), |
3246 _cloneNode(node.thenStatement), | 3263 _cloneNode(node.thenStatement), |
3247 _mapToken(node.elseKeyword), | 3264 _mapToken(node.elseKeyword), |
3248 _cloneNode(node.elseStatement)); | 3265 _cloneNode(node.elseStatement)); |
3249 | 3266 |
3250 @override | 3267 @override |
3251 ImplementsClause visitImplementsClause(ImplementsClause node) => | 3268 ImplementsClause visitImplementsClause(ImplementsClause node) => |
3252 new ImplementsClause( | 3269 astFactory.implementsClause( |
3253 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); | 3270 _mapToken(node.implementsKeyword), _cloneNodeList(node.interfaces)); |
3254 | 3271 |
3255 @override | 3272 @override |
3256 ImportDirective visitImportDirective(ImportDirective node) { | 3273 ImportDirective visitImportDirective(ImportDirective node) { |
3257 ImportDirective copy = new ImportDirective( | 3274 ImportDirective copy = astFactory.importDirective( |
3258 _cloneNode(node.documentationComment), | 3275 _cloneNode(node.documentationComment), |
3259 _cloneNodeList(node.metadata), | 3276 _cloneNodeList(node.metadata), |
3260 _mapToken(node.keyword), | 3277 _mapToken(node.keyword), |
3261 _cloneNode(node.uri), | 3278 _cloneNode(node.uri), |
3262 _cloneNodeList(node.configurations), | 3279 _cloneNodeList(node.configurations), |
3263 _mapToken(node.deferredKeyword), | 3280 _mapToken(node.deferredKeyword), |
3264 _mapToken(node.asKeyword), | 3281 _mapToken(node.asKeyword), |
3265 _cloneNode(node.prefix), | 3282 _cloneNode(node.prefix), |
3266 _cloneNodeList(node.combinators), | 3283 _cloneNodeList(node.combinators), |
3267 _mapToken(node.semicolon)); | 3284 _mapToken(node.semicolon)); |
3268 copy.element = node.element; | 3285 copy.element = node.element; |
3269 return copy; | 3286 return copy; |
3270 } | 3287 } |
3271 | 3288 |
3272 @override | 3289 @override |
3273 IndexExpression visitIndexExpression(IndexExpression node) { | 3290 IndexExpression visitIndexExpression(IndexExpression node) { |
3274 Token period = _mapToken(node.period); | 3291 Token period = _mapToken(node.period); |
3275 IndexExpression copy; | 3292 IndexExpression copy; |
3276 if (period == null) { | 3293 if (period == null) { |
3277 copy = new IndexExpression.forTarget( | 3294 copy = astFactory.indexExpressionForTarget( |
3278 _cloneNode(node.target), | 3295 _cloneNode(node.target), |
3279 _mapToken(node.leftBracket), | 3296 _mapToken(node.leftBracket), |
3280 _cloneNode(node.index), | 3297 _cloneNode(node.index), |
3281 _mapToken(node.rightBracket)); | 3298 _mapToken(node.rightBracket)); |
3282 } else { | 3299 } else { |
3283 copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket), | 3300 copy = astFactory.indexExpressionForCascade( |
3284 _cloneNode(node.index), _mapToken(node.rightBracket)); | 3301 period, |
| 3302 _mapToken(node.leftBracket), |
| 3303 _cloneNode(node.index), |
| 3304 _mapToken(node.rightBracket)); |
3285 } | 3305 } |
3286 copy.auxiliaryElements = node.auxiliaryElements; | 3306 copy.auxiliaryElements = node.auxiliaryElements; |
3287 copy.propagatedElement = node.propagatedElement; | 3307 copy.propagatedElement = node.propagatedElement; |
3288 copy.propagatedType = node.propagatedType; | 3308 copy.propagatedType = node.propagatedType; |
3289 copy.staticElement = node.staticElement; | 3309 copy.staticElement = node.staticElement; |
3290 copy.staticType = node.staticType; | 3310 copy.staticType = node.staticType; |
3291 return copy; | 3311 return copy; |
3292 } | 3312 } |
3293 | 3313 |
3294 @override | 3314 @override |
3295 InstanceCreationExpression visitInstanceCreationExpression( | 3315 InstanceCreationExpression visitInstanceCreationExpression( |
3296 InstanceCreationExpression node) { | 3316 InstanceCreationExpression node) { |
3297 InstanceCreationExpression copy = new InstanceCreationExpression( | 3317 InstanceCreationExpression copy = astFactory.instanceCreationExpression( |
3298 _mapToken(node.keyword), | 3318 _mapToken(node.keyword), |
3299 _cloneNode(node.constructorName), | 3319 _cloneNode(node.constructorName), |
3300 _cloneNode(node.argumentList)); | 3320 _cloneNode(node.argumentList)); |
3301 copy.propagatedType = node.propagatedType; | 3321 copy.propagatedType = node.propagatedType; |
3302 copy.staticElement = node.staticElement; | 3322 copy.staticElement = node.staticElement; |
3303 copy.staticType = node.staticType; | 3323 copy.staticType = node.staticType; |
3304 return copy; | 3324 return copy; |
3305 } | 3325 } |
3306 | 3326 |
3307 @override | 3327 @override |
3308 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { | 3328 IntegerLiteral visitIntegerLiteral(IntegerLiteral node) { |
3309 IntegerLiteral copy = | 3329 IntegerLiteral copy = |
3310 new IntegerLiteral(_mapToken(node.literal), node.value); | 3330 astFactory.integerLiteral(_mapToken(node.literal), node.value); |
3311 copy.propagatedType = node.propagatedType; | 3331 copy.propagatedType = node.propagatedType; |
3312 copy.staticType = node.staticType; | 3332 copy.staticType = node.staticType; |
3313 return copy; | 3333 return copy; |
3314 } | 3334 } |
3315 | 3335 |
3316 @override | 3336 @override |
3317 InterpolationExpression visitInterpolationExpression( | 3337 InterpolationExpression visitInterpolationExpression( |
3318 InterpolationExpression node) => | 3338 InterpolationExpression node) => |
3319 new InterpolationExpression(_mapToken(node.leftBracket), | 3339 astFactory.interpolationExpression(_mapToken(node.leftBracket), |
3320 _cloneNode(node.expression), _mapToken(node.rightBracket)); | 3340 _cloneNode(node.expression), _mapToken(node.rightBracket)); |
3321 | 3341 |
3322 @override | 3342 @override |
3323 InterpolationString visitInterpolationString(InterpolationString node) => | 3343 InterpolationString visitInterpolationString(InterpolationString node) => |
3324 new InterpolationString(_mapToken(node.contents), node.value); | 3344 astFactory.interpolationString(_mapToken(node.contents), node.value); |
3325 | 3345 |
3326 @override | 3346 @override |
3327 IsExpression visitIsExpression(IsExpression node) { | 3347 IsExpression visitIsExpression(IsExpression node) { |
3328 IsExpression copy = new IsExpression( | 3348 IsExpression copy = astFactory.isExpression( |
3329 _cloneNode(node.expression), | 3349 _cloneNode(node.expression), |
3330 _mapToken(node.isOperator), | 3350 _mapToken(node.isOperator), |
3331 _mapToken(node.notOperator), | 3351 _mapToken(node.notOperator), |
3332 _cloneNode(node.type)); | 3352 _cloneNode(node.type)); |
3333 copy.propagatedType = node.propagatedType; | 3353 copy.propagatedType = node.propagatedType; |
3334 copy.staticType = node.staticType; | 3354 copy.staticType = node.staticType; |
3335 return copy; | 3355 return copy; |
3336 } | 3356 } |
3337 | 3357 |
3338 @override | 3358 @override |
3339 Label visitLabel(Label node) => | 3359 Label visitLabel(Label node) => |
3340 new Label(_cloneNode(node.label), _mapToken(node.colon)); | 3360 astFactory.label(_cloneNode(node.label), _mapToken(node.colon)); |
3341 | 3361 |
3342 @override | 3362 @override |
3343 LabeledStatement visitLabeledStatement(LabeledStatement node) => | 3363 LabeledStatement visitLabeledStatement(LabeledStatement node) => |
3344 new LabeledStatement( | 3364 astFactory.labeledStatement( |
3345 _cloneNodeList(node.labels), _cloneNode(node.statement)); | 3365 _cloneNodeList(node.labels), _cloneNode(node.statement)); |
3346 | 3366 |
3347 @override | 3367 @override |
3348 LibraryDirective visitLibraryDirective(LibraryDirective node) { | 3368 LibraryDirective visitLibraryDirective(LibraryDirective node) { |
3349 LibraryDirective copy = new LibraryDirective( | 3369 LibraryDirective copy = astFactory.libraryDirective( |
3350 _cloneNode(node.documentationComment), | 3370 _cloneNode(node.documentationComment), |
3351 _cloneNodeList(node.metadata), | 3371 _cloneNodeList(node.metadata), |
3352 _mapToken(node.libraryKeyword), | 3372 _mapToken(node.libraryKeyword), |
3353 _cloneNode(node.name), | 3373 _cloneNode(node.name), |
3354 _mapToken(node.semicolon)); | 3374 _mapToken(node.semicolon)); |
3355 copy.element = node.element; | 3375 copy.element = node.element; |
3356 return copy; | 3376 return copy; |
3357 } | 3377 } |
3358 | 3378 |
3359 @override | 3379 @override |
3360 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { | 3380 LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) { |
3361 LibraryIdentifier copy = | 3381 LibraryIdentifier copy = |
3362 new LibraryIdentifier(_cloneNodeList(node.components)); | 3382 astFactory.libraryIdentifier(_cloneNodeList(node.components)); |
3363 copy.propagatedType = node.propagatedType; | 3383 copy.propagatedType = node.propagatedType; |
3364 copy.staticType = node.staticType; | 3384 copy.staticType = node.staticType; |
3365 return copy; | 3385 return copy; |
3366 } | 3386 } |
3367 | 3387 |
3368 @override | 3388 @override |
3369 ListLiteral visitListLiteral(ListLiteral node) { | 3389 ListLiteral visitListLiteral(ListLiteral node) { |
3370 ListLiteral copy = new ListLiteral( | 3390 ListLiteral copy = astFactory.listLiteral( |
3371 _mapToken(node.constKeyword), | 3391 _mapToken(node.constKeyword), |
3372 _cloneNode(node.typeArguments), | 3392 _cloneNode(node.typeArguments), |
3373 _mapToken(node.leftBracket), | 3393 _mapToken(node.leftBracket), |
3374 _cloneNodeList(node.elements), | 3394 _cloneNodeList(node.elements), |
3375 _mapToken(node.rightBracket)); | 3395 _mapToken(node.rightBracket)); |
3376 copy.propagatedType = node.propagatedType; | 3396 copy.propagatedType = node.propagatedType; |
3377 copy.staticType = node.staticType; | 3397 copy.staticType = node.staticType; |
3378 return copy; | 3398 return copy; |
3379 } | 3399 } |
3380 | 3400 |
3381 @override | 3401 @override |
3382 MapLiteral visitMapLiteral(MapLiteral node) { | 3402 MapLiteral visitMapLiteral(MapLiteral node) { |
3383 MapLiteral copy = new MapLiteral( | 3403 MapLiteral copy = astFactory.mapLiteral( |
3384 _mapToken(node.constKeyword), | 3404 _mapToken(node.constKeyword), |
3385 _cloneNode(node.typeArguments), | 3405 _cloneNode(node.typeArguments), |
3386 _mapToken(node.leftBracket), | 3406 _mapToken(node.leftBracket), |
3387 _cloneNodeList(node.entries), | 3407 _cloneNodeList(node.entries), |
3388 _mapToken(node.rightBracket)); | 3408 _mapToken(node.rightBracket)); |
3389 copy.propagatedType = node.propagatedType; | 3409 copy.propagatedType = node.propagatedType; |
3390 copy.staticType = node.staticType; | 3410 copy.staticType = node.staticType; |
3391 return copy; | 3411 return copy; |
3392 } | 3412 } |
3393 | 3413 |
3394 @override | 3414 @override |
3395 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => | 3415 MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) => |
3396 new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator), | 3416 astFactory.mapLiteralEntry(_cloneNode(node.key), |
3397 _cloneNode(node.value)); | 3417 _mapToken(node.separator), _cloneNode(node.value)); |
3398 | 3418 |
3399 @override | 3419 @override |
3400 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => | 3420 MethodDeclaration visitMethodDeclaration(MethodDeclaration node) => |
3401 new MethodDeclaration( | 3421 astFactory.methodDeclaration( |
3402 _cloneNode(node.documentationComment), | 3422 _cloneNode(node.documentationComment), |
3403 _cloneNodeList(node.metadata), | 3423 _cloneNodeList(node.metadata), |
3404 _mapToken(node.externalKeyword), | 3424 _mapToken(node.externalKeyword), |
3405 _mapToken(node.modifierKeyword), | 3425 _mapToken(node.modifierKeyword), |
3406 _cloneNode(node.returnType), | 3426 _cloneNode(node.returnType), |
3407 _mapToken(node.propertyKeyword), | 3427 _mapToken(node.propertyKeyword), |
3408 _mapToken(node.operatorKeyword), | 3428 _mapToken(node.operatorKeyword), |
3409 _cloneNode(node.name), | 3429 _cloneNode(node.name), |
3410 _cloneNode(node.typeParameters), | 3430 _cloneNode(node.typeParameters), |
3411 _cloneNode(node.parameters), | 3431 _cloneNode(node.parameters), |
3412 _cloneNode(node.body)); | 3432 _cloneNode(node.body)); |
3413 | 3433 |
3414 @override | 3434 @override |
3415 MethodInvocation visitMethodInvocation(MethodInvocation node) { | 3435 MethodInvocation visitMethodInvocation(MethodInvocation node) { |
3416 MethodInvocation copy = new MethodInvocation( | 3436 MethodInvocation copy = astFactory.methodInvocation( |
3417 _cloneNode(node.target), | 3437 _cloneNode(node.target), |
3418 _mapToken(node.operator), | 3438 _mapToken(node.operator), |
3419 _cloneNode(node.methodName), | 3439 _cloneNode(node.methodName), |
3420 _cloneNode(node.typeArguments), | 3440 _cloneNode(node.typeArguments), |
3421 _cloneNode(node.argumentList)); | 3441 _cloneNode(node.argumentList)); |
3422 copy.propagatedType = node.propagatedType; | 3442 copy.propagatedType = node.propagatedType; |
3423 copy.staticType = node.staticType; | 3443 copy.staticType = node.staticType; |
3424 return copy; | 3444 return copy; |
3425 } | 3445 } |
3426 | 3446 |
3427 @override | 3447 @override |
3428 NamedExpression visitNamedExpression(NamedExpression node) { | 3448 NamedExpression visitNamedExpression(NamedExpression node) { |
3429 NamedExpression copy = | 3449 NamedExpression copy = astFactory.namedExpression( |
3430 new NamedExpression(_cloneNode(node.name), _cloneNode(node.expression)); | 3450 _cloneNode(node.name), _cloneNode(node.expression)); |
3431 copy.propagatedType = node.propagatedType; | 3451 copy.propagatedType = node.propagatedType; |
3432 copy.staticType = node.staticType; | 3452 copy.staticType = node.staticType; |
3433 return copy; | 3453 return copy; |
3434 } | 3454 } |
3435 | 3455 |
3436 @override | 3456 @override |
3437 AstNode visitNativeClause(NativeClause node) => | 3457 AstNode visitNativeClause(NativeClause node) => astFactory.nativeClause( |
3438 new NativeClause(_mapToken(node.nativeKeyword), _cloneNode(node.name)); | 3458 _mapToken(node.nativeKeyword), _cloneNode(node.name)); |
3439 | 3459 |
3440 @override | 3460 @override |
3441 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => | 3461 NativeFunctionBody visitNativeFunctionBody(NativeFunctionBody node) => |
3442 new NativeFunctionBody(_mapToken(node.nativeKeyword), | 3462 astFactory.nativeFunctionBody(_mapToken(node.nativeKeyword), |
3443 _cloneNode(node.stringLiteral), _mapToken(node.semicolon)); | 3463 _cloneNode(node.stringLiteral), _mapToken(node.semicolon)); |
3444 | 3464 |
3445 @override | 3465 @override |
3446 NullLiteral visitNullLiteral(NullLiteral node) { | 3466 NullLiteral visitNullLiteral(NullLiteral node) { |
3447 NullLiteral copy = new NullLiteral(_mapToken(node.literal)); | 3467 NullLiteral copy = astFactory.nullLiteral(_mapToken(node.literal)); |
3448 copy.propagatedType = node.propagatedType; | 3468 copy.propagatedType = node.propagatedType; |
3449 copy.staticType = node.staticType; | 3469 copy.staticType = node.staticType; |
3450 return copy; | 3470 return copy; |
3451 } | 3471 } |
3452 | 3472 |
3453 @override | 3473 @override |
3454 ParenthesizedExpression visitParenthesizedExpression( | 3474 ParenthesizedExpression visitParenthesizedExpression( |
3455 ParenthesizedExpression node) { | 3475 ParenthesizedExpression node) { |
3456 ParenthesizedExpression copy = new ParenthesizedExpression( | 3476 ParenthesizedExpression copy = astFactory.parenthesizedExpression( |
3457 _mapToken(node.leftParenthesis), | 3477 _mapToken(node.leftParenthesis), |
3458 _cloneNode(node.expression), | 3478 _cloneNode(node.expression), |
3459 _mapToken(node.rightParenthesis)); | 3479 _mapToken(node.rightParenthesis)); |
3460 copy.propagatedType = node.propagatedType; | 3480 copy.propagatedType = node.propagatedType; |
3461 copy.staticType = node.staticType; | 3481 copy.staticType = node.staticType; |
3462 return copy; | 3482 return copy; |
3463 } | 3483 } |
3464 | 3484 |
3465 @override | 3485 @override |
3466 PartDirective visitPartDirective(PartDirective node) { | 3486 PartDirective visitPartDirective(PartDirective node) { |
3467 PartDirective copy = new PartDirective( | 3487 PartDirective copy = astFactory.partDirective( |
3468 _cloneNode(node.documentationComment), | 3488 _cloneNode(node.documentationComment), |
3469 _cloneNodeList(node.metadata), | 3489 _cloneNodeList(node.metadata), |
3470 _mapToken(node.partKeyword), | 3490 _mapToken(node.partKeyword), |
3471 _cloneNode(node.uri), | 3491 _cloneNode(node.uri), |
3472 _mapToken(node.semicolon)); | 3492 _mapToken(node.semicolon)); |
3473 copy.element = node.element; | 3493 copy.element = node.element; |
3474 return copy; | 3494 return copy; |
3475 } | 3495 } |
3476 | 3496 |
3477 @override | 3497 @override |
3478 PartOfDirective visitPartOfDirective(PartOfDirective node) { | 3498 PartOfDirective visitPartOfDirective(PartOfDirective node) { |
3479 PartOfDirective copy = new PartOfDirective( | 3499 PartOfDirective copy = astFactory.partOfDirective( |
3480 _cloneNode(node.documentationComment), | 3500 _cloneNode(node.documentationComment), |
3481 _cloneNodeList(node.metadata), | 3501 _cloneNodeList(node.metadata), |
3482 _mapToken(node.partKeyword), | 3502 _mapToken(node.partKeyword), |
3483 _mapToken(node.ofKeyword), | 3503 _mapToken(node.ofKeyword), |
3484 _cloneNode(node.uri), | 3504 _cloneNode(node.uri), |
3485 _cloneNode(node.libraryName), | 3505 _cloneNode(node.libraryName), |
3486 _mapToken(node.semicolon)); | 3506 _mapToken(node.semicolon)); |
3487 copy.element = node.element; | 3507 copy.element = node.element; |
3488 return copy; | 3508 return copy; |
3489 } | 3509 } |
3490 | 3510 |
3491 @override | 3511 @override |
3492 PostfixExpression visitPostfixExpression(PostfixExpression node) { | 3512 PostfixExpression visitPostfixExpression(PostfixExpression node) { |
3493 PostfixExpression copy = new PostfixExpression( | 3513 PostfixExpression copy = astFactory.postfixExpression( |
3494 _cloneNode(node.operand), _mapToken(node.operator)); | 3514 _cloneNode(node.operand), _mapToken(node.operator)); |
3495 copy.propagatedElement = node.propagatedElement; | 3515 copy.propagatedElement = node.propagatedElement; |
3496 copy.propagatedType = node.propagatedType; | 3516 copy.propagatedType = node.propagatedType; |
3497 copy.staticElement = node.staticElement; | 3517 copy.staticElement = node.staticElement; |
3498 copy.staticType = node.staticType; | 3518 copy.staticType = node.staticType; |
3499 return copy; | 3519 return copy; |
3500 } | 3520 } |
3501 | 3521 |
3502 @override | 3522 @override |
3503 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { | 3523 PrefixedIdentifier visitPrefixedIdentifier(PrefixedIdentifier node) { |
3504 PrefixedIdentifier copy = new PrefixedIdentifier(_cloneNode(node.prefix), | 3524 PrefixedIdentifier copy = astFactory.prefixedIdentifier( |
3505 _mapToken(node.period), _cloneNode(node.identifier)); | 3525 _cloneNode(node.prefix), |
| 3526 _mapToken(node.period), |
| 3527 _cloneNode(node.identifier)); |
3506 copy.propagatedType = node.propagatedType; | 3528 copy.propagatedType = node.propagatedType; |
3507 copy.staticType = node.staticType; | 3529 copy.staticType = node.staticType; |
3508 return copy; | 3530 return copy; |
3509 } | 3531 } |
3510 | 3532 |
3511 @override | 3533 @override |
3512 PrefixExpression visitPrefixExpression(PrefixExpression node) { | 3534 PrefixExpression visitPrefixExpression(PrefixExpression node) { |
3513 PrefixExpression copy = new PrefixExpression( | 3535 PrefixExpression copy = astFactory.prefixExpression( |
3514 _mapToken(node.operator), _cloneNode(node.operand)); | 3536 _mapToken(node.operator), _cloneNode(node.operand)); |
3515 copy.propagatedElement = node.propagatedElement; | 3537 copy.propagatedElement = node.propagatedElement; |
3516 copy.propagatedType = node.propagatedType; | 3538 copy.propagatedType = node.propagatedType; |
3517 copy.staticElement = node.staticElement; | 3539 copy.staticElement = node.staticElement; |
3518 copy.staticType = node.staticType; | 3540 copy.staticType = node.staticType; |
3519 return copy; | 3541 return copy; |
3520 } | 3542 } |
3521 | 3543 |
3522 @override | 3544 @override |
3523 PropertyAccess visitPropertyAccess(PropertyAccess node) { | 3545 PropertyAccess visitPropertyAccess(PropertyAccess node) { |
3524 PropertyAccess copy = new PropertyAccess(_cloneNode(node.target), | 3546 PropertyAccess copy = astFactory.propertyAccess(_cloneNode(node.target), |
3525 _mapToken(node.operator), _cloneNode(node.propertyName)); | 3547 _mapToken(node.operator), _cloneNode(node.propertyName)); |
3526 copy.propagatedType = node.propagatedType; | 3548 copy.propagatedType = node.propagatedType; |
3527 copy.staticType = node.staticType; | 3549 copy.staticType = node.staticType; |
3528 return copy; | 3550 return copy; |
3529 } | 3551 } |
3530 | 3552 |
3531 @override | 3553 @override |
3532 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( | 3554 RedirectingConstructorInvocation visitRedirectingConstructorInvocation( |
3533 RedirectingConstructorInvocation node) { | 3555 RedirectingConstructorInvocation node) { |
3534 RedirectingConstructorInvocation copy = | 3556 RedirectingConstructorInvocation copy = |
3535 new RedirectingConstructorInvocation( | 3557 astFactory.redirectingConstructorInvocation( |
3536 _mapToken(node.thisKeyword), | 3558 _mapToken(node.thisKeyword), |
3537 _mapToken(node.period), | 3559 _mapToken(node.period), |
3538 _cloneNode(node.constructorName), | 3560 _cloneNode(node.constructorName), |
3539 _cloneNode(node.argumentList)); | 3561 _cloneNode(node.argumentList)); |
3540 copy.staticElement = node.staticElement; | 3562 copy.staticElement = node.staticElement; |
3541 return copy; | 3563 return copy; |
3542 } | 3564 } |
3543 | 3565 |
3544 @override | 3566 @override |
3545 RethrowExpression visitRethrowExpression(RethrowExpression node) { | 3567 RethrowExpression visitRethrowExpression(RethrowExpression node) { |
3546 RethrowExpression copy = | 3568 RethrowExpression copy = |
3547 new RethrowExpression(_mapToken(node.rethrowKeyword)); | 3569 astFactory.rethrowExpression(_mapToken(node.rethrowKeyword)); |
3548 copy.propagatedType = node.propagatedType; | 3570 copy.propagatedType = node.propagatedType; |
3549 copy.staticType = node.staticType; | 3571 copy.staticType = node.staticType; |
3550 return copy; | 3572 return copy; |
3551 } | 3573 } |
3552 | 3574 |
3553 @override | 3575 @override |
3554 ReturnStatement visitReturnStatement(ReturnStatement node) => | 3576 ReturnStatement visitReturnStatement(ReturnStatement node) => |
3555 new ReturnStatement(_mapToken(node.returnKeyword), | 3577 astFactory.returnStatement(_mapToken(node.returnKeyword), |
3556 _cloneNode(node.expression), _mapToken(node.semicolon)); | 3578 _cloneNode(node.expression), _mapToken(node.semicolon)); |
3557 | 3579 |
3558 @override | 3580 @override |
3559 ScriptTag visitScriptTag(ScriptTag node) => | 3581 ScriptTag visitScriptTag(ScriptTag node) => |
3560 new ScriptTag(_mapToken(node.scriptTag)); | 3582 astFactory.scriptTag(_mapToken(node.scriptTag)); |
3561 | 3583 |
3562 @override | 3584 @override |
3563 ShowCombinator visitShowCombinator(ShowCombinator node) => new ShowCombinator( | 3585 ShowCombinator visitShowCombinator(ShowCombinator node) => astFactory |
3564 _mapToken(node.keyword), _cloneNodeList(node.shownNames)); | 3586 .showCombinator(_mapToken(node.keyword), _cloneNodeList(node.shownNames)); |
3565 | 3587 |
3566 @override | 3588 @override |
3567 SimpleFormalParameter visitSimpleFormalParameter( | 3589 SimpleFormalParameter visitSimpleFormalParameter( |
3568 SimpleFormalParameter node) => | 3590 SimpleFormalParameter node) => |
3569 new SimpleFormalParameter( | 3591 astFactory.simpleFormalParameter( |
3570 _cloneNode(node.documentationComment), | 3592 _cloneNode(node.documentationComment), |
3571 _cloneNodeList(node.metadata), | 3593 _cloneNodeList(node.metadata), |
3572 _mapToken(node.keyword), | 3594 _mapToken(node.keyword), |
3573 _cloneNode(node.type), | 3595 _cloneNode(node.type), |
3574 _cloneNode(node.identifier)); | 3596 _cloneNode(node.identifier)); |
3575 | 3597 |
3576 @override | 3598 @override |
3577 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { | 3599 SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) { |
3578 Token mappedToken = _mapToken(node.token); | 3600 Token mappedToken = _mapToken(node.token); |
3579 if (mappedToken == null) { | 3601 if (mappedToken == null) { |
3580 // This only happens for SimpleIdentifiers created by the parser as part | 3602 // This only happens for SimpleIdentifiers created by the parser as part |
3581 // of scanning documentation comments (the tokens for those identifiers | 3603 // of scanning documentation comments (the tokens for those identifiers |
3582 // are not in the original token stream and hence do not get copied). | 3604 // are not in the original token stream and hence do not get copied). |
3583 // This extra check can be removed if the scanner is changed to scan | 3605 // This extra check can be removed if the scanner is changed to scan |
3584 // documentation comments for the parser. | 3606 // documentation comments for the parser. |
3585 mappedToken = node.token; | 3607 mappedToken = node.token; |
3586 } | 3608 } |
3587 SimpleIdentifier copy = new SimpleIdentifier(mappedToken, | 3609 SimpleIdentifier copy = astFactory.simpleIdentifier(mappedToken, |
3588 isDeclaration: node.inDeclarationContext()); | 3610 isDeclaration: node.inDeclarationContext()); |
3589 copy.auxiliaryElements = node.auxiliaryElements; | 3611 copy.auxiliaryElements = node.auxiliaryElements; |
3590 copy.propagatedElement = node.propagatedElement; | 3612 copy.propagatedElement = node.propagatedElement; |
3591 copy.propagatedType = node.propagatedType; | 3613 copy.propagatedType = node.propagatedType; |
3592 copy.staticElement = node.staticElement; | 3614 copy.staticElement = node.staticElement; |
3593 copy.staticType = node.staticType; | 3615 copy.staticType = node.staticType; |
3594 return copy; | 3616 return copy; |
3595 } | 3617 } |
3596 | 3618 |
3597 @override | 3619 @override |
3598 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { | 3620 SimpleStringLiteral visitSimpleStringLiteral(SimpleStringLiteral node) { |
3599 SimpleStringLiteral copy = | 3621 SimpleStringLiteral copy = |
3600 new SimpleStringLiteral(_mapToken(node.literal), node.value); | 3622 astFactory.simpleStringLiteral(_mapToken(node.literal), node.value); |
3601 copy.propagatedType = node.propagatedType; | 3623 copy.propagatedType = node.propagatedType; |
3602 copy.staticType = node.staticType; | 3624 copy.staticType = node.staticType; |
3603 return copy; | 3625 return copy; |
3604 } | 3626 } |
3605 | 3627 |
3606 @override | 3628 @override |
3607 StringInterpolation visitStringInterpolation(StringInterpolation node) { | 3629 StringInterpolation visitStringInterpolation(StringInterpolation node) { |
3608 StringInterpolation copy = | 3630 StringInterpolation copy = |
3609 new StringInterpolation(_cloneNodeList(node.elements)); | 3631 astFactory.stringInterpolation(_cloneNodeList(node.elements)); |
3610 copy.propagatedType = node.propagatedType; | 3632 copy.propagatedType = node.propagatedType; |
3611 copy.staticType = node.staticType; | 3633 copy.staticType = node.staticType; |
3612 return copy; | 3634 return copy; |
3613 } | 3635 } |
3614 | 3636 |
3615 @override | 3637 @override |
3616 SuperConstructorInvocation visitSuperConstructorInvocation( | 3638 SuperConstructorInvocation visitSuperConstructorInvocation( |
3617 SuperConstructorInvocation node) { | 3639 SuperConstructorInvocation node) { |
3618 SuperConstructorInvocation copy = new SuperConstructorInvocation( | 3640 SuperConstructorInvocation copy = astFactory.superConstructorInvocation( |
3619 _mapToken(node.superKeyword), | 3641 _mapToken(node.superKeyword), |
3620 _mapToken(node.period), | 3642 _mapToken(node.period), |
3621 _cloneNode(node.constructorName), | 3643 _cloneNode(node.constructorName), |
3622 _cloneNode(node.argumentList)); | 3644 _cloneNode(node.argumentList)); |
3623 copy.staticElement = node.staticElement; | 3645 copy.staticElement = node.staticElement; |
3624 return copy; | 3646 return copy; |
3625 } | 3647 } |
3626 | 3648 |
3627 @override | 3649 @override |
3628 SuperExpression visitSuperExpression(SuperExpression node) { | 3650 SuperExpression visitSuperExpression(SuperExpression node) { |
3629 SuperExpression copy = new SuperExpression(_mapToken(node.superKeyword)); | 3651 SuperExpression copy = |
| 3652 astFactory.superExpression(_mapToken(node.superKeyword)); |
3630 copy.propagatedType = node.propagatedType; | 3653 copy.propagatedType = node.propagatedType; |
3631 copy.staticType = node.staticType; | 3654 copy.staticType = node.staticType; |
3632 return copy; | 3655 return copy; |
3633 } | 3656 } |
3634 | 3657 |
3635 @override | 3658 @override |
3636 SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase( | 3659 SwitchCase visitSwitchCase(SwitchCase node) => astFactory.switchCase( |
3637 _cloneNodeList(node.labels), | 3660 _cloneNodeList(node.labels), |
3638 _mapToken(node.keyword), | 3661 _mapToken(node.keyword), |
3639 _cloneNode(node.expression), | 3662 _cloneNode(node.expression), |
3640 _mapToken(node.colon), | 3663 _mapToken(node.colon), |
3641 _cloneNodeList(node.statements)); | 3664 _cloneNodeList(node.statements)); |
3642 | 3665 |
3643 @override | 3666 @override |
3644 SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault( | 3667 SwitchDefault visitSwitchDefault(SwitchDefault node) => |
3645 _cloneNodeList(node.labels), | 3668 astFactory.switchDefault( |
3646 _mapToken(node.keyword), | 3669 _cloneNodeList(node.labels), |
3647 _mapToken(node.colon), | 3670 _mapToken(node.keyword), |
3648 _cloneNodeList(node.statements)); | 3671 _mapToken(node.colon), |
| 3672 _cloneNodeList(node.statements)); |
3649 | 3673 |
3650 @override | 3674 @override |
3651 SwitchStatement visitSwitchStatement(SwitchStatement node) => | 3675 SwitchStatement visitSwitchStatement(SwitchStatement node) => |
3652 new SwitchStatement( | 3676 astFactory.switchStatement( |
3653 _mapToken(node.switchKeyword), | 3677 _mapToken(node.switchKeyword), |
3654 _mapToken(node.leftParenthesis), | 3678 _mapToken(node.leftParenthesis), |
3655 _cloneNode(node.expression), | 3679 _cloneNode(node.expression), |
3656 _mapToken(node.rightParenthesis), | 3680 _mapToken(node.rightParenthesis), |
3657 _mapToken(node.leftBracket), | 3681 _mapToken(node.leftBracket), |
3658 _cloneNodeList(node.members), | 3682 _cloneNodeList(node.members), |
3659 _mapToken(node.rightBracket)); | 3683 _mapToken(node.rightBracket)); |
3660 | 3684 |
3661 @override | 3685 @override |
3662 AstNode visitSymbolLiteral(SymbolLiteral node) { | 3686 AstNode visitSymbolLiteral(SymbolLiteral node) { |
3663 SymbolLiteral copy = new SymbolLiteral( | 3687 SymbolLiteral copy = astFactory.symbolLiteral( |
3664 _mapToken(node.poundSign), _mapTokens(node.components)); | 3688 _mapToken(node.poundSign), _mapTokens(node.components)); |
3665 copy.propagatedType = node.propagatedType; | 3689 copy.propagatedType = node.propagatedType; |
3666 copy.staticType = node.staticType; | 3690 copy.staticType = node.staticType; |
3667 return copy; | 3691 return copy; |
3668 } | 3692 } |
3669 | 3693 |
3670 @override | 3694 @override |
3671 ThisExpression visitThisExpression(ThisExpression node) { | 3695 ThisExpression visitThisExpression(ThisExpression node) { |
3672 ThisExpression copy = new ThisExpression(_mapToken(node.thisKeyword)); | 3696 ThisExpression copy = |
| 3697 astFactory.thisExpression(_mapToken(node.thisKeyword)); |
3673 copy.propagatedType = node.propagatedType; | 3698 copy.propagatedType = node.propagatedType; |
3674 copy.staticType = node.staticType; | 3699 copy.staticType = node.staticType; |
3675 return copy; | 3700 return copy; |
3676 } | 3701 } |
3677 | 3702 |
3678 @override | 3703 @override |
3679 ThrowExpression visitThrowExpression(ThrowExpression node) { | 3704 ThrowExpression visitThrowExpression(ThrowExpression node) { |
3680 ThrowExpression copy = new ThrowExpression( | 3705 ThrowExpression copy = astFactory.throwExpression( |
3681 _mapToken(node.throwKeyword), _cloneNode(node.expression)); | 3706 _mapToken(node.throwKeyword), _cloneNode(node.expression)); |
3682 copy.propagatedType = node.propagatedType; | 3707 copy.propagatedType = node.propagatedType; |
3683 copy.staticType = node.staticType; | 3708 copy.staticType = node.staticType; |
3684 return copy; | 3709 return copy; |
3685 } | 3710 } |
3686 | 3711 |
3687 @override | 3712 @override |
3688 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( | 3713 TopLevelVariableDeclaration visitTopLevelVariableDeclaration( |
3689 TopLevelVariableDeclaration node) => | 3714 TopLevelVariableDeclaration node) => |
3690 new TopLevelVariableDeclaration( | 3715 astFactory.topLevelVariableDeclaration( |
3691 _cloneNode(node.documentationComment), | 3716 _cloneNode(node.documentationComment), |
3692 _cloneNodeList(node.metadata), | 3717 _cloneNodeList(node.metadata), |
3693 _cloneNode(node.variables), | 3718 _cloneNode(node.variables), |
3694 _mapToken(node.semicolon)); | 3719 _mapToken(node.semicolon)); |
3695 | 3720 |
3696 @override | 3721 @override |
3697 TryStatement visitTryStatement(TryStatement node) => new TryStatement( | 3722 TryStatement visitTryStatement(TryStatement node) => astFactory.tryStatement( |
3698 _mapToken(node.tryKeyword), | 3723 _mapToken(node.tryKeyword), |
3699 _cloneNode(node.body), | 3724 _cloneNode(node.body), |
3700 _cloneNodeList(node.catchClauses), | 3725 _cloneNodeList(node.catchClauses), |
3701 _mapToken(node.finallyKeyword), | 3726 _mapToken(node.finallyKeyword), |
3702 _cloneNode(node.finallyBlock)); | 3727 _cloneNode(node.finallyBlock)); |
3703 | 3728 |
3704 @override | 3729 @override |
3705 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => | 3730 TypeArgumentList visitTypeArgumentList(TypeArgumentList node) => |
3706 new TypeArgumentList(_mapToken(node.leftBracket), | 3731 astFactory.typeArgumentList(_mapToken(node.leftBracket), |
3707 _cloneNodeList(node.arguments), _mapToken(node.rightBracket)); | 3732 _cloneNodeList(node.arguments), _mapToken(node.rightBracket)); |
3708 | 3733 |
3709 @override | 3734 @override |
3710 TypeName visitTypeName(TypeName node) { | 3735 TypeName visitTypeName(TypeName node) { |
3711 TypeName copy = | 3736 TypeName copy = astFactory.typeName( |
3712 new TypeName(_cloneNode(node.name), _cloneNode(node.typeArguments)); | 3737 _cloneNode(node.name), _cloneNode(node.typeArguments)); |
3713 copy.type = node.type; | 3738 copy.type = node.type; |
3714 return copy; | 3739 return copy; |
3715 } | 3740 } |
3716 | 3741 |
3717 @override | 3742 @override |
3718 TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter( | 3743 TypeParameter visitTypeParameter(TypeParameter node) => |
3719 _cloneNode(node.documentationComment), | 3744 astFactory.typeParameter( |
3720 _cloneNodeList(node.metadata), | 3745 _cloneNode(node.documentationComment), |
3721 _cloneNode(node.name), | 3746 _cloneNodeList(node.metadata), |
3722 _mapToken(node.extendsKeyword), | 3747 _cloneNode(node.name), |
3723 _cloneNode(node.bound)); | 3748 _mapToken(node.extendsKeyword), |
| 3749 _cloneNode(node.bound)); |
3724 | 3750 |
3725 @override | 3751 @override |
3726 TypeParameterList visitTypeParameterList(TypeParameterList node) => | 3752 TypeParameterList visitTypeParameterList(TypeParameterList node) => |
3727 new TypeParameterList(_mapToken(node.leftBracket), | 3753 astFactory.typeParameterList(_mapToken(node.leftBracket), |
3728 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); | 3754 _cloneNodeList(node.typeParameters), _mapToken(node.rightBracket)); |
3729 | 3755 |
3730 @override | 3756 @override |
3731 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => | 3757 VariableDeclaration visitVariableDeclaration(VariableDeclaration node) => |
3732 new VariableDeclaration(_cloneNode(node.name), _mapToken(node.equals), | 3758 astFactory.variableDeclaration(_cloneNode(node.name), |
3733 _cloneNode(node.initializer)); | 3759 _mapToken(node.equals), _cloneNode(node.initializer)); |
3734 | 3760 |
3735 @override | 3761 @override |
3736 VariableDeclarationList visitVariableDeclarationList( | 3762 VariableDeclarationList visitVariableDeclarationList( |
3737 VariableDeclarationList node) => | 3763 VariableDeclarationList node) => |
3738 new VariableDeclarationList( | 3764 astFactory.variableDeclarationList( |
3739 null, | 3765 null, |
3740 _cloneNodeList(node.metadata), | 3766 _cloneNodeList(node.metadata), |
3741 _mapToken(node.keyword), | 3767 _mapToken(node.keyword), |
3742 _cloneNode(node.type), | 3768 _cloneNode(node.type), |
3743 _cloneNodeList(node.variables)); | 3769 _cloneNodeList(node.variables)); |
3744 | 3770 |
3745 @override | 3771 @override |
3746 VariableDeclarationStatement visitVariableDeclarationStatement( | 3772 VariableDeclarationStatement visitVariableDeclarationStatement( |
3747 VariableDeclarationStatement node) => | 3773 VariableDeclarationStatement node) => |
3748 new VariableDeclarationStatement( | 3774 astFactory.variableDeclarationStatement( |
3749 _cloneNode(node.variables), _mapToken(node.semicolon)); | 3775 _cloneNode(node.variables), _mapToken(node.semicolon)); |
3750 | 3776 |
3751 @override | 3777 @override |
3752 WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement( | 3778 WhileStatement visitWhileStatement(WhileStatement node) => |
3753 _mapToken(node.whileKeyword), | 3779 astFactory.whileStatement( |
3754 _mapToken(node.leftParenthesis), | 3780 _mapToken(node.whileKeyword), |
3755 _cloneNode(node.condition), | 3781 _mapToken(node.leftParenthesis), |
3756 _mapToken(node.rightParenthesis), | 3782 _cloneNode(node.condition), |
3757 _cloneNode(node.body)); | 3783 _mapToken(node.rightParenthesis), |
| 3784 _cloneNode(node.body)); |
3758 | 3785 |
3759 @override | 3786 @override |
3760 WithClause visitWithClause(WithClause node) => new WithClause( | 3787 WithClause visitWithClause(WithClause node) => astFactory.withClause( |
3761 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes)); | 3788 _mapToken(node.withKeyword), _cloneNodeList(node.mixinTypes)); |
3762 | 3789 |
3763 @override | 3790 @override |
3764 YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement( | 3791 YieldStatement visitYieldStatement(YieldStatement node) => |
3765 _mapToken(node.yieldKeyword), | 3792 astFactory.yieldStatement( |
3766 _mapToken(node.star), | 3793 _mapToken(node.yieldKeyword), |
3767 _cloneNode(node.expression), | 3794 _mapToken(node.star), |
3768 _mapToken(node.semicolon)); | 3795 _cloneNode(node.expression), |
| 3796 _mapToken(node.semicolon)); |
3769 | 3797 |
3770 AstNode/*=E*/ _cloneNode/*<E extends AstNode>*/(AstNode/*=E*/ node) { | 3798 AstNode/*=E*/ _cloneNode/*<E extends AstNode>*/(AstNode/*=E*/ node) { |
3771 if (node == null) { | 3799 if (node == null) { |
3772 return null; | 3800 return null; |
3773 } | 3801 } |
3774 if (identical(node, _oldNode)) { | 3802 if (identical(node, _oldNode)) { |
3775 return _newNode as AstNode/*=E*/; | 3803 return _newNode as AstNode/*=E*/; |
3776 } | 3804 } |
3777 return node.accept(this) as AstNode/*=E*/; | 3805 return node.accept(this) as AstNode/*=E*/; |
3778 } | 3806 } |
(...skipping 5373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9152 if (node.star != null) { | 9180 if (node.star != null) { |
9153 sink.write("yield* "); | 9181 sink.write("yield* "); |
9154 } else { | 9182 } else { |
9155 sink.write("yield "); | 9183 sink.write("yield "); |
9156 } | 9184 } |
9157 safelyVisitNode(node.expression); | 9185 safelyVisitNode(node.expression); |
9158 sink.write(";"); | 9186 sink.write(";"); |
9159 return null; | 9187 return null; |
9160 } | 9188 } |
9161 } | 9189 } |
OLD | NEW |