diff options
author | David Robillard <d@drobilla.net> | 2009-03-06 20:22:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-06 20:22:03 +0000 |
commit | 382d3051052fd20ab55f40beb7664bfb3f0379a1 (patch) | |
tree | e0566fcce5fa49caec4c0f233e6030a55cc43281 /tuplr.hpp | |
parent | 65ab0205a6b193332867f9ce95fae5354efc99f7 (diff) | |
download | resp-382d3051052fd20ab55f40beb7664bfb3f0379a1.tar.gz resp-382d3051052fd20ab55f40beb7664bfb3f0379a1.tar.bz2 resp-382d3051052fd20ab55f40beb7664bfb3f0379a1.zip |
Ensure only PEnv can create new symbols (and thus they are unique).
git-svn-id: http://svn.drobilla.net/resp/tuplr@63 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'tuplr.hpp')
-rw-r--r-- | tuplr.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -111,11 +111,12 @@ struct ASTLiteral : public AST { /// Symbol, e.g. "a" struct ASTSymbol : public AST { - ASTSymbol(const string& s, Cursor c=Cursor()) : loc(c), cppstr(s) {} bool operator==(const AST& rhs) const { return this == &rhs; } string str() const { return cppstr; } CValue compile(CEnv& cenv); private: + friend class PEnv; + ASTSymbol(const string& s, Cursor c=Cursor()) : loc(c), cppstr(s) {} Cursor loc; const string cppstr; }; |