Function rightAssoc2

  • Make a parser that parses any number of values and operators, then one extra value to combine in right-to-left (last-to-first) order.

    Use rightAssoc1 if the grammar doesn't have an explicit operator between values.

    Implementation is based on ab and reduceRight.

    Type Parameters

    • TToken

    • TOptions

    • TLeft

    • TRight

    Parameters

    • pLeft: Parser<TToken, TOptions, TLeft>

      A parser for each consecutive value.

    • pOper: Parser<TToken, TOptions, ((x: TLeft, y: TRight) => TRight)>

      A parser for an operator function.

    • pRight: Parser<TToken, TOptions, TRight>

      A parser for the last value, also defines the result type (accumulator).

    Returns Parser<TToken, TOptions, TRight>

Generated using TypeDoc