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
Prints a position as a human-readable string.
The range of the code a node spans, its own token's range if it has no full range.
SourceRange.ownFromNode - for the range of the token the node is made of
ReadonlygetEnd: Accessor<Returns the end position of a source range, or undefined if there is no range.
ReadonlygetEndColumn: Accessor<readonly [Line, Column, Line, Column, string | undefined], Column>Returns the end column of a source range, or undefined if there is no range.
ReadonlygetEndLine: Accessor<readonly [Line, Column, Line, Column, string | undefined], Line>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<readonly [Line, Column, Line, Column, string | undefined], Column>Returns the start column of a source range, or undefined if there is no range.
ReadonlygetStartLine: Accessor<readonly [Line, Column, Line, Column, string | undefined], Line>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
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: ColumnSourceRange.innermostNodes to narrow the result down to the deepest matches
The range of the token a node is made of (the <- of an assignment), the range it spans if it has no token of its own.
SourceRange.fromNode - for the range of the code the node spans
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.