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

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

Issue 8566003: Revert various changes to Link factories. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: frogsh Created 9 years, 1 month 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 visitClassNode(ClassNode node); 7 R visitClassNode(ClassNode node);
8 R visitExpressionStatement(ExpressionStatement node); 8 R visitExpressionStatement(ExpressionStatement node);
9 R visitFor(For node); 9 R visitFor(For node);
10 R visitFunctionExpression(FunctionExpression node); 10 R visitFunctionExpression(FunctionExpression node);
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 class NodeList extends Node { 159 class NodeList extends Node {
160 final Link<Node> nodes; 160 final Link<Node> nodes;
161 final Token beginToken; 161 final Token beginToken;
162 final Token endToken; 162 final Token endToken;
163 final SourceString delimiter; 163 final SourceString delimiter;
164 164
165 const NodeList([this.beginToken, this.nodes, this.endToken, this.delimiter]); 165 const NodeList([this.beginToken, this.nodes, this.endToken, this.delimiter]);
166 166
167 NodeList.singleton(Node node) : this(null, LinkFactory.createLink(node)); 167 NodeList.singleton(Node node) : this(null, new Link<Node>(node));
168 168
169 accept(Visitor visitor) => visitor.visitNodeList(this); 169 accept(Visitor visitor) => visitor.visitNodeList(this);
170 170
171 Token getBeginToken() { 171 Token getBeginToken() {
172 if (beginToken !== null) return beginToken; 172 if (beginToken !== null) return beginToken;
173 if (nodes !== null) { 173 if (nodes !== null) {
174 for (Link<Node> link = nodes; !link.isEmpty(); link = link.tail) { 174 for (Link<Node> link = nodes; !link.isEmpty(); link = link.tail) {
175 if (link.head.getBeginToken() !== null) { 175 if (link.head.getBeginToken() !== null) {
176 return link.head.getBeginToken(); 176 return link.head.getBeginToken();
177 } 177 }
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } 437 }
438 438
439 /** Representation of modifiers such as static, abstract, final, etc. */ 439 /** Representation of modifiers such as static, abstract, final, etc. */
440 class Modifiers { 440 class Modifiers {
441 final Link<Token> modifiers; 441 final Link<Token> modifiers;
442 /** Bit pattern to easy check what modifiers are present. */ 442 /** Bit pattern to easy check what modifiers are present. */
443 final int flags; 443 final int flags;
444 444
445 const Modifiers([this.modifiers, this.flags = 0]); 445 const Modifiers([this.modifiers, this.flags = 0]);
446 } 446 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698