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 abstract class Visitor<R> { | 5 abstract class Visitor<R> { |
6 const Visitor(); | 6 const Visitor(); |
7 | 7 |
8 abstract R visitNode(Node node); | 8 abstract R visitNode(Node node); |
9 | 9 |
10 R visitBlock(Block node) => visitStatement(node); | 10 R visitBlock(Block node) => visitStatement(node); |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 } | 293 } |
294 | 294 |
295 int argumentCount() => (argumentsNode === null) ? -1 : argumentsNode.length(); | 295 int argumentCount() => (argumentsNode === null) ? -1 : argumentsNode.length(); |
296 | 296 |
297 bool get isSuperCall { | 297 bool get isSuperCall { |
298 return receiver !== null && | 298 return receiver !== null && |
299 receiver.asIdentifier() !== null && | 299 receiver.asIdentifier() !== null && |
300 receiver.asIdentifier().isSuper(); | 300 receiver.asIdentifier().isSuper(); |
301 } | 301 } |
302 bool get isOperator => selector is Operator; | 302 bool get isOperator => selector is Operator; |
303 bool get isPropertyAccess => argumentsNode === null; | 303 bool get isPropertyAccessOrTypeReference => argumentsNode === null; |
ahe
2012/10/08 09:13:42
I'm having a hard time seeing why this name is bet
ngeoffray
2012/10/10 07:32:24
I also prefer the original name.
karlklose
2012/10/23 10:33:52
I reverted that change.
| |
304 bool get isFunctionObjectInvocation => selector === null; | 304 bool get isFunctionObjectInvocation => selector === null; |
305 bool get isPrefix => argumentsNode is Prefix; | 305 bool get isPrefix => argumentsNode is Prefix; |
306 bool get isPostfix => argumentsNode is Postfix; | 306 bool get isPostfix => argumentsNode is Postfix; |
307 bool get isCall => !isOperator && !isPropertyAccess; | 307 bool get isCall => !isOperator && !isPropertyAccessOrTypeReference; |
308 bool get isIndex => | 308 bool get isIndex => |
309 isOperator && selector.asOperator().source.stringValue === '[]'; | 309 isOperator && selector.asOperator().source.stringValue === '[]'; |
310 bool get isLogicalAnd => | 310 bool get isLogicalAnd => |
311 isOperator && selector.asOperator().source.stringValue === '&&'; | 311 isOperator && selector.asOperator().source.stringValue === '&&'; |
312 bool get isLogicalOr => | 312 bool get isLogicalOr => |
313 isOperator && selector.asOperator().source.stringValue === '||'; | 313 isOperator && selector.asOperator().source.stringValue === '||'; |
314 bool get isParameterCheck => | 314 bool get isParameterCheck => |
315 isOperator && selector.asOperator().source.stringValue === '?'; | 315 isOperator && selector.asOperator().source.stringValue === '?'; |
316 | 316 |
317 Token getBeginToken() { | 317 Token getBeginToken() { |
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1976 * argument). | 1976 * argument). |
1977 * | 1977 * |
1978 * TODO(ahe): This method is controversial, the team needs to discuss | 1978 * TODO(ahe): This method is controversial, the team needs to discuss |
1979 * if top-level methods are acceptable and what naming conventions to | 1979 * if top-level methods are acceptable and what naming conventions to |
1980 * use. | 1980 * use. |
1981 */ | 1981 */ |
1982 initializerDo(Node node, f(Node node)) { | 1982 initializerDo(Node node, f(Node node)) { |
1983 SendSet send = node.asSendSet(); | 1983 SendSet send = node.asSendSet(); |
1984 if (send !== null) return f(send.arguments.head); | 1984 if (send !== null) return f(send.arguments.head); |
1985 } | 1985 } |
OLD | NEW |