pest icon indicating copy to clipboard operation
pest copied to clipboard

make PrecClimber support prefix and postfix operators

Open mdg opened this issue 4 years ago • 2 comments

Problem

The PrecClimber handles precedence between infix operators, like a + b * c, but doesn't handle precedence between prefix or postfix operators, like -a.b + c.

Expectation

The PrecClimber should be able to resolve prefix and postfix operators along with infix operators.

mdg avatar May 25 '20 16:05 mdg

I'm looking at taking a shot at this. The plan is to add awareness of prefix or postfix to the Assoc enum or the Operator struct.

The Operator seems better but not sure if that will cause backwards compatibility issues and maybe the Assoc is less disruptive to the interface.

mdg avatar May 25 '20 17:05 mdg

See also #344, https://crates.io/crates/pratt

CAD97 avatar May 25 '20 19:05 CAD97