| Index: lib/src/span_scanner.dart
|
| diff --git a/lib/src/span_scanner.dart b/lib/src/span_scanner.dart
|
| index dd16e47cf06c39f3233f1c11e4412bca96954844..dd7f0e4f2e261b99b5265c161bdfa8e6e94081ff 100644
|
| --- a/lib/src/span_scanner.dart
|
| +++ b/lib/src/span_scanner.dart
|
| @@ -7,6 +7,7 @@ import 'package:source_span/source_span.dart';
|
| import 'eager_span_scanner.dart';
|
| import 'exception.dart';
|
| import 'line_scanner.dart';
|
| +import 'relative_span_scanner.dart';
|
| import 'string_scanner.dart';
|
| import 'utils.dart';
|
|
|
| @@ -69,6 +70,14 @@ class SpanScanner extends StringScanner implements LineScanner {
|
| factory SpanScanner.eager(String string, {sourceUrl, int position}) =
|
| EagerSpanScanner;
|
|
|
| + /// Creates a new [SpanScanner] that scans within [span].
|
| + ///
|
| + /// This scans through [span.text], but emits new spans from [span.file] in
|
| + /// their appropriate relative positions. The [string] field contains only
|
| + /// [span.text], and [position], [line], and [column] are all relative to the
|
| + /// span.
|
| + factory SpanScanner.within(FileSpan span) = RelativeSpanScanner;
|
| +
|
| /// Creates a [FileSpan] representing the source range between [startState]
|
| /// and the current position.
|
| FileSpan spanFrom(LineScannerState startState, [LineScannerState endState]) {
|
|
|