peberminta - v0.10.0
    Preparing search index...

    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.

      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

      A multiline string.