spanFrom method Null safety

FileSpan spanFrom(
  1. LineScannerState startState,
  2. [LineScannerState? endState]
)

Creates a FileSpan representing the source range between startState and the current position.

Implementation

FileSpan spanFrom(LineScannerState startState, [LineScannerState? endState]) {
  final endPosition = endState == null ? position : endState.position;
  return _sourceFile.span(startState.position, endPosition);
}