From 382d3051052fd20ab55f40beb7664bfb3f0379a1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 6 Mar 2009 20:22:03 +0000 Subject: 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 --- tuplr.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }; -- cgit v1.2.1