From f25e8a63dd55a73aaf079f8198ccef048917060f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 3 Dec 2010 00:54:08 +0000 Subject: Detemplatify parseTuple. git-svn-id: http://svn.drobilla.net/resp/resp@286 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/parse.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/parse.cpp') 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 -T* +ATuple* parseTuple(PEnv& penv, const ATuple* e) { - List ret; + List 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(*this, tup); + return parseTuple(*this, tup); } - return parseTuple(*this, tup); // Parse regular call + return parseTuple(*this, tup); // Parse regular call } const ALexeme* lex = exp->to(); @@ -132,7 +131,7 @@ macDef(PEnv& penv, const AST* exp) inline AST* parseCall(PEnv& penv, const AST* exp, void* arg) { - return parseTuple(penv, exp->to()); + return parseTuple(penv, exp->to()); } template @@ -148,7 +147,7 @@ parseFn(PEnv& penv, const AST* exp, void* arg) const ATuple* texp = exp->to(); ATuple::const_iterator a = texp->begin(); THROW_IF(++a == texp->end(), exp->loc, "Unexpected end of `fn' form"); - ATuple* prot = parseTuple(penv, (*a++)->to()); + ATuple* prot = parseTuple(penv, (*a++)->to()); List ret(new ATuple(penv.sym("fn"), NULL, Cursor())); ret.push_back(prot); while (a != texp->end()) -- cgit v1.2.1