operator <= method
Whether this location is earlier in the file than other
, or equal to
other
.
Can only be used to compare locations in the same source.
Implementation
bool operator <=(SourceLocation other) {
if (source != other.source) {
throw StateError('Cannot compare locations from different sources.');
}
return offset <= other.offset;
}