From 2918c1a6ce05325b18874193588b58b40f2691f5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Dec 2012 20:59:09 +0000 Subject: 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 --- src/compile.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/compile.cpp') 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 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; } -- cgit v1.2.1