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

Side by Side Diff: pkg/compiler/lib/src/serialization/constant_serialization.dart

Issue 1916053003: Add toStructuredText to ConstantExpression and align method names with ConstantValue (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 years, 8 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
OLDNEW
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 library dart2js.serialization.constants; 5 library dart2js.serialization.constants;
6 6
7 import '../constants/constructors.dart'; 7 import '../constants/constructors.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart' show FieldElement; 10 import '../elements/elements.dart' show FieldElement;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 @override 164 @override
165 void visitStringLength( 165 void visitStringLength(
166 StringLengthConstantExpression exp, ObjectEncoder encoder) { 166 StringLengthConstantExpression exp, ObjectEncoder encoder) {
167 encoder.setConstant(Key.EXPRESSION, exp.expression); 167 encoder.setConstant(Key.EXPRESSION, exp.expression);
168 } 168 }
169 169
170 @override 170 @override
171 void visitDeferred(DeferredConstantExpression exp, ObjectEncoder encoder) { 171 void visitDeferred(DeferredConstantExpression exp, ObjectEncoder encoder) {
172 throw new UnsupportedError( 172 throw new UnsupportedError(
173 "ConstantSerializer.visitDeferred: ${exp.getText()}"); 173 "ConstantSerializer.visitDeferred: ${exp.toDartText()}");
174 } 174 }
175 } 175 }
176 176
177 /// Utility class for deserializing [ConstantExpression]s. 177 /// Utility class for deserializing [ConstantExpression]s.
178 /// 178 ///
179 /// This is used by the [Deserializer]. 179 /// This is used by the [Deserializer].
180 class ConstantDeserializer { 180 class ConstantDeserializer {
181 /// Deserializes a [ConstantExpression] from an [ObjectDecoder]. 181 /// Deserializes a [ConstantExpression] from an [ObjectDecoder].
182 /// 182 ///
183 /// The class is called from the [Deserializer] when a [ConstantExpression] 183 /// The class is called from the [Deserializer] when a [ConstantExpression]
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 readFields(), readConstructorInvocation()); 390 readFields(), readConstructorInvocation());
391 case ConstantConstructorKind.REDIRECTING_GENERATIVE: 391 case ConstantConstructorKind.REDIRECTING_GENERATIVE:
392 return new RedirectingGenerativeConstantConstructor( 392 return new RedirectingGenerativeConstantConstructor(
393 readDefaults(), readConstructorInvocation()); 393 readDefaults(), readConstructorInvocation());
394 case ConstantConstructorKind.REDIRECTING_FACTORY: 394 case ConstantConstructorKind.REDIRECTING_FACTORY:
395 return new RedirectingFactoryConstantConstructor( 395 return new RedirectingFactoryConstantConstructor(
396 readConstructorInvocation()); 396 readConstructorInvocation());
397 } 397 }
398 } 398 }
399 } 399 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_structure.dart ('k') | pkg/compiler/lib/src/serialization/json_serializer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698