| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |