diff options
author | David Robillard <d@drobilla.net> | 2009-10-14 00:00:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-14 00:00:58 +0000 |
commit | 6b89f484b7e41cab4a528a855b23be33d97dc474 (patch) | |
tree | 94760633554e377a08ae4e7504e522d7eedb769b /src/tuplr.hpp | |
parent | 1c851be2be3b2358e03fa7b2d6944d8bd1b0416d (diff) | |
download | resp-6b89f484b7e41cab4a528a855b23be33d97dc474.tar.gz resp-6b89f484b7e41cab4a528a855b23be33d97dc474.tar.bz2 resp-6b89f484b7e41cab4a528a855b23be33d97dc474.zip |
Remove unnecessary cenv.compile wrapper.
Remove special treatment of symbols for compilation.
Make CEnv::vals a <ASymbol*, CValue> map rather than <AST*, CValue> (only used for symbols).
git-svn-id: http://svn.drobilla.net/resp/tuplr@214 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 6f79e8c..ada5412 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -628,15 +628,11 @@ struct CEnv { ~CEnv() { Object::pool.collect(GC::Roots()); } - typedef Env<const AST*, CVal> Vals; + typedef Env<const ASymbol*, CVal> Vals; Engine* engine() { return _engine; } void push() { tenv.push(); vals.push(); } void pop() { tenv.pop(); vals.pop(); } - CVal compile(AST* obj) { - CVal* v = vals.ref(obj); - return (v && *v) ? *v : vals.def(obj, obj->compile(*this)); - } void lock(AST* ast) { Object::pool.addRoot(ast); Object::pool.addRoot(type(ast)); } AType* type(AST* ast, const Subst& subst = Subst()) const { ASymbol* sym = ast->to<ASymbol*>(); @@ -649,13 +645,12 @@ struct CEnv { vals.def(sym, v); } - ostream& out; - ostream& err; - PEnv& penv; - TEnv& tenv; - Vals vals; - - Subst tsubst; + ostream& out; + ostream& err; + PEnv& penv; + TEnv& tenv; + Vals vals; + Subst tsubst; map<string,string> args; |