1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 15:51:15 +02:00

Merge VarRef into ExprVar

This commit is contained in:
Eelco Dolstra 2013-10-08 14:24:53 +02:00
parent 176c666f36
commit 221a2daf34
4 changed files with 8 additions and 21 deletions

View file

@ -310,7 +310,7 @@ void mkPath(Value & v, const char * s)
}
inline Value * EvalState::lookupVar(Env * env, const VarRef & var, bool noEval)
inline Value * EvalState::lookupVar(Env * env, const ExprVar & var, bool noEval)
{
for (unsigned int l = var.level; l; --l, env = env->up) ;
@ -417,7 +417,7 @@ unsigned long nrAvoided = 0;
Value * ExprVar::maybeThunk(EvalState & state, Env & env)
{
Value * v = state.lookupVar(&env, info, true);
Value * v = state.lookupVar(&env, *this, true);
/* The value might not be initialised in the environment yet.
In that case, ignore it. */
if (v) { nrAvoided++; return v; }
@ -607,7 +607,7 @@ void ExprList::eval(EvalState & state, Env & env, Value & v)
void ExprVar::eval(EvalState & state, Env & env, Value & v)
{
Value * v2 = state.lookupVar(&env, info, false);
Value * v2 = state.lookupVar(&env, *this, false);
state.forceValue(*v2);
v = *v2;
}