mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
* Implemented withs.
This commit is contained in:
parent
9985230c00
commit
110d155778
4 changed files with 38 additions and 15 deletions
|
@ -264,6 +264,18 @@ void ExprLet::bindVars(const StaticEnv & env)
|
|||
|
||||
void ExprWith::bindVars(const StaticEnv & env)
|
||||
{
|
||||
/* Does this `with' have an enclosing `with'? If so, record its
|
||||
level so that we can copy the attributes of the enclosing
|
||||
`with'. */
|
||||
const StaticEnv * curEnv;
|
||||
unsigned int level;
|
||||
prevWith = -1;
|
||||
for (curEnv = &env, level = 0; curEnv; curEnv = curEnv->up, level++)
|
||||
if (curEnv->isWith) {
|
||||
prevWith = level;
|
||||
break;
|
||||
}
|
||||
|
||||
attrs->bindVars(env);
|
||||
StaticEnv newEnv(true, &env);
|
||||
body->bindVars(newEnv);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue