Function leftAssoc1

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

    Use leftAssoc2 if the grammar has an explicit operator between values.

    Implementation is based on chain and reduceLeft.

    Type Parameters

    • TToken

    • TOptions

    • TLeft

    Parameters

    • pLeft: Parser<TToken, TOptions, TLeft>

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

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

      A parser for each consecutive value. Result type is a transformation operation for the accumulator.

    Returns Parser<TToken, TOptions, TLeft>

Generated using TypeDoc