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

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartSwitchMember.java

Issue 10824045: Fix for issue 3915 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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
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 package com.google.dart.compiler.ast; 5 package com.google.dart.compiler.ast;
6 6
7 import java.util.List; 7 import java.util.List;
8 8
9 /** 9 /**
10 * Represents a Dart 'switch' member ('case' or 'default'). 10 * Represents a Dart 'switch' member ('case' or 'default').
11 */ 11 */
12 public abstract class DartSwitchMember extends DartNode { 12 public abstract class DartSwitchMember extends DartNode {
13 13
14 private final NodeList<DartStatement> statements = NodeList.create(this); 14 private final NodeList<DartStatement> statements = NodeList.create(this);
15 private final DartLabel label; 15 private final NodeList<DartLabel> labels = NodeList.create(this);
16 16
17 public DartSwitchMember(DartLabel label, List<DartStatement> statements) { 17 public DartSwitchMember(List<DartLabel> labels, List<DartStatement> statements ) {
18 this.label = becomeParentOf(label); 18 this.labels.addAll(labels);
19 this.statements.addAll(statements); 19 this.statements.addAll(statements);
20 } 20 }
21 21
22 public List<DartStatement> getStatements() { 22 public List<DartStatement> getStatements() {
23 return statements; 23 return statements;
24 } 24 }
25 25
26 public DartLabel getLabel() { 26 public List<DartLabel> getLabels() {
27 return label; 27 return labels;
28 } 28 }
29 29
30 @Override 30 @Override
31 public void visitChildren(ASTVisitor<?> visitor) { 31 public void visitChildren(ASTVisitor<?> visitor) {
32 safelyVisitChild(label, visitor); 32 labels.accept(visitor);
33 statements.accept(visitor); 33 statements.accept(visitor);
34 } 34 }
35 } 35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698