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

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

Issue 2581143003: implement LabeledStatement and Break in kernel (Closed)
Patch Set: fix some tests Created 4 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
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 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 3202
3203 bool get isTarget => isBreakTarget || isContinueTarget; 3203 bool get isTarget => isBreakTarget || isContinueTarget;
3204 3204
3205 String toString() => 'Label:${name}'; 3205 String toString() => 'Label:${name}';
3206 } 3206 }
3207 3207
3208 class JumpTargetX implements JumpTarget { 3208 class JumpTargetX implements JumpTarget {
3209 final ExecutableElement executableContext; 3209 final ExecutableElement executableContext;
3210 final Node statement; 3210 final Node statement;
3211 final int nestingLevel; 3211 final int nestingLevel;
3212 Link<LabelDefinition> labels = const Link<LabelDefinition>(); 3212 List<LabelDefinition> labels = <LabelDefinition>[];
3213 bool isBreakTarget = false; 3213 bool isBreakTarget = false;
3214 bool isContinueTarget = false; 3214 bool isContinueTarget = false;
3215 3215
3216 final int hashCode = ElementX.newHashCode(); 3216 final int hashCode = ElementX.newHashCode();
3217 3217
3218 JumpTargetX(this.statement, this.nestingLevel, this.executableContext); 3218 JumpTargetX(this.statement, this.nestingLevel, this.executableContext);
3219 3219
3220 String get name => "target"; 3220 String get name => "target";
3221 3221
3222 bool get isTarget => isBreakTarget || isContinueTarget; 3222 bool get isTarget => isBreakTarget || isContinueTarget;
3223 3223
3224 LabelDefinition addLabel(Label label, String labelName) { 3224 LabelDefinition addLabel(Label label, String labelName) {
3225 LabelDefinition result = new LabelDefinitionX(label, labelName, this); 3225 LabelDefinition result = new LabelDefinitionX(label, labelName, this);
3226 labels = labels.prepend(result); 3226 labels.add(result);
Siggi Cherem (dart-lang) 2016/12/17 00:43:16 It seems the order after this change will be rever
Harry Terkelsen 2016/12/17 00:50:36 The order doesn't matter because they are all labe
3227 return result; 3227 return result;
3228 } 3228 }
3229 3229
3230 bool get isSwitch => statement is SwitchStatement; 3230 bool get isSwitch => statement is SwitchStatement;
3231 3231
3232 String toString() => 'Target:$statement'; 3232 String toString() => 'Target:$statement';
3233 } 3233 }
3234 3234
3235 class TypeVariableElementX extends ElementX 3235 class TypeVariableElementX extends ElementX
3236 with AstElementMixin 3236 with AstElementMixin
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
3414 body = node.asFunctionExpression().body; 3414 body = node.asFunctionExpression().body;
3415 } 3415 }
3416 return new ParsedResolvedAst( 3416 return new ParsedResolvedAst(
3417 declaration, 3417 declaration,
3418 node, 3418 node,
3419 body, 3419 body,
3420 definingElement.treeElements, 3420 definingElement.treeElements,
3421 definingElement.compilationUnit.script.resourceUri); 3421 definingElement.compilationUnit.script.resourceUri);
3422 } 3422 }
3423 } 3423 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/js_backend/mirrors_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698