Wrapper for location metadata. The location is essentially a pair of
(row,col) coordinates for some span of source code.
Useful for error messages, but hopefully for stuff like source maps etc. too.
Merge the regions of the two wrappers.
Replace the value inside the wrapper with another.
Empty, meaningless region. Used in tests or where you don't need the location info but need to appease the typesystem.
Merge the regions: the resulting region is always bigger or equal than the input regions.
mergeRegions <1:1 - 4:4> <2:2 - 3:3>
--> <1:1 - 4:4>The order doesn't matter:
mergeRegions <2:2 - 3:3> <1:1 - 4:4>
--> <1:1 - 4:4>One doesn't have to be a subset of the other:
mergeRegions <1:1 - 3:3> <2:2 - 4:4>
--> <1:1 - 4:4>There can be gaps in between
mergeRegions <1:1 - 2:2> <4:4 - 5:5>
--> <1:1 - 5:5>Transforms the record into something comparable.
Transforms the record into something comparable.
Compare using positionToComparable
Holds location metadata and some value.