| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 Statement(); | 308 Statement(); |
| 309 | 309 |
| 310 Statement asStatement() => this; | 310 Statement asStatement() => this; |
| 311 | 311 |
| 312 // TODO(ahe): make class abstract instead of adding an abstract method. | 312 // TODO(ahe): make class abstract instead of adding an abstract method. |
| 313 accept(Visitor visitor); | 313 accept(Visitor visitor); |
| 314 | 314 |
| 315 bool isValidBreakTarget() => true; | 315 bool isValidBreakTarget() => true; |
| 316 } | 316 } |
| 317 | 317 |
| 318 /// Errorneous expression that behaves as a literal integer (0). |
| 319 class ErrorExpression extends LiteralInt { |
| 320 ErrorExpression(token) |
| 321 : super(token, null); |
| 322 |
| 323 ErrorExpression asErrorExpression() => this; |
| 324 |
| 325 int get value => 0; |
| 326 } |
| 327 |
| 318 /** | 328 /** |
| 319 * A message send aka method invocation. In Dart, most operations can | 329 * A message send aka method invocation. In Dart, most operations can |
| 320 * (and should) be considered as message sends. Getters and setters | 330 * (and should) be considered as message sends. Getters and setters |
| 321 * are just methods with a special syntax. Consequently, we model | 331 * are just methods with a special syntax. Consequently, we model |
| 322 * property access, assignment, operators, and method calls with this | 332 * property access, assignment, operators, and method calls with this |
| 323 * one node. | 333 * one node. |
| 324 */ | 334 */ |
| 325 class Send extends Expression { | 335 class Send extends Expression { |
| 326 final Node receiver; | 336 final Node receiver; |
| 327 final Node selector; | 337 final Node selector; |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2080 * argument). | 2090 * argument). |
| 2081 * | 2091 * |
| 2082 * TODO(ahe): This method is controversial, the team needs to discuss | 2092 * TODO(ahe): This method is controversial, the team needs to discuss |
| 2083 * if top-level methods are acceptable and what naming conventions to | 2093 * if top-level methods are acceptable and what naming conventions to |
| 2084 * use. | 2094 * use. |
| 2085 */ | 2095 */ |
| 2086 initializerDo(Node node, f(Node node)) { | 2096 initializerDo(Node node, f(Node node)) { |
| 2087 SendSet send = node.asSendSet(); | 2097 SendSet send = node.asSendSet(); |
| 2088 if (send != null) return f(send.arguments.head); | 2098 if (send != null) return f(send.arguments.head); |
| 2089 } | 2099 } |
| OLD | NEW |