state property

  1. @override
LineScannerState get state
override

The scanner's state, including line and column information.

This can be used to efficiently save and restore the state of the scanner when backtracking. A given LineScannerState is only valid for the LineScanner that created it.

This does not include the scanner's match information.

Implementation

@override
LineScannerState get state => _SpanScannerState(this, position);
  1. @override
set state (LineScannerState state)
override

Implementation

@override
set state(LineScannerState state) {
  if (state is! _SpanScannerState || !identical(state._scanner, this)) {
    throw ArgumentError('The given LineScannerState was not returned by '
        'this LineScanner.');
  }

  position = state.position;
}