diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-14T15·14+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-14T15·14+0000 |
commit | 81de12bc8fa09a89dae958a3ffc93e7a4c245db1 (patch) | |
tree | 7e2a8545dc16229181caa87266bede87b98ebf63 /src/libexpr/nixexpr.cc | |
parent | 110d1557782fac4f8cafa27e5cbbcdebefb7a4c7 (diff) |
* Refactoring: move variable uses to a separate class.
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 9 |
1 files changed, 7 insertions, 2 deletions
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); |