• Make a Matcher that returns either a match from a given parser or a match with the default value (without consuming input in that case).

    Use otherwise if you want to provide a Matcher instead of a constant default value.

    Type Parameters

    • TToken

    • TOptions

    • TValue

    Parameters

    • p: Parser<TToken, TOptions, TValue>

      A parser.

    • def: TValue

      Default value to be returned in case parser didn't match.

    Returns Matcher<TToken, TOptions, TValue>

Generated using TypeDoc