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

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

Issue 9600049: Use NodeList where possible. (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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 array literal value. 10 * Represents a Dart array literal value.
11 */ 11 */
12 public class DartArrayLiteral extends DartTypedLiteral { 12 public class DartArrayLiteral extends DartTypedLiteral {
13 13
14 private final List<DartExpression> expressions; 14 private final NodeList<DartExpression> expressions = NodeList.create(this);
15 15
16 public DartArrayLiteral(boolean isConst, List<DartTypeNode> typeArguments, 16 public DartArrayLiteral(boolean isConst, List<DartTypeNode> typeArguments,
17 List<DartExpression> expressions) { 17 List<DartExpression> expressions) {
18 super(isConst, typeArguments); 18 super(isConst, typeArguments);
19 this.expressions = becomeParentOf(expressions); 19 this.expressions.addAll(expressions);
20 } 20 }
21 21
22 public List<DartExpression> getExpressions() { 22 public List<DartExpression> getExpressions() {
23 return expressions; 23 return expressions;
24 } 24 }
25 25
26 @Override 26 @Override
27 public void visitChildren(ASTVisitor<?> visitor) { 27 public void visitChildren(ASTVisitor<?> visitor) {
28 super.visitChildren(visitor); 28 super.visitChildren(visitor);
29 visitor.visit(expressions); 29 expressions.accept(visitor);
30 } 30 }
31 31
32 @Override 32 @Override
33 public <R> R accept(ASTVisitor<R> visitor) { 33 public <R> R accept(ASTVisitor<R> visitor) {
34 return visitor.visitArrayLiteral(this); 34 return visitor.visitArrayLiteral(this);
35 } 35 }
36 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698