| 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 #import('../tree/tree.dart'); | 7 #import('../tree/tree.dart'); |
| 8 #import('../scanner/scannerlib.dart'); | 8 #import('../scanner/scannerlib.dart'); |
| 9 #import('../leg.dart'); // TODO(karlklose): we only need type. | 9 #import('../leg.dart'); // TODO(karlklose): we only need type. |
| 10 #import('../util/util.dart'); | 10 #import('../util/util.dart'); |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 790 |
| 791 bool get isTarget() => isBreakTarget || isContinueTarget; | 791 bool get isTarget() => isBreakTarget || isContinueTarget; |
| 792 Node parseNode(DiagnosticListener l) => label; | 792 Node parseNode(DiagnosticListener l) => label; |
| 793 } | 793 } |
| 794 | 794 |
| 795 // Represents a reference to a statement, either a label or the | 795 // Represents a reference to a statement, either a label or the |
| 796 // default target of a break or continue. | 796 // default target of a break or continue. |
| 797 class StatementElement extends Element { | 797 class StatementElement extends Element { |
| 798 final Statement statement; | 798 final Statement statement; |
| 799 Link<LabelElement> labels = const EmptyLink<LabelElement>(); | 799 Link<LabelElement> labels = const EmptyLink<LabelElement>(); |
| 800 LabelElement implicitLabel; |
| 800 bool isBreakTarget = false; | 801 bool isBreakTarget = false; |
| 801 bool isContinueTarget = false; | 802 bool isContinueTarget = false; |
| 802 | 803 |
| 803 StatementElement(this.statement, Element enclosingElement) | 804 StatementElement(this.statement, Element enclosingElement) |
| 804 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); | 805 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); |
| 805 bool get isTarget() => isBreakTarget || isContinueTarget; | 806 bool get isTarget() => isBreakTarget || isContinueTarget; |
| 806 | 807 |
| 807 LabelElement addLabel(Identifier label, String labelName) { | 808 LabelElement addLabel(Identifier label, String labelName) { |
| 808 LabelElement result = new LabelElement(label, labelName, this, | 809 LabelElement result = new LabelElement(label, labelName, this, |
| 809 enclosingElement); | 810 enclosingElement); |
| 810 labels = labels.prepend(result); | 811 labels = labels.prepend(result); |
| 811 return result; | 812 return result; |
| 812 } | 813 } |
| 813 | 814 |
| 814 Node parseNode(DiagnosticListener l) => statement; | 815 Node parseNode(DiagnosticListener l) => statement; |
| 815 } | 816 } |
| OLD | NEW |