readWithSpans function

Stream<Tuple2<String, SourceSpanWithContext>> readWithSpans(
  1. String path
)

Like read, but includes source span information for each line in path that can be used to provide better error messages and easier debugging.

See LineAndSpanStreamExtensions.

Implementation

Stream<Tuple2<String, SourceSpanWithContext>> readWithSpans(String path) =>
    read(path).lines.withSpans(sourcePath: path);