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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 3009463002: Handle labelled continue statements (Closed)
Patch Set: Update comment Created 3 years, 3 months 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Identifiers; 8 import '../common/names.dart' show Identifiers;
9 import '../common/resolution.dart' show Resolution, ParsingContext; 9 import '../common/resolution.dart' show Resolution, ParsingContext;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after
3406 bool isContinueTarget = false; 3406 bool isContinueTarget = false;
3407 3407
3408 final int hashCode = ElementX.newHashCode(); 3408 final int hashCode = ElementX.newHashCode();
3409 3409
3410 JumpTargetX(this.statement, this.nestingLevel, this.executableContext); 3410 JumpTargetX(this.statement, this.nestingLevel, this.executableContext);
3411 3411
3412 @override 3412 @override
3413 MemberElement get memberContext => executableContext.memberContext; 3413 MemberElement get memberContext => executableContext.memberContext;
3414 3414
3415 LabelDefinition<Node> addLabel(Label label, String labelName, 3415 LabelDefinition<Node> addLabel(Label label, String labelName,
3416 {bool isBreakTarget: false}) { 3416 {bool isBreakTarget: false, bool isContinueTarget: false}) {
3417 LabelDefinitionX result = new LabelDefinitionX(label, labelName, this); 3417 LabelDefinitionX result = new LabelDefinitionX(label, labelName, this);
3418 labels.add(result); 3418 labels.add(result);
3419 if (isBreakTarget) { 3419 if (isBreakTarget) {
3420 result.setBreakTarget(); 3420 result.setBreakTarget();
3421 } 3421 }
3422 if (isContinueTarget) {
3423 result.setContinueTarget();
3424 }
3422 return result; 3425 return result;
3423 } 3426 }
3424 3427
3425 bool get isSwitch => statement is SwitchStatement; 3428 bool get isSwitch => statement is SwitchStatement;
3426 3429
3430 bool get isSwitchCase => statement is SwitchCase;
3431
3427 String toString() => 'Target:$statement'; 3432 String toString() => 'Target:$statement';
3428 } 3433 }
3429 3434
3430 class TypeVariableElementX extends ElementX 3435 class TypeVariableElementX extends ElementX
3431 with AstElementMixin 3436 with AstElementMixin
3432 implements TypeVariableElement { 3437 implements TypeVariableElement {
3433 final int index; 3438 final int index;
3434 final Node node; 3439 final Node node;
3435 ResolutionTypeVariableType typeCache; 3440 ResolutionTypeVariableType typeCache;
3436 ResolutionDartType boundCache; 3441 ResolutionDartType boundCache;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
3604 body = node.asFunctionExpression().body; 3609 body = node.asFunctionExpression().body;
3605 } 3610 }
3606 return new ParsedResolvedAst( 3611 return new ParsedResolvedAst(
3607 declaration, 3612 declaration,
3608 node, 3613 node,
3609 body, 3614 body,
3610 definingElement.treeElements, 3615 definingElement.treeElements,
3611 definingElement.compilationUnit.script.resourceUri); 3616 definingElement.compilationUnit.script.resourceUri);
3612 } 3617 }
3613 } 3618 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698