fixit
Converts infix tokens to postfix tokens, otherwise known as https://en.wikipedia.org/wiki/Reverse_Polish_notation.
This library does not do parsing or execution of expressions, but only filters/reorders tokens to allow stack-based execution. The (possibly less efficient) alternative to stack-based execution usually involves walking an expression tree.
Example
use ;
// Define your own operand: it could be anything.
type MyOperand = f32;
// Define your own operator.
// Assign a precedence to each operator
type MyInfixToken = ;
// The incoming `expr` tokens could have been parsed from a string via a crate like `nom` or `pest`.
// Parsing an expression like "a + b * c + d" should give:
// vec![
// InfixToken::Operand("a"), InfixToken::BinaryOp(MyBinaryOp::Add), InfixToken::Operand("b"),
// InfixToken::BinaryOp(MyBinaryOp::Mul),
// InfixToken::Operand("c"), InfixToken::BinaryOp(MyBinaryOp::Add), InfixToken::Operand("d")
// ]
License: MIT OR Apache-2.0