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

Side by Side Diff: test/generated_sdk/lib/convert/line_splitter.dart

Issue 1112403004: SDK fixes (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Formatting fix Created 5 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 dart.convert; 5 part of dart.convert;
6 6
7 /** 7 /**
8 * This class splits [String] values into individual lines. 8 * This class splits [String] values into individual lines.
9 */ 9 */
10 class LineSplitter extends Converter<String, List<String>> { 10 class LineSplitter extends Converter<String, List<String>> {
11 11
12 const LineSplitter(); 12 const LineSplitter();
13 13
14 List<String> convert(String data) { 14 List<String> convert(String data) {
15 var lines = new List<String>(); 15 var lines = new List<String>();
16 16
17 _LineSplitterSink._addSlice(data, 0, data.length, true, lines.add); 17 _LineSplitterSink._addSlice(data, 0, data.length, true, lines.add);
18 18
19 return lines; 19 return lines;
20 } 20 }
21 21
22 StringConversionSink startChunkedConversion(Sink<String> sink) { 22 StringConversionSink startChunkedConversion(Sink<dynamic> sink) {
23 if (sink is! StringConversionSink) { 23 if (sink is! StringConversionSink) {
24 sink = new StringConversionSink.from(sink); 24 sink = new StringConversionSink.from(sink);
25 } 25 }
26 return new _LineSplitterSink(sink); 26 return new _LineSplitterSink(sink);
27 } 27 }
28 } 28 }
29 29
30 // TODO(floitsch): deal with utf8. 30 // TODO(floitsch): deal with utf8.
31 class _LineSplitterSink extends StringConversionSinkBase { 31 class _LineSplitterSink extends StringConversionSinkBase {
32 static const int _LF = 10; 32 static const int _LF = 10;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 if (isLast) { 84 if (isLast) {
85 // Add remaining 85 // Add remaining
86 adder(carry); 86 adder(carry);
87 } else { 87 } else {
88 return carry; 88 return carry;
89 } 89 }
90 } 90 }
91 return null; 91 return null;
92 } 92 }
93 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698