| 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 library elements; | 5 library elements; |
| 6 | 6 |
| 7 | 7 |
| 8 import 'modelx.dart'; | 8 import 'modelx.dart'; |
| 9 import '../tree/tree.dart'; | 9 import '../tree/tree.dart'; |
| 10 import '../util/util.dart'; | 10 import '../util/util.dart'; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 519 } |
| 520 | 520 |
| 521 static bool isGrowableListConstructorCall(Element element, | 521 static bool isGrowableListConstructorCall(Element element, |
| 522 Send node, | 522 Send node, |
| 523 Compiler compiler) { | 523 Compiler compiler) { |
| 524 return element == compiler.unnamedListConstructor | 524 return element == compiler.unnamedListConstructor |
| 525 && node.isCall | 525 && node.isCall |
| 526 && node.arguments.isEmpty; | 526 && node.arguments.isEmpty; |
| 527 } | 527 } |
| 528 | 528 |
| 529 static bool isFilledListConstructorCall(Element element, |
| 530 Send node, |
| 531 Compiler compiler) { |
| 532 return element == compiler.filledListConstructor |
| 533 && node.isCall |
| 534 && !node.arguments.isEmpty |
| 535 && !node.arguments.tail.isEmpty |
| 536 && node.arguments.tail.tail.isEmpty; |
| 537 } |
| 538 |
| 529 static bool switchStatementHasContinue(SwitchStatement node, | 539 static bool switchStatementHasContinue(SwitchStatement node, |
| 530 TreeElements elements) { | 540 TreeElements elements) { |
| 531 for (SwitchCase switchCase in node.cases) { | 541 for (SwitchCase switchCase in node.cases) { |
| 532 for (Node labelOrCase in switchCase.labelsAndCases) { | 542 for (Node labelOrCase in switchCase.labelsAndCases) { |
| 533 Node label = labelOrCase.asLabel(); | 543 Node label = labelOrCase.asLabel(); |
| 534 if (label != null) { | 544 if (label != null) { |
| 535 LabelElement labelElement = elements[label]; | 545 LabelElement labelElement = elements[label]; |
| 536 if (labelElement != null && labelElement.isContinueTarget) { | 546 if (labelElement != null && labelElement.isContinueTarget) { |
| 537 return true; | 547 return true; |
| 538 } | 548 } |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 int get resolutionState; | 924 int get resolutionState; |
| 915 Token get beginToken; | 925 Token get beginToken; |
| 916 Token get endToken; | 926 Token get endToken; |
| 917 | 927 |
| 918 // TODO(kasperl): Try to get rid of these. | 928 // TODO(kasperl): Try to get rid of these. |
| 919 void set annotatedElement(Element value); | 929 void set annotatedElement(Element value); |
| 920 void set resolutionState(int value); | 930 void set resolutionState(int value); |
| 921 | 931 |
| 922 MetadataAnnotation ensureResolved(Compiler compiler); | 932 MetadataAnnotation ensureResolved(Compiler compiler); |
| 923 } | 933 } |
| OLD | NEW |