SpanScanner.eager constructor

  1. String string,
  2. {dynamic sourceUrl,
  3. int? position}

Creates a new SpanScanner that eagerly computes line and column numbers.

In general will be more efficient, since it avoids extra computation on every scan. However, eager scanning can be useful for situations where the normal course of parsing frequently involves accessing the current line and column numbers.

Note that only the line and column fields on the SpanScanner itself and its LineScannerState are eagerly computed. To limit their memory footprint, returned spans and locations will still lazily compute their line and column numbers.


factory SpanScanner.eager(String string, {sourceUrl, int? position}) =