Rename strictForceValue -> forceValueDeep

This commit is contained in:
Eelco Dolstra 2014-09-22 15:03:59 +02:00
parent 022618c794
commit 1e0a799bef
3 changed files with 5 additions and 5 deletions

View file

@ -1181,18 +1181,18 @@ void ExprPos::eval(EvalState & state, Env & env, Value & v)
} }
void EvalState::strictForceValue(Value & v) void EvalState::forceValueDeep(Value & v)
{ {
forceValue(v); forceValue(v);
if (v.type == tAttrs) { if (v.type == tAttrs) {
foreach (Bindings::iterator, i, *v.attrs) foreach (Bindings::iterator, i, *v.attrs)
strictForceValue(*i->value); forceValueDeep(*i->value);
} }
else if (v.type == tList) { else if (v.type == tList) {
for (unsigned int n = 0; n < v.list.length; ++n) for (unsigned int n = 0; n < v.list.length; ++n)
strictForceValue(*v.list.elems[n]); forceValueDeep(*v.list.elems[n]);
} }
} }

View file

@ -188,7 +188,7 @@ public:
/* Force a value, then recursively force list elements and /* Force a value, then recursively force list elements and
attributes. */ attributes. */
void strictForceValue(Value & v); void forceValueDeep(Value & v);
/* Force `v', and then verify that it has the expected type. */ /* Force `v', and then verify that it has the expected type. */
NixInt forceInt(Value & v, const Pos & pos); NixInt forceInt(Value & v, const Pos & pos);

View file

@ -61,7 +61,7 @@ void processExpr(EvalState & state, const Strings & attrPaths,
else if (output == okJSON) else if (output == okJSON)
printValueAsJSON(state, strict, vRes, std::cout, context); printValueAsJSON(state, strict, vRes, std::cout, context);
else { else {
if (strict) state.strictForceValue(vRes); if (strict) state.forceValueDeep(vRes);
std::cout << vRes << std::endl; std::cout << vRes << std::endl;
} }
} else { } else {