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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 Statement(); | 312 Statement(); |
313 | 313 |
314 Statement asStatement() => this; | 314 Statement asStatement() => this; |
315 | 315 |
316 // TODO(ahe): make class abstract instead of adding an abstract method. | 316 // TODO(ahe): make class abstract instead of adding an abstract method. |
317 accept(Visitor visitor); | 317 accept(Visitor visitor); |
318 | 318 |
319 bool isValidBreakTarget() => true; | 319 bool isValidBreakTarget() => true; |
320 } | 320 } |
321 | 321 |
322 /// Errorneous expression that behaves as a literal integer (0). | 322 /// Errorneous expression that behaves as a literal null. |
323 class ErrorExpression extends LiteralInt { | 323 class ErrorExpression extends LiteralNull { |
324 ErrorExpression(token) | 324 ErrorExpression(token) |
325 : super(token, null); | 325 : super(token); |
326 | 326 |
327 ErrorExpression asErrorExpression() => this; | 327 ErrorExpression asErrorExpression() => this; |
328 | |
329 int get value => 0; | |
330 } | 328 } |
331 | 329 |
332 /** | 330 /** |
333 * A message send aka method invocation. In Dart, most operations can | 331 * A message send aka method invocation. In Dart, most operations can |
334 * (and should) be considered as message sends. Getters and setters | 332 * (and should) be considered as message sends. Getters and setters |
335 * are just methods with a special syntax. Consequently, we model | 333 * are just methods with a special syntax. Consequently, we model |
336 * property access, assignment, operators, and method calls with this | 334 * property access, assignment, operators, and method calls with this |
337 * one node. | 335 * one node. |
338 */ | 336 */ |
339 class Send extends Expression { | 337 class Send extends Expression { |
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2107 } | 2105 } |
2108 | 2106 |
2109 class IsInterpolationVisitor extends Visitor<bool> { | 2107 class IsInterpolationVisitor extends Visitor<bool> { |
2110 const IsInterpolationVisitor(); | 2108 const IsInterpolationVisitor(); |
2111 bool visitNode(Node node) => false; | 2109 bool visitNode(Node node) => false; |
2112 bool visitStringInterpolation(StringInterpolation node) => true; | 2110 bool visitStringInterpolation(StringInterpolation node) => true; |
2113 bool visitStringJuxtaposition(StringJuxtaposition node) | 2111 bool visitStringJuxtaposition(StringJuxtaposition node) |
2114 => node.isInterpolation; | 2112 => node.isInterpolation; |
2115 } | 2113 } |
2116 | 2114 |
OLD | NEW |