- rightAssoc1<TToken, TOptions, TRight>(pOper: Parser<TToken, TOptions, ((y: TRight) => TRight)>, pRight: Parser<TToken, TOptions, TRight>): Parser<TToken, TOptions, TRight>
-
Parameters
-
pOper: Parser<TToken, TOptions, ((y: TRight) => TRight)>
-
pRight: Parser<TToken, TOptions, TRight>
Returns Parser<TToken, TOptions, TRight>
Make a parser that parses any number of values and then one extra value to combine in right-to-left (last-to-first) order.
Note: This can fail if
pOper
andpRight
can consume same tokens. You'll have to make an ahead guard to prevent it from consuming the last token.Use rightAssoc2 if the grammar has an explicit operator between values.
Implementation is based on ab and reduceRight.