• This overload makes a Matcher that applies three matchers one after another and joins the results.

    Use ab if you want to join just 2 different parsers/matchers.

    Use middle if you want to keep only the middle result and discard two others.

    Use all if you want a sequence of parsers of arbitrary length (but they have to share a common value type).

    Type Parameters

    • TToken

    • TOptions

    • TValueA

    • TValueB

    • TValueC

    • TValue

    Parameters

    • pa: Matcher<TToken, TOptions, TValueA>

      First matcher.

    • pb: Matcher<TToken, TOptions, TValueB>

      Second matcher.

    • pc: Matcher<TToken, TOptions, TValueC>

      Third matcher.

    • join: ((va: TValueA, vb: TValueB, vc: TValueC, data: Data<TToken, TOptions>, i: number, j: number) => TValue)

      A function to combine matched values from all three matchers.

        • (va: TValueA, vb: TValueB, vc: TValueC, data: Data<TToken, TOptions>, i: number, j: number): TValue
        • Parameters

          • va: TValueA

            A value matched by the first matcher.

          • vb: TValueB

            A value matched by the second matcher.

          • vc: TValueC

            A value matched by the third matcher.

          • data: Data<TToken, TOptions>

            Data object (tokens and options).

          • i: number

            Parser position in the tokens array (before all three matchers matched).

          • j: number

            Parser position in the tokens array (after all three matchers matched).

          Returns TValue

    Returns Matcher<TToken, TOptions, TValue>

  • Make a parser that tries three parsers one after another and joins the results.

    A nonmatch is returned if any of three parsers did not match.

    Use ab if you want to join just 2 different parsers.

    Use middle if you want to keep only the middle result and discard two others.

    Use all if you want a sequence of parsers of arbitrary length (but they have to share a common value type).

    Type Parameters

    • TToken

    • TOptions

    • TValueA

    • TValueB

    • TValueC

    • TValue

    Parameters

    • pa: Parser<TToken, TOptions, TValueA>

      First parser.

    • pb: Parser<TToken, TOptions, TValueB>

      Second parser.

    • pc: Parser<TToken, TOptions, TValueC>

      Third parser.

    • join: ((va: TValueA, vb: TValueB, vc: TValueC, data: Data<TToken, TOptions>, i: number, j: number) => TValue)

      A function to combine matched results from all three parsers.

        • (va: TValueA, vb: TValueB, vc: TValueC, data: Data<TToken, TOptions>, i: number, j: number): TValue
        • Parameters

          • va: TValueA

            A value matched by the first parser.

          • vb: TValueB

            A value matched by the second parser.

          • vc: TValueC

            A value matched by the third parser.

          • data: Data<TToken, TOptions>

            Data object (tokens and options).

          • i: number

            Parser position in the tokens array (before all three parsers matched).

          • j: number

            Parser position in the tokens array (after all three parsers matched).

          Returns TValue

    Returns Parser<TToken, TOptions, TValue>

Generated using TypeDoc