diff options
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 54d7098..018607c 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -116,7 +116,6 @@ class AST; AST* readExpression(Cursor& cur, std::istream& in); - /*************************************************************************** * Backend Types * ***************************************************************************/ @@ -316,16 +315,8 @@ private: /// Type Expression, e.g. "Int", "(Fn (Int Int) Float)" struct AType : public ATuple { AType(ASymbol* s) : ATuple(s->loc), kind(PRIM), id(0) { push_back(s); } - AType(Cursor c, unsigned i, LAddr a) : ATuple(c), kind(VAR), id(i) {} - AType(Cursor c, AST* ast, ...) : ATuple(c), kind(EXPR), id(0) { - if (!ast) return; - va_list args; - va_start(args, ast); - push_back(ast); - for (AST* a = va_arg(args, AST*); a; a = va_arg(args, AST*)) - push_back(a); - va_end(args); - } + AType(Cursor c, unsigned i) : ATuple(c), kind(VAR), id(i) {} + AType(Cursor c) : ATuple(c), kind(EXPR), id(0) {} AType(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args), kind(EXPR), id(0) {} CValue compile(CEnv& cenv) { return NULL; } bool var() const { return kind == VAR; } @@ -586,7 +577,7 @@ struct TEnv : public Env< const ASymbol*, pair<AST*, AType*> > { TEnv(PEnv& p) : penv(p), varID(1) {} AType* fresh(const ASymbol* sym) { assert(sym); - AType* ret = new AType(sym->loc, varID++, LAddr()); + AType* ret = new AType(sym->loc, varID++); def(sym, make_pair((AST*)NULL, ret)); return ret; } @@ -599,7 +590,7 @@ struct TEnv : public Env< const ASymbol*, pair<AST*, AType*> > { if (v != vars.end()) return v->second; - AType* ret = new AType(ast ? ast->loc : Cursor(), varID++, LAddr()); + AType* ret = new AType(ast ? ast->loc : Cursor(), varID++); if (ast) vars[ast] = ret; |