Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: pkg/analyzer/lib/src/generated/element_resolver.dart

Issue 758103002: Clean up resolution of unlabeled break/continue targets. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698