diff --git a/poincare/include/poincare/function.h b/poincare/include/poincare/function.h index 707f892e9..d89e6fc96 100644 --- a/poincare/include/poincare/function.h +++ b/poincare/include/poincare/function.h @@ -53,7 +53,6 @@ friend class FunctionNode; public: Function(const FunctionNode * n) : SymbolAbstract(n) {} static Function Builder(const char * name, size_t length, Expression child = Expression()); - static Expression UntypedBuilder(const char * name, size_t length, Expression child, Context * context); // Simplification Expression replaceSymbolWithExpression(const SymbolAbstract & symbol, const Expression & expression); diff --git a/poincare/include/poincare/symbol.h b/poincare/include/poincare/symbol.h index d86307887..0678ec726 100644 --- a/poincare/include/poincare/symbol.h +++ b/poincare/include/poincare/symbol.h @@ -60,7 +60,6 @@ public: static Symbol Builder(const char * name, int length) { return SymbolAbstract::Builder(name, length); } static Symbol Builder(CodePoint name); static Symbol Ans() { return Symbol::Builder(k_ans, k_ansLength); } - static Expression UntypedBuilder(const char * name, size_t length, Context * context); // Symbol properties bool isSystemSymbol() const { return node()->isUnknown(UCodePointUnknownX) || node()->isUnknown(UCodePointUnknownN); } diff --git a/poincare/include/poincare/symbol_abstract.h b/poincare/include/poincare/symbol_abstract.h index 3b6364b7d..4159b1162 100644 --- a/poincare/include/poincare/symbol_abstract.h +++ b/poincare/include/poincare/symbol_abstract.h @@ -65,19 +65,12 @@ class SymbolAbstract : public Expression { public: const char * name() const { return node()->name(); } static size_t TruncateExtension(char * dst, const char * src, size_t len); - static bool ValidInContext(SymbolAbstract & s, Context * context) { - // Retrive from context the expression corresponding to s - Expression f = context ? context->expressionForSymbol(s, false) : Expression(); - return f.isUninitialized() || f.type() == s.type(); - } static bool matches(const SymbolAbstract & symbol, ExpressionTest test, Context * context); constexpr static size_t k_maxNameSize = 8; - protected: SymbolAbstract(const SymbolAbstractNode * node) : Expression(node) {} template static T Builder(const char * name, int length); - SymbolAbstractNode * node() const { return static_cast(Expression::node()); } private: static Expression Expand(const SymbolAbstract & symbol, Context * context, bool clone); diff --git a/poincare/src/function.cpp b/poincare/src/function.cpp index 9929fed3c..ea8ca7c38 100644 --- a/poincare/src/function.cpp +++ b/poincare/src/function.cpp @@ -96,16 +96,6 @@ Function Function::Builder(const char * name, size_t length, Expression child) { return f; } -Expression Function::UntypedBuilder(const char * name, size_t length, Expression child, Context * context) { - /* Create an expression only if it is not in the context or defined as a - * function */ - Function f = Function::Builder(name, length, child); - if (SymbolAbstract::ValidInContext(f, context)) { - return f; - } - return Expression(); -} - Expression Function::replaceSymbolWithExpression(const SymbolAbstract & symbol, const Expression & expression) { // Replace the symbol in the child childAtIndex(0).replaceSymbolWithExpression(symbol, expression); diff --git a/poincare/src/symbol.cpp b/poincare/src/symbol.cpp index cdb93c30f..c9dba106c 100644 --- a/poincare/src/symbol.cpp +++ b/poincare/src/symbol.cpp @@ -126,15 +126,6 @@ Evaluation SymbolNode::templatedApproximate(Context * context, Preferences::C return e.node()->approximate(T(), context, complexFormat, angleUnit); } -Expression Symbol::UntypedBuilder(const char * name, size_t length, Context * context) { - // create an expression only if it is not in the context or defined as a symbol - Symbol s = Symbol::Builder(name, length); - if (SymbolAbstract::ValidInContext(s, context)) { - return s; - } - return Expression(); -} - bool SymbolNode::isUnknown(CodePoint unknownSymbol) const { bool result = UTF8Helper::CodePointIs(m_name, unknownSymbol); if (result) {