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

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

Issue 12473003: Remove deprecated StringBuffer.add, addAll and addCharCode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 /// Translates a string of characters into a YAML serialization tree. 7 /// Translates a string of characters into a YAML serialization tree.
8 /// 8 ///
9 /// This parser is designed to closely follow the spec. All productions in the 9 /// This parser is designed to closely follow the spec. All productions in the
10 /// spec are numbered, and the corresponding methods in the parser have the same 10 /// spec are numbered, and the corresponding methods in the parser have the same
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 captureAndTransform(consumer(), String transformation(String captured)) { 340 captureAndTransform(consumer(), String transformation(String captured)) {
341 if (capturedString == null) return consumer(); 341 if (capturedString == null) return consumer();
342 if (capturingAs) return consumer(); 342 if (capturingAs) return consumer();
343 343
344 flushCapture(); 344 flushCapture();
345 capturingAs = true; 345 capturingAs = true;
346 var res = consumer(); 346 var res = consumer();
347 capturingAs = false; 347 capturingAs = false;
348 if (!truth(res)) return res; 348 if (!truth(res)) return res;
349 349
350 capturedString.add(transformation(s.substring(captureStart, pos))); 350 capturedString.write(transformation(s.substring(captureStart, pos)));
351 captureStart = pos; 351 captureStart = pos;
352 return res; 352 return res;
353 } 353 }
354 354
355 void flushCapture() { 355 void flushCapture() {
356 capturedString.add(s.substring(captureStart, pos)); 356 capturedString.write(s.substring(captureStart, pos));
357 captureStart = pos; 357 captureStart = pos;
358 } 358 }
359 359
360 /// Adds a tag and an anchor to [node], if they're defined. 360 /// Adds a tag and an anchor to [node], if they're defined.
361 _Node addProps(_Node node, _Pair<_Tag, String> props) { 361 _Node addProps(_Node node, _Pair<_Tag, String> props) {
362 if (props == null || node == null) return node; 362 if (props == null || node == null) return node;
363 if (truth(props.first)) node.tag = props.first; 363 if (truth(props.first)) node.tag = props.first;
364 if (truth(props.last)) node.anchor = props.last; 364 if (truth(props.last)) node.anchor = props.last;
365 return node; 365 return node;
366 } 366 }
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 var pair = contents[i]; 1930 var pair = contents[i];
1931 if (pair.first.contains(pos)) return pair.last; 1931 if (pair.first.contains(pos)) return pair.last;
1932 } 1932 }
1933 return null; 1933 return null;
1934 } 1934 }
1935 1935
1936 /// Associates [value] with [range]. 1936 /// Associates [value] with [range].
1937 operator[]=(_Range range, E value) => 1937 operator[]=(_Range range, E value) =>
1938 contents.add(new _Pair<_Range, E>(range, value)); 1938 contents.add(new _Pair<_Range, E>(range, value));
1939 } 1939 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698