From 81de12bc8fa09a89dae958a3ffc93e7a4c245db1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 14 Apr 2010 15:14:23 +0000 Subject: * Refactoring: move variable uses to a separate class. --- src/libexpr/nixexpr.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/libexpr/nixexpr.cc') diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index ab4fa6cba3cb..03b849a3897f 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -38,7 +38,7 @@ void ExprPath::show(std::ostream & str) void ExprVar::show(std::ostream & str) { - str << name; + str << info.name; } void ExprSelect::show(std::ostream & str) @@ -157,7 +157,7 @@ void ExprPath::bindVars(const StaticEnv & env) { } -void ExprVar::bindVars(const StaticEnv & env) +void VarRef::bind(const StaticEnv & env) { /* Check whether the variable appears in the environment. If so, set its level and displacement. */ @@ -187,6 +187,11 @@ void ExprVar::bindVars(const StaticEnv & env) this->level = withLevel; } +void ExprVar::bindVars(const StaticEnv & env) +{ + info.bind(env); +} + void ExprSelect::bindVars(const StaticEnv & env) { e->bindVars(env); -- cgit 1.4.1