SpanScanner constructor

SpanScanner(
  1. String string, {
  2. Object? sourceUrl,
  3. int? position,
})

Creates a new SpanScanner that starts scanning from position.

sourceUrl is used as SourceLocation.sourceUrl for the returned FileSpans as well as for error reporting. It can be a String, a Uri, or null.

Implementation

SpanScanner(super.string, {super.sourceUrl, super.position})
    : _sourceFile = SourceFile.fromString(string, url: sourceUrl);