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

storing staticenv bindings

This commit is contained in:
Ben Burdette 2021-10-02 13:47:36 -06:00
parent b9d08b98da
commit aad27143c6
3 changed files with 71 additions and 1 deletions

View file

@ -689,6 +689,29 @@ void printEnvBindings(const Env &env, int lv )
}
}
void printStaticEnvBindings(const StaticEnv &se, int lvl)
{
for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
{
std::cout << lvl << i->first << std::endl;
}
if (se.up) {
printStaticEnvBindings(*se.up, ++lvl);
}
}
void printStaticEnvBindings(const Expr &expr)
{
// just print the names for now
if (expr.staticenv)
{
printStaticEnvBindings(*expr.staticenv.get(), 0);
}
}
void printEnvPosChain(const Env &env, int lv )
{
std::cout << "printEnvPosChain " << lv << std::endl;