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. Omitting the column checks whether the line is covered at all.
Optionalcolumn: numberChecks if two ranges are equal (i.e., they start and end at the same position).
Prints a range as a human-readable string.
Prints a position as a human-readable string.
Creates a source range from the given line and column numbers.
start line
start column
end line
end column
ReadonlygetEnd: Accessor<Returns the end position of a source range, or undefined if there is no range.
ReadonlygetEndColumn: Accessor<Returns the end column of a source range, or undefined if there is no range.
ReadonlygetEndLine: Accessor<Returns the end line of a source range, or undefined if there is no range.
ReadonlygetStart: Accessor<Returns the start position of a source range, or undefined if there is no range.
ReadonlygetStartColumn: Accessor<Returns the start column of a source range, or undefined if there is no range.
ReadonlygetStartLine: Accessor<Returns the start line of a source range, or undefined if there is no 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
Whether the range starts and ends on the same line.
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.
Whether the range is a real one, i.e., not the invalid range and not absent.
The number of lines the range spans (always at least 1 for a valid 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
Readonlyview: Accessor<Wraps the range in a view offering property access (range.startLine) and methods.
The view does not copy the tuple; see SourceLocationView for when to use it.
Utility functions for source ranges.