subspan method

FileSpan subspan(
  1. int start, [
  2. int? end
])

See SourceSpanExtension.subspan.

Implementation

FileSpan subspan(int start, [int? end]) {
  RangeError.checkValidRange(start, end, length);
  if (start == 0 && (end == null || end == length)) return this;

  final startOffset = this.start.offset;
  return file.span(
      startOffset + start, end == null ? this.end.offset : startOffset + end);
}