nom_language::precedence

Function unary_op

Source
pub fn unary_op<I, O, E, P, Q>(
    precedence: Q,
    parser: P,
) -> impl FnMut(I) -> IResult<I, Unary<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 an unary operator with the given precedence.

Intended for use with precedence.

§Arguments

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