OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 dart2js.constants.expressions; | 5 library dart2js.constants.expressions; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../constants/constant_system.dart'; | 8 import '../constants/constant_system.dart'; |
9 import '../common_elements.dart'; | 9 import '../common_elements.dart'; |
10 import '../elements/types.dart'; | 10 import '../elements/types.dart'; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 ConstantExpressionKind get kind => ConstantExpressionKind.SYNTHETIC; | 191 ConstantExpressionKind get kind => ConstantExpressionKind.SYNTHETIC; |
192 | 192 |
193 @override | 193 @override |
194 bool get isImplicit => false; | 194 bool get isImplicit => false; |
195 } | 195 } |
196 | 196 |
197 /// A boolean, int, double, string, or null constant. | 197 /// A boolean, int, double, string, or null constant. |
198 abstract class PrimitiveConstantExpression extends ConstantExpression { | 198 abstract class PrimitiveConstantExpression extends ConstantExpression { |
199 /// The primitive value of this contant expression. | 199 /// The primitive value of this constant expression. |
200 get primitiveValue; | 200 get primitiveValue; |
201 } | 201 } |
202 | 202 |
203 /// Boolean literal constant. | 203 /// Boolean literal constant. |
204 class BoolConstantExpression extends PrimitiveConstantExpression { | 204 class BoolConstantExpression extends PrimitiveConstantExpression { |
205 final bool primitiveValue; | 205 final bool primitiveValue; |
206 | 206 |
207 BoolConstantExpression(this.primitiveValue); | 207 BoolConstantExpression(this.primitiveValue); |
208 | 208 |
209 ConstantExpressionKind get kind => ConstantExpressionKind.BOOL; | 209 ConstantExpressionKind get kind => ConstantExpressionKind.BOOL; |
(...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1936 visit(exp.name); | 1936 visit(exp.name); |
1937 if (exp.defaultValue != null) { | 1937 if (exp.defaultValue != null) { |
1938 sb.write(', defaultValue: '); | 1938 sb.write(', defaultValue: '); |
1939 visit(exp.defaultValue); | 1939 visit(exp.defaultValue); |
1940 } | 1940 } |
1941 sb.write(')'); | 1941 sb.write(')'); |
1942 } | 1942 } |
1943 | 1943 |
1944 String toString() => sb.toString(); | 1944 String toString() => sb.toString(); |
1945 } | 1945 } |
OLD | NEW |