Function binary_op

Source
pub fn binary_op<I, O, E, P, Q>(
    precedence: Q,
    assoc: Assoc,
    parser: P,
) -> impl FnMut(I) -> IResult<I, Binary<O, Q>, E>
where P: Parser<I, Output = O, Error = E>, Q: Ord + Copy,
Expand description

Runs the inner parser and transforms the result into a binary operator with the given precedence and associativity.

Intended for use with precedence.

§Arguments

  • precedence The precedence of the operator.
  • assoc The associativity of the operator.
  • parser The parser to apply.