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

Side by Side Diff: pkg/yaml/lib/model.dart

Issue 13956006: Remove insertRange. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebuild DOM (unrelated CL) and update status files. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | pkg/yaml/lib/parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 yaml; 5 part of yaml;
6 6
7 // This file contains the node classes for the internal representations of YAML 7 // This file contains the node classes for the internal representations of YAML
8 // documents. These nodes are used for both the serialization tree and the 8 // documents. These nodes are used for both the serialization tree and the
9 // representation graph. 9 // representation graph.
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 throw new YamlException("unknown scalar value: $value"); 184 throw new YamlException("unknown scalar value: $value");
185 } 185 }
186 186
187 String toString() => '$tag "$content"'; 187 String toString() => '$tag "$content"';
188 188
189 /// Left-pads [str] with zeros so that it's at least [length] characters 189 /// Left-pads [str] with zeros so that it's at least [length] characters
190 /// long. 190 /// long.
191 String zeroPad(String str, int length) { 191 String zeroPad(String str, int length) {
192 assert(length >= str.length); 192 assert(length >= str.length);
193 var prefix = []; 193 var prefix = new List.filled(length - str.length, '0');
194 prefix.insertRange(0, length - str.length, '0');
195 return '${prefix.join()}$str'; 194 return '${prefix.join()}$str';
196 } 195 }
197 196
198 int get hashCode => super.hashCode ^ content.hashCode; 197 int get hashCode => super.hashCode ^ content.hashCode;
199 198
200 visit(_Visitor v) => v.visitScalar(this); 199 visit(_Visitor v) => v.visitScalar(this);
201 } 200 }
202 201
203 /// A mapping node represents an unordered map of nodes to nodes. 202 /// A mapping node represents an unordered map of nodes to nodes.
204 class _MappingNode extends _Node { 203 class _MappingNode extends _Node {
(...skipping 19 matching lines...) Expand all
224 var strContent = content.keys 223 var strContent = content.keys
225 .map((k) => '${k}: ${content[k]}') 224 .map((k) => '${k}: ${content[k]}')
226 .join(', '); 225 .join(', ');
227 return '$tag {$strContent}'; 226 return '$tag {$strContent}';
228 } 227 }
229 228
230 int get hashCode => super.hashCode ^ _hashCode(content); 229 int get hashCode => super.hashCode ^ _hashCode(content);
231 230
232 visit(_Visitor v) => v.visitMapping(this); 231 visit(_Visitor v) => v.visitMapping(this);
233 } 232 }
OLDNEW
« no previous file with comments | « pkg/unittest/lib/mock.dart ('k') | pkg/yaml/lib/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698