diff options
Diffstat (limited to 'src/tuplr.hpp')
-rw-r--r-- | src/tuplr.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp index 9a87c37..059a6cf 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -85,6 +85,12 @@ struct Env : public list< vector< pair<K,V> > > { return &b->second; return NULL; } + bool topLevel(const K& key) { + for (typename Frame::iterator b = this->back().begin(); b != this->back().end(); ++b) + if (b->first == key) + return true; + return false; + } }; @@ -635,6 +641,8 @@ struct Engine { virtual CVal compileCall(CEnv& cenv, CFunc f, const vector<CVal>& args) = 0; virtual CVal compilePrimitive(CEnv& cenv, APrimitive* prim) = 0; virtual CVal compileIf(CEnv& cenv, AIf* aif) = 0; + virtual CVal compileGlobal(CEnv& cenv, AType* t, const string& sym, CVal val) = 0; + virtual CVal getGlobal(CEnv& cenv, CVal val) = 0; virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; virtual const string call(CEnv& cenv, CFunc f, AType* retT) = 0; |