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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // 20 is the maximum value for this argument, which we use since YAML 143 // 20 is the maximum value for this argument, which we use since YAML
144 // doesn't specify a maximum. 144 // doesn't specify a maximum.
145 return value.toStringAsExponential(20). 145 return value.toStringAsExponential(20).
146 replaceFirst(new RegExp("0+e"), "e"); 146 replaceFirst(new RegExp("0+e"), "e");
147 } 147 }
148 148
149 if (value is String) { 149 if (value is String) {
150 // TODO(nweiz): This could be faster if we used a RegExp to check for 150 // TODO(nweiz): This could be faster if we used a RegExp to check for
151 // special characters and short-circuited if they didn't exist. 151 // special characters and short-circuited if they didn't exist.
152 152
153 var escapedValue = value.charCodes.map((c) { 153 var escapedValue = value.codeUnits.map((c) {
154 switch (c) { 154 switch (c) {
155 case _Parser.TAB: return "\\t"; 155 case _Parser.TAB: return "\\t";
156 case _Parser.LF: return "\\n"; 156 case _Parser.LF: return "\\n";
157 case _Parser.CR: return "\\r"; 157 case _Parser.CR: return "\\r";
158 case _Parser.DOUBLE_QUOTE: return '\\"'; 158 case _Parser.DOUBLE_QUOTE: return '\\"';
159 case _Parser.NULL: return "\\0"; 159 case _Parser.NULL: return "\\0";
160 case _Parser.BELL: return "\\a"; 160 case _Parser.BELL: return "\\a";
161 case _Parser.BACKSPACE: return "\\b"; 161 case _Parser.BACKSPACE: return "\\b";
162 case _Parser.VERTICAL_TAB: return "\\v"; 162 case _Parser.VERTICAL_TAB: return "\\v";
163 case _Parser.FORM_FEED: return "\\f"; 163 case _Parser.FORM_FEED: return "\\f";
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 var strContent = content.keys 225 var strContent = content.keys
226 .map((k) => '${k}: ${content[k]}') 226 .map((k) => '${k}: ${content[k]}')
227 .join(', '); 227 .join(', ');
228 return '$tag {$strContent}'; 228 return '$tag {$strContent}';
229 } 229 }
230 230
231 int get hashCode => super.hashCode ^ _hashCode(content); 231 int get hashCode => super.hashCode ^ _hashCode(content);
232 232
233 visit(_Visitor v) => v.visitMapping(this); 233 visit(_Visitor v) => v.visitMapping(this);
234 } 234 }
OLDNEW
« no previous file with comments | « pkg/yaml/lib/composer.dart ('k') | pkg/yaml/lib/parser.dart » ('j') | sdk/lib/core/string.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698