Closed Tom-the-Bomb closed 1 year ago
As a reference, this commit adds support for expressions like 3a+4b:
https://gitee.com/MulanRevive/mulan-rework/commit/5d7f4aba97a3a822bf08e8198f013046eedf4915
Thank you for that, but I've managed to work out a solution myself that passes my current test cases. :)
I'm making 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*xI have no clue what's wrong
Code: https://mystb.in/RestoredSensitiveExemption (still being edited on my end)
(Combining the code in the rply documentation example produces the same problem)