@eagleoutice/flowr - v2.13.14
    Preparing search index...

    Variable SourceRange

    SourceRange: {
        add(
            this: void,
            __namedParameters: SourceRange,
            __namedParameters: SourceRange,
        ): SourceRange;
        combineRanges(this: void, ...ranges: SourceRange[]): SourceRange[];
        compare(
            this: void,
            __namedParameters: SourceRange,
            __namedParameters: SourceRange,
        ): number;
        containsPosition(
            this: void,
            __namedParameters: SourceRange,
            line: number,
            column: number,
        ): boolean;
        equals(
            this: void,
            __namedParameters: SourceRange,
            __namedParameters: SourceRange,
        ): boolean;
        format(this: void, range: SourceRange | undefined): string;
        from(
            this: void,
            sl: string | number,
            sc: string | number,
            el?: string | number,
            ec?: string | number,
        ): SourceRange;
        fromNode<OtherInfo>(
            this: void,
            node: RNode<OtherInfo> | undefined,
        ): SourceRange | undefined;
        getEnd(this: void, range: SourceRange): SourcePosition;
        getEndLine(this: void, range: SourceRange): number;
        getStart(this: void, range: SourceRange): SourcePosition;
        getStartLine(this: void, range: SourceRange): number;
        innermostNodes<OtherInfo>(
            this: void,
            nodes: readonly RNodeWithParent<OtherInfo>[],
            treatChildAsInner?: boolean,
        ): RNodeWithParent<OtherInfo>[];
        invalid(this: void): SourceRange;
        isStrictSubsetOf(this: void, r1: SourceRange, r2: SourceRange): boolean;
        isSubsetOf(
            this: void,
            __namedParameters: SourceRange,
            __namedParameters: SourceRange,
        ): boolean;
        merge(this: void, rs: (SourceRange | undefined)[]): SourceRange;
        name: "SourceRange";
        nodesContaining<OtherInfo>(
            this: void,
            nodes: readonly RNodeWithParent<OtherInfo>[],
            line: number,
            column?: number,
        ): RNodeWithParent<OtherInfo>[];
        overlap(this: void, r1: SourceRange, r2: SourceRange): boolean;
        startsCompletelyBefore(
            this: void,
            __namedParameters: SourceRange,
            __namedParameters: SourceRange,
        ): boolean;
    }

    Utility functions for source ranges.

    Type Declaration

    • add: function
    • combineRanges: function
      • 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.

        Parameters

        Returns SourceRange[]

        SourceRange.merge for merging multiple ranges into a single range.

    • compare: function
      • Provides a comparator for SourceRanges that sorts them in ascending order.

        Parameters

        Returns number

        a positive number if r1 comes after r2, a negative number if r1 comes before r2, and 0 if they are equal

    • containsPosition: function
      • Checks if a given position (line, column) is contained within the range.

        Parameters

        • this: void
        • __namedParameters: SourceRange
        • line: number
        • column: number

        Returns boolean

    • equals: function
      • Checks if two ranges are equal (i.e., they start and end at the same position).

        Parameters

        Returns boolean

    • format: function
    • from: function
      • Creates a source range from the given line and column numbers.

        Parameters

        • this: void
        • sl: string | number

          start line

        • sc: string | number

          start column

        • el: string | number = sl

          end line

        • ec: string | number = sc

          end column

        Returns SourceRange

    • fromNode: function
    • getEnd: function
    • getEndLine: function
    • getStart: function
    • getStartLine: function
    • innermostNodes: function
      • 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.

        Type Parameters

        • OtherInfo

        Parameters

        Returns RNodeWithParent<OtherInfo>[]

        SourceRange.nodesContaining which this usually narrows down

    • invalid: function
    • isStrictSubsetOf: function
    • isSubsetOf: function
    • merge: function
      • 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.

        Parameters

        Returns SourceRange

        if no ranges are provided

    • Readonlyname: "SourceRange"
    • nodesContaining: function
    • overlap: function
    • startsCompletelyBefore: function
      • Parameters

        Returns boolean

        true iff r1 starts and ends before r2 starts (i.e., if r1 and r2 do not overlap and r1 comes before r2