Revert "[poincare/expression] deepBeautify bubbles up Undefined children"

This reverts commit 300399fe4d.

Not necessary anymore to bubble up Undefined children in deepBeautify
since Unit::shallowBeautify does not introduce any Undefined Expression.
This commit is contained in:
Ruben Dashyan
2020-03-13 17:01:06 +01:00
committed by Émilie Feral
parent 01b94f8543
commit 651b705dbd

View File

@@ -825,12 +825,6 @@ Expression Expression::deepBeautify(ExpressionNode::ReductionContext reductionCo
for (int i = 0; i < nbChildren; i++) {
Expression child = e.childAtIndex(i);
child = child.deepBeautify(reductionContext);
/* Unit::shallowBeautify replaces units in inhomogeneous Expression by
* Undefined. Undefined children must be bubbled up to the root.
*/
if (child.type() == ExpressionNode::Type::Undefined) {
return e.replaceWithUndefinedInPlace();
}
// We add missing Parentheses after beautifying the parent and child
if (e.node()->childAtIndexNeedsUserParentheses(child, i)) {
e.replaceChildAtIndexInPlace(i, Parenthesis::Builder(child));