Skip to content

Commit

Permalink
Remove dead TOKtobool and Bool
Browse files Browse the repository at this point in the history
  • Loading branch information
yebblies committed Dec 22, 2013
1 parent ec34f77 commit d65bd1d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/constfold.c
Expand Up @@ -116,14 +116,6 @@ Expression *Not(Type *type, Expression *e1)
return e;
}

Expression *Bool(Type *type, Expression *e1)
{ Expression *e;
Loc loc = e1->loc;

e = new IntegerExp(loc, e1->isBool(1), type);
return e;
}

Expression *Add(Type *type, Expression *e1, Expression *e2)
{ Expression *e;
Loc loc = e1->loc;
Expand Down
1 change: 0 additions & 1 deletion src/expression.h
Expand Up @@ -1885,7 +1885,6 @@ Expression *expType(Type *type, Expression *e);
Expression *Neg(Type *type, Expression *e1);
Expression *Com(Type *type, Expression *e1);
Expression *Not(Type *type, Expression *e1);
Expression *Bool(Type *type, Expression *e1);
Expression *Cast(Type *type, Type *to, Expression *e1);
Expression *ArrayLength(Type *type, Expression *e1);
Expression *Ptr(Type *type, Expression *e1);
Expand Down
2 changes: 2 additions & 0 deletions src/interpret.c
Expand Up @@ -3009,7 +3009,9 @@ Expression *UnaExp::interpret(InterState *istate, CtfeGoal goal)
case TOKneg: e = Neg(type, e1); break;
case TOKtilde: e = Com(type, e1); break;
case TOKnot: e = Not(type, e1); break;
#if DMDV1
case TOKtobool: e = Bool(type, e1); break;
#endif
case TOKvector: e = this; break; // do nothing
default: assert(0);
}
Expand Down
2 changes: 0 additions & 2 deletions src/lexer.c
Expand Up @@ -2830,7 +2830,6 @@ void Lexer::initKeywords()
Token::tochars[TOKequal] = "==";
Token::tochars[TOKnotequal] = "!=";
Token::tochars[TOKnotidentity] = "!is";
Token::tochars[TOKtobool] = "!!";

Token::tochars[TOKunord] = "!<>=";
Token::tochars[TOKue] = "!<>";
Expand All @@ -2842,7 +2841,6 @@ void Lexer::initKeywords()
Token::tochars[TOKug] = "!<=";

Token::tochars[TOKnot] = "!";
Token::tochars[TOKtobool] = "!!";
Token::tochars[TOKshl] = "<<";
Token::tochars[TOKshr] = ">>";
Token::tochars[TOKushr] = ">>>";
Expand Down
1 change: 0 additions & 1 deletion src/lexer.h
Expand Up @@ -78,7 +78,6 @@ enum TOK
TOKequal, TOKnotequal,
TOKidentity, TOKnotidentity,
TOKindex, TOKis,
TOKtobool,

// 60
// NCEG floating point compares
Expand Down
1 change: 0 additions & 1 deletion src/parse.c
Expand Up @@ -7222,7 +7222,6 @@ void initPrecedence()
precedence[TOKneg] = PREC_unary;
precedence[TOKuadd] = PREC_unary;
precedence[TOKnot] = PREC_unary;
precedence[TOKtobool] = PREC_add;
precedence[TOKtilde] = PREC_unary;
precedence[TOKdelete] = PREC_unary;
precedence[TOKnew] = PREC_unary;
Expand Down

0 comments on commit d65bd1d

Please sign in to comment.