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

Side by Side Diff: frog/leg/elements/elements.dart

Issue 9632018: Switch-implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | frog/leg/resolver.dart » ('j') | frog/leg/resolver.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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'); 5 #library('elements');
6 6
7 #import('../tree/tree.dart'); 7 #import('../tree/tree.dart');
8 #import('../scanner/scannerlib.dart'); 8 #import('../scanner/scannerlib.dart');
9 #import('../leg.dart'); // TODO(karlklose): we only need type. 9 #import('../leg.dart'); // TODO(karlklose): we only need type.
10 #import('../util/util.dart'); 10 #import('../util/util.dart');
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 bool get isTarget() => isBreakTarget || isContinueTarget; 791 bool get isTarget() => isBreakTarget || isContinueTarget;
792 Node parseNode(DiagnosticListener l) => label; 792 Node parseNode(DiagnosticListener l) => label;
793 } 793 }
794 794
795 // Represents a reference to a statement, either a label or the 795 // Represents a reference to a statement, either a label or the
796 // default target of a break or continue. 796 // default target of a break or continue.
797 class StatementElement extends Element { 797 class StatementElement extends Element {
798 final Statement statement; 798 final Statement statement;
799 Link<LabelElement> labels = const EmptyLink<LabelElement>(); 799 Link<LabelElement> labels = const EmptyLink<LabelElement>();
800 LabelElement implicitLabel;
800 bool isBreakTarget = false; 801 bool isBreakTarget = false;
801 bool isContinueTarget = false; 802 bool isContinueTarget = false;
802 803
803 StatementElement(this.statement, Element enclosingElement) 804 StatementElement(this.statement, Element enclosingElement)
804 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement); 805 : super(const SourceString(""), ElementKind.STATEMENT, enclosingElement);
805 bool get isTarget() => isBreakTarget || isContinueTarget; 806 bool get isTarget() => isBreakTarget || isContinueTarget;
806 807
807 LabelElement addLabel(Identifier label, String labelName) { 808 LabelElement addLabel(Identifier label, String labelName) {
808 LabelElement result = new LabelElement(label, labelName, this, 809 LabelElement result = new LabelElement(label, labelName, this,
809 enclosingElement); 810 enclosingElement);
810 labels = labels.prepend(result); 811 labels = labels.prepend(result);
811 return result; 812 return result;
812 } 813 }
813 814
814 Node parseNode(DiagnosticListener l) => statement; 815 Node parseNode(DiagnosticListener l) => statement;
815 } 816 }
OLDNEW
« no previous file with comments | « no previous file | frog/leg/resolver.dart » ('j') | frog/leg/resolver.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698