diff options
author | David Robillard <d@drobilla.net> | 2010-12-02 17:45:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-12-02 17:45:11 +0000 |
commit | a6b1581f08477456e6d128124693c456ad27f4e0 (patch) | |
tree | 5577e5ed48970923c5f8d9644177dc8c254ab1d6 /src/compile.cpp | |
parent | cf6c924f9cb10a583edbab2560773f2500a86323 (diff) | |
download | resp-a6b1581f08477456e6d128124693c456ad27f4e0.tar.gz resp-a6b1581f08477456e6d128124693c456ad27f4e0.tar.bz2 resp-a6b1581f08477456e6d128124693c456ad27f4e0.zip |
Remove use of ACall subclasses for contrain phase.
git-svn-id: http://svn.drobilla.net/resp/resp@279 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/compile.cpp')
-rw-r--r-- | src/compile.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compile.cpp b/src/compile.cpp index ccde2ca..8518051 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -84,12 +84,13 @@ compile_call(CEnv& cenv, const ACall* call) throw() static CVal compile_def(CEnv& cenv, const ADef* def) throw() { - const ASymbol* const sym = def->list_ref(1)->as<const ASymbol*>(); - cenv.def(sym, def->body(), cenv.type(def->body()), NULL); // define stub first for recursion - CVal val = resp_compile(cenv, def->body()); - if (cenv.vals.size() == 1 && cenv.type(def->body())->head()->str() != "Fn") { + const ASymbol* const sym = def->list_ref(1)->as<const ASymbol*>(); + const AST* const body = def->list_ref(2); + cenv.def(sym, body, cenv.type(body), NULL); // define stub first for recursion + CVal val = resp_compile(cenv, body); + if (cenv.vals.size() == 1 && cenv.type(body)->head()->str() != "Fn") { val = cenv.engine()->compileGlobal( - cenv, cenv.type(def->body()), sym->str(), val); + cenv, cenv.type(body), sym->str(), val); cenv.lock(def); } cenv.vals.def(sym, val); |