[poincare] Create a ContextWithParent that implements expressionTypeForIdentifier

This commit is contained in:
Émilie Feral
2020-01-17 14:34:28 +01:00
committed by Léa Saviot
parent c629cb66ba
commit 60048cb9a9
20 changed files with 65 additions and 84 deletions

View File

@@ -8,9 +8,9 @@
namespace Poincare {
VariableContext::VariableContext(const char * name, Context * parentContext) :
ContextWithParent(parentContext),
m_name(name),
m_value(),
m_parentContext(parentContext)
m_value()
{
}
@@ -27,7 +27,7 @@ void VariableContext::setExpressionForSymbolAbstract(const Expression & expressi
}
m_value = expression.clone();
} else {
m_parentContext->setExpressionForSymbolAbstract(expression, symbol);
return ContextWithParent::setExpressionForSymbolAbstract(expression, symbol);
}
}
@@ -38,7 +38,7 @@ const Expression VariableContext::expressionForSymbolAbstract(const SymbolAbstra
}
return Undefined::Builder();
} else {
return m_parentContext->expressionForSymbolAbstract(symbol, clone);
return ContextWithParent::expressionForSymbolAbstract(symbol, clone);
}
}