| 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 part of tree; | 5 part of tree; |
| 6 | 6 |
| 7 abstract class Visitor<R> { | 7 abstract class Visitor<R> { |
| 8 const Visitor(); | 8 const Visitor(); |
| 9 | 9 |
| 10 R visitNode(Node node); | 10 R visitNode(Node node); |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 final Send send; | 393 final Send send; |
| 394 | 394 |
| 395 NewExpression([this.newToken, this.send]); | 395 NewExpression([this.newToken, this.send]); |
| 396 | 396 |
| 397 accept(Visitor visitor) => visitor.visitNewExpression(this); | 397 accept(Visitor visitor) => visitor.visitNewExpression(this); |
| 398 | 398 |
| 399 visitChildren(Visitor visitor) { | 399 visitChildren(Visitor visitor) { |
| 400 if (send != null) send.accept(visitor); | 400 if (send != null) send.accept(visitor); |
| 401 } | 401 } |
| 402 | 402 |
| 403 bool isConst() => identical(newToken.stringValue, 'const'); | 403 bool isConst() { |
| 404 return identical(newToken.stringValue, 'const') |
| 405 || identical(newToken.stringValue, '@'); |
| 406 } |
| 404 | 407 |
| 405 Token getBeginToken() => newToken; | 408 Token getBeginToken() => newToken; |
| 406 | 409 |
| 407 Token getEndToken() => send.getEndToken(); | 410 Token getEndToken() => send.getEndToken(); |
| 408 } | 411 } |
| 409 | 412 |
| 410 class NodeList extends Node implements Iterable<Node> { | 413 class NodeList extends Node implements Iterable<Node> { |
| 411 final Link<Node> nodes; | 414 final Link<Node> nodes; |
| 412 final Token beginToken; | 415 final Token beginToken; |
| 413 final Token endToken; | 416 final Token endToken; |
| (...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1995 * argument). | 1998 * argument). |
| 1996 * | 1999 * |
| 1997 * TODO(ahe): This method is controversial, the team needs to discuss | 2000 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1998 * if top-level methods are acceptable and what naming conventions to | 2001 * if top-level methods are acceptable and what naming conventions to |
| 1999 * use. | 2002 * use. |
| 2000 */ | 2003 */ |
| 2001 initializerDo(Node node, f(Node node)) { | 2004 initializerDo(Node node, f(Node node)) { |
| 2002 SendSet send = node.asSendSet(); | 2005 SendSet send = node.asSendSet(); |
| 2003 if (send != null) return f(send.arguments.head); | 2006 if (send != null) return f(send.arguments.head); |
| 2004 } | 2007 } |
| OLD | NEW |