Closed abuyukyi101198 closed 1 year ago
Thanks for fixing this. As it's a hotfix, can you mention this PR as comment in the code so future developers can quickly understand why we did this?
Added the comments but I have no idea why the checks failed this time.
Alright, I got why the builds are failing.
They still don't remove outermost parentheses, so I added a TODO for that.
That's why. Finding a way of adding an exception to the special condition added so that the outermost subtraction is not encased in parentheses should fix everything. Wouldn't be a hotfix then, I guess.
Try if you can. Else, you can also adjust the hard-coded test to match the new output (assuming it's mathematically correct of course!)
You'll also need to add a new text corresponding to #59 to make sure any future change never breaks your use case.
And then we'll be able to merge
Hi, Issue #59 shows that nested subtraction operations have their parentheses removed, which results in the output being a different formula.
I added a special condition for nested subtractions, encasing them in parentheses in
visit_BinOp()
.This process adds some redundant parentheses, which I removed by two regex substitutions in
simplify()
. They still don't remove outermost parentheses, so I added a TODO for that.