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

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: Address review comments 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
« no previous file with comments | « dart/frog/leg/resolver.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * 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 }
OLDNEW
« no previous file with comments | « dart/frog/leg/resolver.dart ('k') | dart/tests/language/language-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698