Calculates the component-wise sum of two ranges.
Reduces the ranges to those no other one contains, keeping the first of any duplicates. Ranges that merely overlap are both kept, as neither contains the other. A non-empty input always yields a non-empty result.
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).
A non-empty input always yields a non-empty result: enclosure is a strict order so some node is always minimal, and a node carrying no range at all is kept rather than dropped.
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 reducing a set of ranges to those none of the others contains, 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, i.e. whether neither of them lies completely before the other.
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.