LineAndSpanStreamExtensions extension

Extensions on Stream<Tuple2<String, SourceSpanWithContext>> that treat it as a stream of discrete lines associated with spans that indicate where the lines came from originally.

on

Properties

lines Stream<String>
Returns the stream of lines alone.
no setter
teeToStderr Stream<Tuple2<String, SourceSpanWithContext>>
Returns a stream that emits the same events as this one, but also prints each string to currentStderr.
no setter

Methods

grep(String regexp, {bool exclude = false, bool onlyMatching = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) Stream<Tuple2<String, SourceSpanWithContext>>
Returns the elements of this that match regexp.
mapLines(String callback(String line)) Stream<Tuple2<String, SourceSpanWithContext>>
Like Stream.map, but only applies the callback to the lines and not the spans.
replace(String regexp, String replacement, {bool all = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) Stream<Tuple2<String, SourceSpanWithContext>>
Replaces matches of regexp with replacement.
replaceMapped(String regexp, String replace(Match match), {bool all = false, bool caseSensitive = true, bool unicode = false, bool dotAll = false}) Stream<Tuple2<String, SourceSpanWithContext>>
Replaces matches of regexp with the result of calling replace.