Function leftAssoc2

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

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

    Implementation is based on chain, reduceLeft and ab.

    Type Parameters

    • TToken

    • TOptions

    • TLeft

    • TRight

    Parameters

    • pLeft: Parser<TToken, TOptions, TLeft>

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

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

      A parser for an operator function.

    • pRight: Parser<TToken, TOptions, TRight>

      A parser for each consecutive value.

    Returns Parser<TToken, TOptions, TLeft>

Generated using TypeDoc