diff options
author | David Robillard <d@drobilla.net> | 2010-12-03 00:52:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-03 00:52:49 +0000 |
commit | a2a6e8e4cefda1bb1cbdae53aab9d00b9a8688ca (patch) | |
tree | 29591923e314b9e11d111c5f402f50f50c2d17e4 /src/compile.cpp | |
parent | bbad3fe368b2086ec93f082a9436b1dfbc8f0e84 (diff) | |
download | resp-a2a6e8e4cefda1bb1cbdae53aab9d00b9a8688ca.tar.gz resp-a2a6e8e4cefda1bb1cbdae53aab9d00b9a8688ca.tar.bz2 resp-a2a6e8e4cefda1bb1cbdae53aab9d00b9a8688ca.zip |
Merge ACall and ATuple.
git-svn-id: http://svn.drobilla.net/resp/resp@285 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index 14cd562..88accf4 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -34,7 +34,7 @@ compile_symbol(CEnv& cenv, const ASymbol* sym) throw() } static CVal -compile_fn(CEnv& cenv, const ACall* fn) throw() +compile_fn(CEnv& cenv, const ATuple* fn) throw() { const AType* type = cenv.type(fn); CFunc f = cenv.findImpl(fn, type); @@ -82,7 +82,7 @@ compile_type(CEnv& cenv, const AType* type) throw() } static CVal -compile_call(CEnv& cenv, const ACall* call) throw() +compile_call(CEnv& cenv, const ATuple* call) throw() { CFunc f = resp_compile(cenv, *call->begin()); @@ -90,14 +90,14 @@ compile_call(CEnv& cenv, const ACall* call) throw() f = cenv.currentFn; // Recursive call (callee defined as a stub) vector<CVal> args; - for (ACall::const_iterator e = call->iter_at(1); e != call->end(); ++e) + for (ATuple::const_iterator e = call->iter_at(1); e != call->end(); ++e) args.push_back(resp_compile(cenv, *e)); return cenv.engine()->compileCall(cenv, f, cenv.type(call->head()), args); } static CVal -compile_def(CEnv& cenv, const ACall* def) throw() +compile_def(CEnv& cenv, const ATuple* def) throw() { const ASymbol* const sym = def->list_ref(1)->as<const ASymbol*>(); const AST* const body = def->list_ref(2); @@ -113,7 +113,7 @@ compile_def(CEnv& cenv, const ACall* def) throw() } static CVal -compile_cons(CEnv& cenv, const ACall* cons) throw() +compile_cons(CEnv& cenv, const ATuple* cons) throw() { AType* type = new AType(const_cast<ASymbol*>(cons->head()->as<const ASymbol*>()), NULL, Cursor()); TList tlist(type); @@ -126,7 +126,7 @@ compile_cons(CEnv& cenv, const ACall* cons) throw() } static CVal -compile_dot(CEnv& cenv, const ACall* dot) throw() +compile_dot(CEnv& cenv, const ATuple* dot) throw() { ATuple::const_iterator i = dot->begin(); const AST* tup = *++i; @@ -159,12 +159,12 @@ resp_compile(CEnv& cenv, const AST* ast) throw() if (type) return compile_type(cenv, type); - const ACall* const call = ast->to<const ACall*>(); + const ATuple* const call = ast->to<const ATuple*>(); if (call) { const ASymbol* const sym = call->head()->to<const ASymbol*>(); const std::string form = sym ? sym->cppstr : ""; if (is_primitive(cenv.penv, call)) - return cenv.engine()->compilePrimitive(cenv, ast->as<const ACall*>()); + return cenv.engine()->compilePrimitive(cenv, ast->as<const ATuple*>()); else if (form == "fn") return compile_fn(cenv, call); else if (form == "def") |