right<O, V> method
Adds a right-associative operator parser
. Evaluates the optional
action
with the parsed left
term, operator
, and right
term.
Implementation
void right<O, V>(Parser<O> parser,
[dynamic Function(V left, O operator, V right)? action]) {
final callback =
action ?? (left, operator, right) => [left, operator, right];
_right.add(parser.map((operator) => ExpressionResult(operator, callback)));
}