0

I'm using Python's RPly to make a basic algebraic/mathematical equation parser, and I'm having a problem where unary operations make things a bit odd.

with unary operations implemented the way I have: 1 + 2 + 3 : 2 + 3 gets evaluated before 1 + 2 even though addition associativity is left.

Removing the unary operation rules and also there are also a couple of other changes fixes that but that messes up the precedence for implicit multiplication where: 1 + 2x : 1 + 2 becomes 3 before 2x becomes 2*x

I have no clue what's wrong

Code: https://mystb.in/RestoredSensitiveExemption (still being edited on my end)

0 Answers0