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

Side by Side Diff: sdk/lib/convert/line_splitter.dart

Issue 2764943002: Fix some strong mode issues in the core libraries. (Closed)
Patch Set: Fix another type issue. Created 3 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
« no previous file with comments | « sdk/lib/convert/json.dart ('k') | sdk/lib/convert/utf.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) 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 // Character constants. 7 // Character constants.
8 const int _LF = 10; 8 const int _LF = 10;
9 const int _CR = 13; 9 const int _CR = 13;
10 10
11 /** 11 /**
12 * A [StreamTransformer] that splits a [String] into individual lines. 12 * A [StreamTransformer] that splits a [String] into individual lines.
13 * 13 *
14 * A line is terminated by either a CR (U+000D), a LF (U+000A), a 14 * A line is terminated by either a CR (U+000D), a LF (U+000A), a
15 * CR+LF sequence (DOS line ending), 15 * CR+LF sequence (DOS line ending),
16 * and a final non-empty line can be ended by the end of the string. 16 * and a final non-empty line can be ended by the end of the string.
17 * 17 *
18 * The returned lines do not contain the line terminators. 18 * The returned lines do not contain the line terminators.
19 */ 19 */
20 20
21 class LineSplitter extends Converter<String, List<String>> /*=Object*/ 21 class LineSplitter extends Converter<String, List<String>> /*=Object*/
22 implements 22 implements Object /*=StreamTransformer<String, String>*/ {
vsm 2017/03/22 13:39:11 Can we get rid of the comment syntax here yet?
floitsch 2017/03/22 13:46:28 No. These are incompatible. Removing the comment
23 ChunkedConverter<String, List<String>, String, String>
24 /*=StreamTransformer<String, String>*/ {
25 const LineSplitter(); 23 const LineSplitter();
26 24
27 /// Split [lines] into individual lines. 25 /// Split [lines] into individual lines.
28 /// 26 ///
29 /// If [start] and [end] are provided, only split the contents of 27 /// If [start] and [end] are provided, only split the contents of
30 /// `lines.substring(start, end)`. The [start] and [end] values must 28 /// `lines.substring(start, end)`. The [start] and [end] values must
31 /// specify a valid sub-range of [lines] 29 /// specify a valid sub-range of [lines]
32 /// (`0 <= start <= end <= lines.length`). 30 /// (`0 <= start <= end <= lines.length`).
33 static Iterable<String> split(String lines, [int start = 0, int end]) sync* { 31 static Iterable<String> split(String lines, [int start = 0, int end]) sync* {
34 end = RangeError.checkValidRange(start, end, lines.length); 32 end = RangeError.checkValidRange(start, end, lines.length);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 final EventSink<String> _eventSink; 168 final EventSink<String> _eventSink;
171 169
172 _LineSplitterEventSink(EventSink<String> eventSink) 170 _LineSplitterEventSink(EventSink<String> eventSink)
173 : _eventSink = eventSink, 171 : _eventSink = eventSink,
174 super(new StringConversionSink.from(eventSink)); 172 super(new StringConversionSink.from(eventSink));
175 173
176 void addError(Object o, [StackTrace stackTrace]) { 174 void addError(Object o, [StackTrace stackTrace]) {
177 _eventSink.addError(o, stackTrace); 175 _eventSink.addError(o, stackTrace);
178 } 176 }
179 } 177 }
OLDNEW
« no previous file with comments | « sdk/lib/convert/json.dart ('k') | sdk/lib/convert/utf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698