OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.resolution.label_scope; | 5 library dart2js.resolution.label_scope; |
6 | 6 |
7 import '../elements/elements.dart' show JumpTarget, LabelDefinition; | 7 import '../elements/jumps.dart'; |
8 import '../util/util.dart' show Link; | 8 import '../util/util.dart' show Link; |
9 | 9 |
10 abstract class LabelScope { | 10 abstract class LabelScope { |
11 LabelScope get outer; | 11 LabelScope get outer; |
12 LabelDefinition lookup(String label); | 12 LabelDefinition lookup(String label); |
13 } | 13 } |
14 | 14 |
15 class LabeledStatementLabelScope implements LabelScope { | 15 class LabeledStatementLabelScope implements LabelScope { |
16 final LabelScope outer; | 16 final LabelScope outer; |
17 final Map<String, LabelDefinition> labels; | 17 final Map<String, LabelDefinition> labels; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 labels = new SwitchLabelScope(labels, continueElements); | 95 labels = new SwitchLabelScope(labels, continueElements); |
96 nestingLevel++; | 96 nestingLevel++; |
97 } | 97 } |
98 | 98 |
99 void exitSwitch() { | 99 void exitSwitch() { |
100 nestingLevel--; | 100 nestingLevel--; |
101 breakTargetStack = breakTargetStack.tail; | 101 breakTargetStack = breakTargetStack.tail; |
102 labels = labels.outer; | 102 labels = labels.outer; |
103 } | 103 } |
104 } | 104 } |
OLD | NEW |