diff --git a/derive/examples/calc.rs b/derive/examples/calc.rs index 70716253..61df2527 100644 --- a/derive/examples/calc.rs +++ b/derive/examples/calc.rs @@ -72,8 +72,8 @@ fn main() { .op(Op::infix(Rule::add, Left) | Op::infix(Rule::sub, Left)) .op(Op::infix(Rule::mul, Left) | Op::infix(Rule::div, Left)) .op(Op::infix(Rule::pow, Right)) - .op(Op::postfix(Rule::fac)) - .op(Op::prefix(Rule::neg)); + .op(Op::prefix(Rule::neg)) + .op(Op::postfix(Rule::fac)); let stdin = stdin(); let mut stdout = stdout(); diff --git a/pest/src/pratt_parser.rs b/pest/src/pratt_parser.rs index 76ffdf75..f042f825 100644 --- a/pest/src/pratt_parser.rs +++ b/pest/src/pratt_parser.rs @@ -142,8 +142,8 @@ impl BitOr for Op { /// .op(Op::infix(Rule::add, Assoc::Left) | Op::infix(Rule::sub, Assoc::Left)) /// .op(Op::infix(Rule::mul, Assoc::Left) | Op::infix(Rule::div, Assoc::Left)) /// .op(Op::infix(Rule::pow, Assoc::Right)) -/// .op(Op::postfix(Rule::fac)) -/// .op(Op::prefix(Rule::neg)); +/// .op(Op::prefix(Rule::neg)) +/// .op(Op::postfix(Rule::fac)); /// ``` /// /// To parse an expression, call the [`map_primary`], [`map_prefix`], [`map_postfix`],