@r47onfire/nebula - v0.0.0
    Preparing search index...

    Interface CSTPath<T>

    One node of a traverseCST walk, with the means to steer it.

    interface CSTPath<T> {
        index: number;
        node: CSTNode<T>;
        parent: CSTNode<T> | null;
        remove(): void;
        replaceWith(...nodes: CSTNode<T>[]): void;
        skip(): void;
        stop(): void;
    }

    Type Parameters

    • T
    Index
    index: number

    The node's index within its parent's children (-1 for the root).

    node: CSTNode<T>

    The node being visited.

    parent: CSTNode<T> | null

    The node's parent, or null when visiting the root.

    • Remove this node from the resulting tree. Shorthand for replaceWith().

      Returns void

    • Replace this node with the given nodes in the resulting tree -- no nodes removes it. The replacements are themselves visited in turn, unless CSTPath.skip was also called. The root may only be replaced with exactly one node. If called more than once, the last call wins.

      Parameters

      Returns void

    • Do not descend into this node's children (or its replacements).

      Returns void

    • Stop the whole traversal; nothing further is visited.

      Returns void