state property Null safety

LineScannerState state

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.


LineScannerState get state =>
    LineScannerState._(this, position, line, column);
void state=(LineScannerState state)


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

  super.position = state.position;
  _line = state.line;
  _column = state.column;