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

    Interface GrammarOpDef<N>

    The definition of one grammar operation: how its nodes are created (create, also exported as the operation's factory function), how they are parsed (call), which of their fields feed the combinator hash (hashFields), and how they are rendered for debugging (describe). Keeping all four together in this table is what lets the parser's dispatcher, the hash function, and the debug renderer stay generic over operations. This is the loose common shape of a definition; each entry in opDefs is more precise (its call and describe are typed against the exact node shape its own create returns).

    interface GrammarOpDef<N> {
        call: (
            ctx: OpContext<any>,
            node: N,
            path: string,
            i: number,
            locals: Locals<any>,
            dynamics: Dynamics,
        ) => CSTNode<any> | MatchFail;
        create: (...args: any[]) => N;
        describe: (node: N) => string;
        hashFields: readonly (readonly [keyof N, MixAction])[];
    }

    Type Parameters

    • N
    Index
    call: (
        ctx: OpContext<any>,
        node: N,
        path: string,
        i: number,
        locals: Locals<any>,
        dynamics: Dynamics,
    ) => CSTNode<any> | MatchFail
    create: (...args: any[]) => N
    describe: (node: N) => string
    hashFields: readonly (readonly [keyof N, MixAction])[]