subspan method
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);
}