diff options
-rw-r--r-- | src/parse.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/parse.cpp b/src/parse.cpp index e7825bc..bbf3ca9 100644 --- a/src/parse.cpp +++ b/src/parse.cpp @@ -23,11 +23,10 @@ using namespace std; -template<typename T> -T* +ATuple* parseTuple(PEnv& penv, const ATuple* e) { - List<T, AST> ret; + List<ATuple, AST> ret; FOREACHP(ATuple::const_iterator, i, e) ret.push_back(penv.parse(*i)); return ret.head; @@ -58,10 +57,10 @@ PEnv::parse(const AST* exp) return h->func(*this, exp, h->arg); // Parse special form if (isupper(form->c_str()[0])) // Call constructor (any uppercase symbol) - return parseTuple<ATuple>(*this, tup); + return parseTuple(*this, tup); } - return parseTuple<ATuple>(*this, tup); // Parse regular call + return parseTuple(*this, tup); // Parse regular call } const ALexeme* lex = exp->to<const ALexeme*>(); @@ -132,7 +131,7 @@ macDef(PEnv& penv, const AST* exp) inline AST* parseCall(PEnv& penv, const AST* exp, void* arg) { - return parseTuple<ATuple>(penv, exp->to<const ATuple*>()); + return parseTuple(penv, exp->to<const ATuple*>()); } template<typename T> @@ -148,7 +147,7 @@ parseFn(PEnv& penv, const AST* exp, void* arg) const ATuple* texp = exp->to<const ATuple*>(); ATuple::const_iterator a = texp->begin(); THROW_IF(++a == texp->end(), exp->loc, "Unexpected end of `fn' form"); - ATuple* prot = parseTuple<ATuple>(penv, (*a++)->to<const ATuple*>()); + ATuple* prot = parseTuple(penv, (*a++)->to<const ATuple*>()); List<ATuple, AST> ret(new ATuple(penv.sym("fn"), NULL, Cursor())); ret.push_back(prot); while (a != texp->end()) |