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

    Class SourceLocationView

    An object-oriented read-only view on a SourceLocation (and hence on a SourceRange).

    The view holds a reference to the tuple it was created from and copies nothing, so it costs one small object and every accessor is a plain tuple read. Serializing it yields the very tuple again, so a view may be handed to JSON.stringify in place of the location.

    Tuples remain the representation that is stored and sent over the wire; create a view where you read a location and drop it afterwards rather than keeping one per node.

    const loc = SourceLocation.at(node);
    console.log(loc?.startLine, loc?.file, loc?.toString());
    Index
    raw: readonly [Line, Column, Line, Column, string | undefined]

    The underlying tuple; use it whenever you need the plain representation back.

    • Destructuring a view yields the same elements as destructuring the tuple.

      Returns IterableIterator<string | number | undefined>

    • Whether the given position lies within this location; omitting the column checks the line alone.

      Parameters

      Returns boolean