| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.clone; | 4 library kernel.clone; |
| 5 | 5 |
| 6 import 'ast.dart'; | 6 import 'ast.dart'; |
| 7 import 'type_algebra.dart'; | 7 import 'type_algebra.dart'; |
| 8 | 8 |
| 9 /// Visitor that return a clone of a tree, maintaining references to cloned | 9 /// Visitor that return a clone of a tree, maintaining references to cloned |
| 10 /// objects. | 10 /// objects. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 228 } |
| 229 | 229 |
| 230 visitVectorCreation(VectorCreation node) { | 230 visitVectorCreation(VectorCreation node) { |
| 231 return new VectorCreation(node.length); | 231 return new VectorCreation(node.length); |
| 232 } | 232 } |
| 233 | 233 |
| 234 visitClosureCreation(ClosureCreation node) { | 234 visitClosureCreation(ClosureCreation node) { |
| 235 return new ClosureCreation.byReference( | 235 return new ClosureCreation.byReference( |
| 236 node.topLevelFunctionReference, | 236 node.topLevelFunctionReference, |
| 237 cloneOptional(node.contextVector), | 237 cloneOptional(node.contextVector), |
| 238 visitOptionalType(node.functionType)); | 238 visitOptionalType(node.functionType), |
| 239 node.typeArgs.map(visitType).toList()); |
| 239 } | 240 } |
| 240 | 241 |
| 241 visitVectorSet(VectorSet node) { | 242 visitVectorSet(VectorSet node) { |
| 242 return new VectorSet( | 243 return new VectorSet( |
| 243 clone(node.vectorExpression), node.index, clone(node.value)); | 244 clone(node.vectorExpression), node.index, clone(node.value)); |
| 244 } | 245 } |
| 245 | 246 |
| 246 visitVectorGet(VectorGet node) { | 247 visitVectorGet(VectorGet node) { |
| 247 return new VectorGet(clone(node.vectorExpression), node.index); | 248 return new VectorGet(clone(node.vectorExpression), node.index); |
| 248 } | 249 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 visitArguments(Arguments node) { | 433 visitArguments(Arguments node) { |
| 433 return new Arguments(node.positional.map(clone).toList(), | 434 return new Arguments(node.positional.map(clone).toList(), |
| 434 types: node.types.map(visitType).toList(), | 435 types: node.types.map(visitType).toList(), |
| 435 named: node.named.map(clone).toList()); | 436 named: node.named.map(clone).toList()); |
| 436 } | 437 } |
| 437 | 438 |
| 438 visitNamedExpression(NamedExpression node) { | 439 visitNamedExpression(NamedExpression node) { |
| 439 return new NamedExpression(node.name, clone(node.value)); | 440 return new NamedExpression(node.name, clone(node.value)); |
| 440 } | 441 } |
| 441 } | 442 } |
| OLD | NEW |