intersects method
Return true if this source range intersects the otherRange.
Implementation
bool intersects(SourceRange? otherRange) {
if (otherRange == null) {
return false;
}
if (end <= otherRange.offset) {
return false;
}
if (offset >= otherRange.end) {
return false;
}
return true;
}