| 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 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 visitCascade(Cascade node); | 8 R visitCascade(Cascade node); |
| 9 R visitCascadeReceiver(CascadeReceiver node); | 9 R visitCascadeReceiver(CascadeReceiver node); |
| 10 R visitCaseMatch(CaseMatch node); | 10 R visitCaseMatch(CaseMatch node); |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 receiver.asIdentifier() !== null && | 263 receiver.asIdentifier() !== null && |
| 264 receiver.asIdentifier().isSuper(); | 264 receiver.asIdentifier().isSuper(); |
| 265 } | 265 } |
| 266 bool get isOperator() => selector is Operator; | 266 bool get isOperator() => selector is Operator; |
| 267 bool get isPropertyAccess() => argumentsNode === null; | 267 bool get isPropertyAccess() => argumentsNode === null; |
| 268 bool get isFunctionObjectInvocation() => selector === null; | 268 bool get isFunctionObjectInvocation() => selector === null; |
| 269 bool get isPrefix() => argumentsNode is Prefix; | 269 bool get isPrefix() => argumentsNode is Prefix; |
| 270 bool get isPostfix() => argumentsNode is Postfix; | 270 bool get isPostfix() => argumentsNode is Postfix; |
| 271 bool get isIndex() => | 271 bool get isIndex() => |
| 272 isOperator && selector.asOperator().source.stringValue === '[]'; | 272 isOperator && selector.asOperator().source.stringValue === '[]'; |
| 273 bool get isCall() => !isOperator && !isPropertyAccess; |
| 273 | 274 |
| 274 Token getBeginToken() { | 275 Token getBeginToken() { |
| 275 if (isPrefix && !isIndex) return selector.getBeginToken(); | 276 if (isPrefix && !isIndex) return selector.getBeginToken(); |
| 276 return firstBeginToken(receiver, selector); | 277 return firstBeginToken(receiver, selector); |
| 277 } | 278 } |
| 278 | 279 |
| 279 Token getEndToken() { | 280 Token getEndToken() { |
| 280 if (isPrefix) { | 281 if (isPrefix) { |
| 281 if (receiver !== null) return receiver.getEndToken(); | 282 if (receiver !== null) return receiver.getEndToken(); |
| 282 if (selector !== null) return selector.getEndToken(); | 283 if (selector !== null) return selector.getEndToken(); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 * argument). | 1701 * argument). |
| 1701 * | 1702 * |
| 1702 * TODO(ahe): This method is controversial, the team needs to discuss | 1703 * TODO(ahe): This method is controversial, the team needs to discuss |
| 1703 * if top-level methods are acceptable and what naming conventions to | 1704 * if top-level methods are acceptable and what naming conventions to |
| 1704 * use. | 1705 * use. |
| 1705 */ | 1706 */ |
| 1706 initializerDo(Node node, f(Node node)) { | 1707 initializerDo(Node node, f(Node node)) { |
| 1707 SendSet send = node.asSendSet(); | 1708 SendSet send = node.asSendSet(); |
| 1708 if (send !== null) return f(send.arguments.head); | 1709 if (send !== null) return f(send.arguments.head); |
| 1709 } | 1710 } |
| OLD | NEW |