aboutsummaryrefslogtreecommitdiffstats
path: root/src/compile.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-14 20:59:09 +0000
committerDavid Robillard <d@drobilla.net>2012-12-14 20:59:09 +0000
commit2918c1a6ce05325b18874193588b58b40f2691f5 (patch)
treec2bf237bf50dfc155cb121162007e6fdbb44effb /src/compile.cpp
parent1c537eaa52d74214591f01e7d3b43c16336ad3c7 (diff)
downloadresp-2918c1a6ce05325b18874193588b58b40f2691f5.tar.gz
resp-2918c1a6ce05325b18874193588b58b40f2691f5.tar.bz2
resp-2918c1a6ce05325b18874193588b58b40f2691f5.zip
Use explicit 'call' form after lifting pass.
This way every form afterwards has a symbol head. git-svn-id: http://svn.drobilla.net/resp/trunk@437 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/compile.cpp')
-rw-r--r--src/compile.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp
index d7b535d..de53388 100644
--- a/src/compile.cpp
+++ b/src/compile.cpp
@@ -136,12 +136,12 @@ compile_quote(CEnv& cenv, const ATuple* quote) throw()
static CVal
compile_call(CEnv& cenv, const ATuple* call) throw()
{
- const ATuple* protT = cenv.type(call->fst())->as_tuple()->prot();
- CFunc f = resp_compile(cenv, call->fst());
+ const ATuple* protT = cenv.type(call->frst())->as_tuple()->prot();
+ CFunc f = resp_compile(cenv, call->frst());
vector<CVal> args;
ATuple::const_iterator p = protT->iter_at(0);
- for (ATuple::const_iterator a = call->iter_at(1); a != call->end(); ++a, ++p) {
+ for (ATuple::const_iterator a = call->iter_at(2); a != call->end(); ++a, ++p) {
CVal arg = resp_compile(cenv, *a);
if (cenv.type(*a) != cenv.resolveType(*p)) {
args.push_back(cenv.engine()->compileCast(cenv, arg, *p));
@@ -228,12 +228,12 @@ resp_compile(CEnv& cenv, const AST* ast) throw()
return cenv.engine()->compileIfElse(cenv, resp_compile(cenv, call->frrst()));
else if (form == "if-end")
return cenv.engine()->compileIfEnd(cenv);
- else
+ else if (form == "call")
return compile_call(cenv, call);
}
}
- cenv.err << "Attempt to compile unknown type: " << ast << endl;
+ cenv.err << "Attempt to compile unknown form: " << ast << endl;
assert(false);
return NULL;
}