right<O> method

void right<O>(
  1. Parser<O> parser,
  2. T callback(
    1. T left,
    2. O operator,
    3. T right
    )
)

Adds a right-associative operator parser. Evaluates the callback with the parsed left term, operator, and right term.

Implementation

void right<O>(
  Parser<O> parser,
  T Function(T left, O operator, T right) callback,
) => _right.add(
  parser.map((operator) => ExpressionResultInfix<T, O>(operator, callback)),
);