mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[poincare] Fix algorithmic mistake in addMissingParentheses
This commit is contained in:
@@ -223,10 +223,11 @@ void Expression::shallowAddMissingParenthesis() {
|
||||
|
||||
Expression Expression::addMissingParentheses() {
|
||||
for (int i = 0; i < numberOfChildren(); i++) {
|
||||
Expression child = childAtIndex(i);
|
||||
Expression child = childAtIndex(i).addMissingParentheses();
|
||||
if (node()->childNeedsUserParentheses(child)) {
|
||||
replaceChildAtIndexInPlace(i, Parenthesis::Builder(child.addMissingParentheses()));
|
||||
child = Parenthesis::Builder(child);
|
||||
}
|
||||
replaceChildAtIndexInPlace(i, child);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user