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