aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-06 20:22:03 +0000
committerDavid Robillard <d@drobilla.net>2009-03-06 20:22:03 +0000
commit382d3051052fd20ab55f40beb7664bfb3f0379a1 (patch)
treee0566fcce5fa49caec4c0f233e6030a55cc43281
parent65ab0205a6b193332867f9ce95fae5354efc99f7 (diff)
downloadresp-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
-rw-r--r--tuplr.hpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index 87cc743..7c28112 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -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;
};