Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 part of js; | 5 part of js; |
| 6 | 6 |
| 7 abstract class NodeVisitor<T> { | 7 abstract class NodeVisitor<T> { |
| 8 T visitProgram(Program node); | 8 T visitProgram(Program node); |
| 9 | 9 |
| 10 T visitBlock(Block node); | 10 T visitBlock(Block node); |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 918 | 918 |
| 919 accept(NodeVisitor visitor) => visitor.visitArrayElement(this); | 919 accept(NodeVisitor visitor) => visitor.visitArrayElement(this); |
| 920 | 920 |
| 921 void visitChildren(NodeVisitor visitor) { | 921 void visitChildren(NodeVisitor visitor) { |
| 922 value.accept(visitor); | 922 value.accept(visitor); |
| 923 } | 923 } |
| 924 } | 924 } |
| 925 | 925 |
| 926 class ObjectInitializer extends Expression { | 926 class ObjectInitializer extends Expression { |
| 927 List<Property> properties; | 927 List<Property> properties; |
| 928 bool isOneLiner; | |
| 928 | 929 |
| 929 ObjectInitializer(this.properties); | 930 /** |
| 931 * Constructs a new object-initializer containing the given properties. | |
|
ahe
2013/11/21 08:30:05
properties -> [properties].
sigurdm
2013/11/21 10:22:19
Done.
| |
| 932 * | |
| 933 * [isOneLiner] describes the behaviour when pretty-printing (non-minified). | |
| 934 * If true print all properties on the same line. | |
| 935 * If false print each property on a seperate line. | |
| 936 */ | |
| 937 ObjectInitializer(this.properties, {this.isOneLiner: true}); | |
| 930 | 938 |
| 931 accept(NodeVisitor visitor) => visitor.visitObjectInitializer(this); | 939 accept(NodeVisitor visitor) => visitor.visitObjectInitializer(this); |
| 932 | 940 |
| 933 void visitChildren(NodeVisitor visitor) { | 941 void visitChildren(NodeVisitor visitor) { |
| 934 for (Property init in properties) init.accept(visitor); | 942 for (Property init in properties) init.accept(visitor); |
| 935 } | 943 } |
| 936 | 944 |
| 937 int get precedenceLevel => PRIMARY; | 945 int get precedenceLevel => PRIMARY; |
| 938 } | 946 } |
| 939 | 947 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1008 */ | 1016 */ |
| 1009 class Comment extends Statement { | 1017 class Comment extends Statement { |
| 1010 final String comment; | 1018 final String comment; |
| 1011 | 1019 |
| 1012 Comment(this.comment); | 1020 Comment(this.comment); |
| 1013 | 1021 |
| 1014 accept(NodeVisitor visitor) => visitor.visitComment(this); | 1022 accept(NodeVisitor visitor) => visitor.visitComment(this); |
| 1015 | 1023 |
| 1016 void visitChildren(NodeVisitor visitor) {} | 1024 void visitChildren(NodeVisitor visitor) {} |
| 1017 } | 1025 } |
| OLD | NEW |