| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 abstract class Visitor<R> { | 7 abstract class Visitor<R> { |
| 8 const Visitor(); | 8 const Visitor(); |
| 9 | 9 |
| 10 R visitNode(Node node); | 10 R visitNode(Node node); |
| (...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 | 695 |
| 696 FunctionExpression(this.name, this.parameters, this.body, this.returnType, | 696 FunctionExpression(this.name, this.parameters, this.body, this.returnType, |
| 697 this.modifiers, this.initializers, this.getOrSet) { | 697 this.modifiers, this.initializers, this.getOrSet) { |
| 698 assert(modifiers != null); | 698 assert(modifiers != null); |
| 699 } | 699 } |
| 700 | 700 |
| 701 FunctionExpression asFunctionExpression() => this; | 701 FunctionExpression asFunctionExpression() => this; |
| 702 | 702 |
| 703 accept(Visitor visitor) => visitor.visitFunctionExpression(this); | 703 accept(Visitor visitor) => visitor.visitFunctionExpression(this); |
| 704 | 704 |
| 705 bool get isRedirectingFactory { |
| 706 return body != null && body.asReturn() != null && |
| 707 body.asReturn().isRedirectingFactoryBody; |
| 708 } |
| 709 |
| 705 visitChildren(Visitor visitor) { | 710 visitChildren(Visitor visitor) { |
| 706 if (modifiers != null) modifiers.accept(visitor); | 711 if (modifiers != null) modifiers.accept(visitor); |
| 707 if (returnType != null) returnType.accept(visitor); | 712 if (returnType != null) returnType.accept(visitor); |
| 708 if (name != null) name.accept(visitor); | 713 if (name != null) name.accept(visitor); |
| 709 if (parameters != null) parameters.accept(visitor); | 714 if (parameters != null) parameters.accept(visitor); |
| 710 if (initializers != null) initializers.accept(visitor); | 715 if (initializers != null) initializers.accept(visitor); |
| 711 if (body != null) body.accept(visitor); | 716 if (body != null) body.accept(visitor); |
| 712 } | 717 } |
| 713 | 718 |
| 714 bool hasBody() => body.asEmptyStatement() == null; | 719 bool hasBody() => body.asEmptyStatement() == null; |
| (...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 * argument). | 2100 * argument). |
| 2096 * | 2101 * |
| 2097 * TODO(ahe): This method is controversial, the team needs to discuss | 2102 * TODO(ahe): This method is controversial, the team needs to discuss |
| 2098 * if top-level methods are acceptable and what naming conventions to | 2103 * if top-level methods are acceptable and what naming conventions to |
| 2099 * use. | 2104 * use. |
| 2100 */ | 2105 */ |
| 2101 initializerDo(Node node, f(Node node)) { | 2106 initializerDo(Node node, f(Node node)) { |
| 2102 SendSet send = node.asSendSet(); | 2107 SendSet send = node.asSendSet(); |
| 2103 if (send != null) return f(send.arguments.head); | 2108 if (send != null) return f(send.arguments.head); |
| 2104 } | 2109 } |
| OLD | NEW |