aboutsummaryrefslogtreecommitdiffstats
path: root/src/parse.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-03 00:54:08 +0000
committerDavid Robillard <d@drobilla.net>2010-12-03 00:54:08 +0000
commitf25e8a63dd55a73aaf079f8198ccef048917060f (patch)
treea91cdb0159d289c45ff9ab8ab1bce4daca802e3d /src/parse.cpp
parenta2a6e8e4cefda1bb1cbdae53aab9d00b9a8688ca (diff)
downloadresp-f25e8a63dd55a73aaf079f8198ccef048917060f.tar.gz
resp-f25e8a63dd55a73aaf079f8198ccef048917060f.tar.bz2
resp-f25e8a63dd55a73aaf079f8198ccef048917060f.zip
Detemplatify parseTuple.
git-svn-id: http://svn.drobilla.net/resp/resp@286 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/parse.cpp')
-rw-r--r--src/parse.cpp13
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())