| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 bool get isCall => !isOperator && !isPropertyAccess; | 362 bool get isCall => !isOperator && !isPropertyAccess; |
| 363 bool get isIndex => | 363 bool get isIndex => |
| 364 isOperator && identical(selector.asOperator().source.stringValue, '[]'); | 364 isOperator && identical(selector.asOperator().source.stringValue, '[]'); |
| 365 bool get isLogicalAnd => | 365 bool get isLogicalAnd => |
| 366 isOperator && identical(selector.asOperator().source.stringValue, '&&'); | 366 isOperator && identical(selector.asOperator().source.stringValue, '&&'); |
| 367 bool get isLogicalOr => | 367 bool get isLogicalOr => |
| 368 isOperator && identical(selector.asOperator().source.stringValue, '||'); | 368 isOperator && identical(selector.asOperator().source.stringValue, '||'); |
| 369 bool get isParameterCheck => | 369 bool get isParameterCheck => |
| 370 isOperator && identical(selector.asOperator().source.stringValue, '?'); | 370 isOperator && identical(selector.asOperator().source.stringValue, '?'); |
| 371 | 371 |
| 372 bool get isIsCheck { |
| 373 return isOperator |
| 374 && identical(selector.asOperator().source.stringValue, 'is') |
| 375 && arguments.head.asSend() == null; |
| 376 } |
| 377 |
| 372 bool get isIsNotCheck { | 378 bool get isIsNotCheck { |
| 373 return isOperator | 379 return isOperator |
| 374 && identical(selector.asOperator().source.stringValue, 'is') | 380 && identical(selector.asOperator().source.stringValue, 'is') |
| 375 && arguments.head.asSend() != null; | 381 && arguments.head.asSend() != null; |
| 376 } | 382 } |
| 377 | 383 |
| 378 TypeAnnotation get typeAnnotationFromIsCheck { | 384 TypeAnnotation get typeAnnotationFromIsCheck { |
| 379 assert(isOperator | 385 assert(isOperator |
| 380 && identical(selector.asOperator().source.stringValue, 'is')); | 386 && identical(selector.asOperator().source.stringValue, 'is')); |
| 381 return isIsNotCheck | 387 return isIsNotCheck |
| (...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2100 * argument). | 2106 * argument). |
| 2101 * | 2107 * |
| 2102 * TODO(ahe): This method is controversial, the team needs to discuss | 2108 * TODO(ahe): This method is controversial, the team needs to discuss |
| 2103 * if top-level methods are acceptable and what naming conventions to | 2109 * if top-level methods are acceptable and what naming conventions to |
| 2104 * use. | 2110 * use. |
| 2105 */ | 2111 */ |
| 2106 initializerDo(Node node, f(Node node)) { | 2112 initializerDo(Node node, f(Node node)) { |
| 2107 SendSet send = node.asSendSet(); | 2113 SendSet send = node.asSendSet(); |
| 2108 if (send != null) return f(send.arguments.head); | 2114 if (send != null) return f(send.arguments.head); |
| 2109 } | 2115 } |
| OLD | NEW |