Function parserPosition

  • Utility function to render a given parser position for error reporting and debug purposes.

    Returns

    A multiline string.

    Type Parameters

    • TToken

    Parameters

    • data: Data<TToken, unknown>

      Data object (tokens and options).

    • i: number

      Parser position in the tokens array.

    • formatToken: ((t: TToken) => string)

      A function to stringify a token.

        • (t: TToken): string
        • Parameters

          • t: TToken

          Returns string

    • contextTokens: number = 3

      How many tokens around the current one to render.

    Returns string

Generated using TypeDoc