mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared/text_field_delegate_app] Refuse Equal
The Equal sign now triggers a syntax error in all apps but Solver. This make its behaviour symmetrical with that of < and >. Change-Id: Ia886c547a315d5627a69f3f2acac2cbce0e202c2
This commit is contained in:
committed by
Émilie Feral
parent
fa0e8de0a9
commit
b8544e3708
@@ -37,13 +37,9 @@ void FunctionApp::willBecomeInactive() {
|
||||
::App::willBecomeInactive();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
bool FunctionApp::isAcceptableExpression(const Expression exp) {
|
||||
return TextFieldDelegateApp::isAcceptableExpression(exp) && ExpressionCanBeSerialized(exp, false, Expression(), localContext());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user