Calculates the component-wise sum of two ranges.
Combines overlapping or subset ranges into a minimal set of ranges.
SourceRange.merge for merging multiple ranges into a single range.
Provides a comparator for SourceRanges that sorts them in ascending order.
a positive number if r1 comes after r2, a negative number if r1 comes before r2, and 0 if they are equal
Checks if a given position (line, column) is contained within the range.
Checks if two ranges are equal (i.e., they start and end at the same position).
Prints a range as a human-readable string.
Creates a source range from the given line and column numbers.
start line
start column
end line
end column
Returns the end position of a source range.
Returns the start position of a source range.
Collects all nodes satisfying the innermost condition: those containing no other of the given nodes.
Nodes may share a range (a function call and the symbol naming it do), so treatChildAsInner decides that
tie: with it, a node sharing its parent's range counts as the inner one and the parent drops out; without
it, both are kept and the caller may pick between them (e.g. by node type).
SourceRange.nodesContaining which this usually narrows down
Checks if the first range is a strict subset of the second range (i.e., it is a subset but not equal).
Checks if the first range is a subset of the second range.
Merges multiple source ranges into a single source range that spans from the earliest start to the latest end. If you are interested in combining overlapping ranges into a minimal set of ranges, see combineRanges.
Readonlyname: "SourceRange""Fuzzy" position match, as opposed to requiring a node to start exactly at the position.
Optionalcolumn: numberSourceRange.innermostNodes to narrow the result down to the deepest matches
Checks if the two ranges overlap.
true iff r1 starts and ends before r2 starts (i.e., if r1 and r2 do not overlap and r1 comes before r2
Utility functions for source ranges.