mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[calculation][poincare] Revert 'b8544e3' and improve equal simplification
This commit is contained in:
@@ -31,9 +31,13 @@ void FunctionApp::willBecomeInactive() {
|
||||
::App::willBecomeInactive();
|
||||
}
|
||||
|
||||
|
||||
bool FunctionApp::isAcceptableExpression(const Expression exp) {
|
||||
return TextFieldDelegateApp::isAcceptableExpression(exp) && ExpressionCanBeSerialized(exp, false, Expression(), localContext());
|
||||
bool FunctionApp::isAcceptableExpression(const Poincare::Expression expression) {
|
||||
/* We forbid functions whose type is equal because the input "2+f(3)" would be
|
||||
* simplify to an expression with an nested equal node which makes no sense. */
|
||||
if (!TextFieldDelegateApp::ExpressionCanBeSerialized(expression, false, Expression(), localContext()) || expression.type() == ExpressionNode::Type::Equal) {
|
||||
return false;
|
||||
}
|
||||
return TextFieldDelegateApp::isAcceptableExpression(expression);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user