aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2021-09-14 10:49:22 -0600
committerBen Burdette <bburdette@gmail.com>2021-09-14 10:49:22 -0600
commit21071bfdeb0a5bc2b75018c91a4c2f138f233e33 (patch)
tree8fbdb2f7de3682ef977c737fd59970d2ed5dabb8 /src/libexpr/nixexpr.hh
parent176911102ce2c0be06bbfed9099f364d71c3c679 (diff)
shared_ptr for StaticEnv
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 51a14cd59..4c55cb64b 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -79,10 +79,12 @@ struct Expr
{
virtual ~Expr() { };
virtual void show(std::ostream & str) const;
- virtual void bindVars(const StaticEnv & env);
+ virtual void bindVars(const std::shared_ptr<const StaticEnv> & env);
virtual void eval(EvalState & state, Env & env, Value & v);
virtual Value * maybeThunk(EvalState & state, Env & env);
virtual void setName(Symbol & name);
+
+ std::shared_ptr<StaticEnv> staticenv;
};
std::ostream & operator << (std::ostream & str, const Expr & e);
@@ -90,7 +92,7 @@ std::ostream & operator << (std::ostream & str, const Expr & e);
#define COMMON_METHODS \
void show(std::ostream & str) const; \
void eval(EvalState & state, Env & env, Value & v); \
- void bindVars(const StaticEnv & env);
+ void bindVars(const std::shared_ptr<const StaticEnv> & env);
struct ExprInt : Expr
{
@@ -301,7 +303,7 @@ struct ExprOpNot : Expr
{ \
str << "(" << *e1 << " " s " " << *e2 << ")"; \
} \
- void bindVars(const StaticEnv & env) \
+ void bindVars(const std::shared_ptr<const StaticEnv> & env) \
{ \
e1->bindVars(env); e2->bindVars(env); \
} \