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

Side by Side Diff: pkg/compiler/lib/src/resolution/resolution_result.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, 7 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.resolution.result; 5 library dart2js.resolution.result;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../dart_types.dart'; 8 import '../dart_types.dart';
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../tree/tree.dart'; 10 import '../tree/tree.dart';
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 /// Creates a result for the [constant] expression. [node] is provided for 84 /// Creates a result for the [constant] expression. [node] is provided for
85 /// error reporting on the constant and [element] is provided if the 85 /// error reporting on the constant and [element] is provided if the
86 /// expression additionally serves an [Element] like [ElementResult]. 86 /// expression additionally serves an [Element] like [ElementResult].
87 ConstantResult(this.node, this.constant, {this.element}); 87 ConstantResult(this.node, this.constant, {this.element});
88 88
89 bool get isConstant => true; 89 bool get isConstant => true;
90 90
91 ResultKind get kind => ResultKind.CONSTANT; 91 ResultKind get kind => ResultKind.CONSTANT;
92 92
93 String toString() => 'ConstantResult(${constant.getText()})'; 93 String toString() => 'ConstantResult(${constant.toDartText()})';
94 } 94 }
95 95
96 class NoneResult extends ResolutionResult { 96 class NoneResult extends ResolutionResult {
97 const NoneResult(); 97 const NoneResult();
98 98
99 ResultKind get kind => ResultKind.NONE; 99 ResultKind get kind => ResultKind.NONE;
100 100
101 String toString() => 'NoneResult()'; 101 String toString() => 'NoneResult()';
102 } 102 }
103 103
(...skipping 14 matching lines...) Expand all
118 118
119 /// Returns the list of [ConstantExpression]s for each of the arguments. If 119 /// Returns the list of [ConstantExpression]s for each of the arguments. If
120 /// [isValidAsConstant] is `false`, `null` is returned. 120 /// [isValidAsConstant] is `false`, `null` is returned.
121 List<ConstantExpression> get constantArguments { 121 List<ConstantExpression> get constantArguments {
122 if (!isValidAsConstant) return null; 122 if (!isValidAsConstant) return null;
123 return argumentResults.map((ResolutionResult result) { 123 return argumentResults.map((ResolutionResult result) {
124 return result.constant; 124 return result.constant;
125 }).toList(); 125 }).toList();
126 } 126 }
127 } 127 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/resolution/send_structure.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698