Function parserPosition

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

    This is a version specific for char parsers.

    Note: it will fall back to core version (one token per line) in case any multicharacter tokens are present.

    Returns

    A multiline string.

    Parameters

    • data: Data<string, unknown>

      Data object (tokens and options).

    • i: number

      Parser position in the tokens array.

    • contextTokens: number = 11

      How many tokens (characters) around the current one to render.

    Returns string

Generated using TypeDoc