From 58daa5a8568ee0cc780bad8575e61447be64c77d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 2 Dec 2010 19:36:27 +0000 Subject: Remove ACall subclasses. git-svn-id: http://svn.drobilla.net/resp/resp@282 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/compile.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/compile.cpp') diff --git a/src/compile.cpp b/src/compile.cpp index 9f9168a..cf777f8 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -118,7 +118,7 @@ compile_cons(CEnv& cenv, const ACall* cons) throw() AType* type = new AType(const_cast(cons->head()->as()), NULL, Cursor()); TList tlist(type); vector fields; - for (ACons::const_iterator i = cons->iter_at(1); i != cons->end(); ++i) { + for (ATuple::const_iterator i = cons->iter_at(1); i != cons->end(); ++i) { tlist.push_back(const_cast(cenv.type(*i))); fields.push_back(resp_compile(cenv, *i)); } @@ -159,10 +159,6 @@ resp_compile(CEnv& cenv, const AST* ast) throw() if (fn) return compile_fn(cenv, fn); - const APrimitive* prim = ast->to(); - if (prim) - return cenv.engine()->compilePrimitive(cenv, prim); - const AType* type = ast->to(); if (type) return compile_type(cenv, type); @@ -171,7 +167,9 @@ resp_compile(CEnv& cenv, const AST* ast) throw() if (call) { const ASymbol* const sym = call->head()->to(); const std::string form = sym ? sym->cppstr : ""; - if (form == "def") + if (is_primitive(cenv.penv, call)) + return cenv.engine()->compilePrimitive(cenv, ast->as()); + else if (form == "def") return compile_def(cenv, call); else if (form == "if") return cenv.engine()->compileIf(cenv, call); @@ -189,7 +187,7 @@ resp_compile(CEnv& cenv, const AST* ast) throw() return compile_call(cenv, call); } - cenv.err << "Attempt to compile unknown type" << endl; + cenv.err << "Attempt to compile unknown type: " << ast << endl; assert(false); return NULL; } -- cgit v1.2.1