[poincare/symbol_abstract] Remove unused method

This commit is contained in:
Léa Saviot
2019-08-27 15:46:12 +02:00
parent 6a45073e09
commit faca423a82
5 changed files with 0 additions and 28 deletions

View File

@@ -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);

View File

@@ -60,7 +60,6 @@ public:
static Symbol Builder(const char * name, int length) { return SymbolAbstract::Builder<Symbol, SymbolNode>(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); }

View File

@@ -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 <typename T, typename U>
static T Builder(const char * name, int length);
SymbolAbstractNode * node() const { return static_cast<SymbolAbstractNode *>(Expression::node()); }
private:
static Expression Expand(const SymbolAbstract & symbol, Context * context, bool clone);

View File

@@ -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);

View File

@@ -126,15 +126,6 @@ Evaluation<T> 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) {