| 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 interface Visitor<R> { | 5 interface Visitor<R> { |
| 6 R visitBlock(Block node); | 6 R visitBlock(Block node); |
| 7 R visitBreakStatement(BreakStatement node); | 7 R visitBreakStatement(BreakStatement node); |
| 8 R visitCatchBlock(CatchBlock node); | 8 R visitCatchBlock(CatchBlock node); |
| 9 R visitClassNode(ClassNode node); | 9 R visitClassNode(ClassNode node); |
| 10 R visitConditional(Conditional node); | 10 R visitConditional(Conditional node); |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 DartString visitLiteralString(LiteralString node) => node.dartString; | 1621 DartString visitLiteralString(LiteralString node) => node.dartString; |
| 1622 } | 1622 } |
| 1623 | 1623 |
| 1624 class IsInterpolationVisitor extends AbstractVisitor<bool> { | 1624 class IsInterpolationVisitor extends AbstractVisitor<bool> { |
| 1625 const IsInterpolationVisitor(); | 1625 const IsInterpolationVisitor(); |
| 1626 bool visitNode(Node node) => false; | 1626 bool visitNode(Node node) => false; |
| 1627 bool visitStringInterpolation(StringInterpolation node) => true; | 1627 bool visitStringInterpolation(StringInterpolation node) => true; |
| 1628 bool visitStringJuxtaposition(StringJuxtaposition node) | 1628 bool visitStringJuxtaposition(StringJuxtaposition node) |
| 1629 => node.isInterpolation; | 1629 => node.isInterpolation; |
| 1630 } | 1630 } |
| 1631 |
| 1632 /** |
| 1633 * If the given node is a send set, it visits its initializer (first |
| 1634 * argument). |
| 1635 * |
| 1636 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1637 * if top-level methods are acceptable and what naming conventions to |
| 1638 * use. |
| 1639 */ |
| 1640 initializerDo(Node node, f(Node node)) { |
| 1641 SendSet send = node.asSendSet(); |
| 1642 if (send !== null) return f(send.arguments.head); |
| 1643 } |
| OLD | NEW |