OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Class hiarchy for semantic wrapping of serializable values. | 5 /// Class hiarchy for semantic wrapping of serializable values. |
6 | 6 |
7 library dart2js.serialization.values; | 7 library dart2js.serialization.values; |
8 | 8 |
9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } | 60 } |
61 | 61 |
62 class ConstantValue implements Value { | 62 class ConstantValue implements Value { |
63 final ConstantExpression constant; | 63 final ConstantExpression constant; |
64 final Value id; | 64 final Value id; |
65 | 65 |
66 ConstantValue(this.constant, this.id); | 66 ConstantValue(this.constant, this.id); |
67 | 67 |
68 accept(ValueVisitor visitor, arg) => visitor.visitConstant(this, arg); | 68 accept(ValueVisitor visitor, arg) => visitor.visitConstant(this, arg); |
69 | 69 |
70 String toString() => constant.getText(); | 70 String toString() => constant.toDartText(); |
71 } | 71 } |
72 | 72 |
73 abstract class PrimitiveValue implements Value { | 73 abstract class PrimitiveValue implements Value { |
74 get value; | 74 get value; |
75 | 75 |
76 String toString() => value.toString(); | 76 String toString() => value.toString(); |
77 } | 77 } |
78 | 78 |
79 class BoolValue extends PrimitiveValue { | 79 class BoolValue extends PrimitiveValue { |
80 final bool value; | 80 final bool value; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 R visitBool(BoolValue value, A arg); | 169 R visitBool(BoolValue value, A arg); |
170 R visitInt(IntValue value, A arg); | 170 R visitInt(IntValue value, A arg); |
171 R visitDouble(DoubleValue value, A arg); | 171 R visitDouble(DoubleValue value, A arg); |
172 R visitString(StringValue value, A arg); | 172 R visitString(StringValue value, A arg); |
173 R visitObject(ObjectValue value, A arg); | 173 R visitObject(ObjectValue value, A arg); |
174 R visitMap(MapValue value, A arg); | 174 R visitMap(MapValue value, A arg); |
175 R visitList(ListValue value, A arg); | 175 R visitList(ListValue value, A arg); |
176 R visitEnum(EnumValue value, A arg); | 176 R visitEnum(EnumValue value, A arg); |
177 R visitUri(UriValue value, A arg); | 177 R visitUri(UriValue value, A arg); |
178 } | 178 } |
OLD | NEW |