• Make a Matcher that throws an error if reached.

    Use with caution!

    Use fail if parser can step back and try a different path.

    For error recovery you can try to encode erroneous state in an output value instead.

    Type Parameters

    • TToken

    • TOptions

    Parameters

    • message: string | ((data: Data<TToken, TOptions>, i: number) => string)

      The message or a function to construct it from the current parser state.

    Returns Matcher<TToken, TOptions, never>

Generated using TypeDoc