mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-14 01:12:11 -05:00
#7316 Curve Calculator: Add support for single line if-statement
This commit is contained in:
1 parent
1a8f36373c
commit
a060ba349e
6 files changed
+158
-1
No files matched your search
@@ -59,3 +59,21 @@ bool ExpressionParser::evaluate(const QString& expressionText, QString* errorTex
|
||||
{
|
||||
return m_expressionParserImpl->evaluate(expressionText, errorText);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool ExpressionParser::expandIfStatementsAndEvaluate(const QString& expressionText, QString* errorText /*= nullptr*/)
|
||||
{
|
||||
if (expressionText.contains("if"))
|
||||
{
|
||||
QString expandedExpressionText = ExpressionParserImpl::expandIfStatements(expressionText);
|
||||
|
||||
return m_expressionParserImpl->evaluate(expandedExpressionText, errorText);
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_expressionParserImpl->evaluate(expressionText, errorText);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user