| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 engine.resolver.element_resolver; | 5 library engine.resolver.element_resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'ast.dart'; | 9 import 'ast.dart'; |
| 10 import 'element.dart'; | 10 import 'element.dart'; |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 /** | 1576 /** |
| 1577 * Return the target of a break or continue statement, and update the static | 1577 * Return the target of a break or continue statement, and update the static |
| 1578 * element of its label (if any). [parentNode] is the AST node of the break | 1578 * element of its label (if any). [parentNode] is the AST node of the break |
| 1579 * or continue statement, [labelNode] is the label contained in that | 1579 * or continue statement, [labelNode] is the label contained in that |
| 1580 * statement (if any), and [isContinue] is true if the node being visited is | 1580 * statement (if any), and [isContinue] is true if the node being visited is |
| 1581 * a continue statement. | 1581 * a continue statement. |
| 1582 */ | 1582 */ |
| 1583 AstNode _lookupBreakOrContinueTarget(AstNode parentNode, | 1583 AstNode _lookupBreakOrContinueTarget(AstNode parentNode, |
| 1584 SimpleIdentifier labelNode, bool isContinue) { | 1584 SimpleIdentifier labelNode, bool isContinue) { |
| 1585 if (labelNode == null) { | 1585 if (labelNode == null) { |
| 1586 return _resolver.getUnlabeledBreakOrContinueTarget(isContinue); | 1586 return _resolver.implicitLabelScope.getTarget(isContinue); |
| 1587 } else { | 1587 } else { |
| 1588 LabelScope labelScope = _resolver.labelScope; | 1588 LabelScope labelScope = _resolver.labelScope; |
| 1589 if (labelScope == null) { | 1589 if (labelScope == null) { |
| 1590 // There are no labels in scope, so by definition the label is | 1590 // There are no labels in scope, so by definition the label is |
| 1591 // undefined. | 1591 // undefined. |
| 1592 _resolver.reportErrorForNode( | 1592 _resolver.reportErrorForNode( |
| 1593 CompileTimeErrorCode.LABEL_UNDEFINED, | 1593 CompileTimeErrorCode.LABEL_UNDEFINED, |
| 1594 labelNode, | 1594 labelNode, |
| 1595 [labelNode.name]); | 1595 [labelNode.name]); |
| 1596 return null; | 1596 return null; |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3063 @override | 3063 @override |
| 3064 Element get staticElement => null; | 3064 Element get staticElement => null; |
| 3065 | 3065 |
| 3066 @override | 3066 @override |
| 3067 accept(AstVisitor visitor) => null; | 3067 accept(AstVisitor visitor) => null; |
| 3068 | 3068 |
| 3069 @override | 3069 @override |
| 3070 void visitChildren(AstVisitor visitor) { | 3070 void visitChildren(AstVisitor visitor) { |
| 3071 } | 3071 } |
| 3072 } | 3072 } |
| OLD | NEW |