Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: dart/frog/leg/tree/nodes.dart

Issue 9808006: Resolve initializers in their proper scope. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Revert bogus changes Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 initializerDo(Node node, f(Node node)) {
1637 SendSet send = node.asSendSet();
1638 if (send !== null) return f(send.arguments.head);
1639 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698