[poincare] Expression: fix deepBeautify

This commit is contained in:
Émilie Feral
2019-08-01 15:42:48 +02:00
parent 37de87d737
commit b97387efc4

View File

@@ -610,7 +610,7 @@ Expression Expression::deepBeautify(ExpressionNode::ReductionContext reductionCo
int nbChildren = e.numberOfChildren();
for (int i = 0; i < nbChildren; i++) {
Expression child = e.childAtIndex(i);
child.deepBeautify(reductionContext);
child = child.deepBeautify(reductionContext);
// We add missing Parentheses after beautifying the parent and child
if (e.node()->childNeedsUserParentheses(child)) {
e.replaceChildAtIndexInPlace(i, Parenthesis::Builder(child));