mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 07:40:42 +01:00
[Context] Modifying context method signature for sequences
This allows sequences to be used in functions by calling u(x) Change-Id: I336e84a19bf9b3dd0f2e435d1aaebda3c9e71ec8
This commit is contained in:
committed by
Émilie Feral
parent
3dca515441
commit
1d71a14d2c
@@ -23,14 +23,18 @@ void VariableContext::setExpressionForSymbolAbstract(const Expression & expressi
|
||||
}
|
||||
}
|
||||
|
||||
const Expression VariableContext::expressionForSymbolAbstract(const SymbolAbstract & symbol, bool clone) {
|
||||
const Expression VariableContext::expressionForSymbolAbstract(const SymbolAbstract & symbol, bool clone, float unknownSymbolValue ) {
|
||||
if (m_name != nullptr && strcmp(symbol.name(), m_name) == 0) {
|
||||
if (symbol.type() == ExpressionNode::Type::Symbol) {
|
||||
return clone ? m_value.clone() : m_value;
|
||||
}
|
||||
return Undefined::Builder();
|
||||
} else {
|
||||
return ContextWithParent::expressionForSymbolAbstract(symbol, clone);
|
||||
Symbol unknownSymbol = Symbol::Builder(UCodePointUnknown);
|
||||
if (m_name != nullptr && strcmp(m_name, unknownSymbol.name()) == 0) {
|
||||
unknownSymbolValue = m_value.approximateToScalar<float>(this, Preferences::sharedPreferences()->complexFormat(),Preferences::sharedPreferences()->angleUnit());
|
||||
}
|
||||
return ContextWithParent::expressionForSymbolAbstract(symbol, clone, unknownSymbolValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user