compareTo method

int compareTo (SourceLocation other)
override

Compares two locations.

other must have the same source URL as this.

Implementation

int compareTo(SourceLocation other) {
  if (sourceUrl != other.sourceUrl) {
    throw new ArgumentError("Source URLs \"${sourceUrl}\" and "
        "\"${other.sourceUrl}\" don't match.");
  }
  return offset - other.offset;
}