aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2021-11-25 08:23:07 -0700
committerBen Burdette <bburdette@gmail.com>2021-11-25 08:23:07 -0700
commit69e26c5c4ba106bd16f60bfaac88ccf888b4383f (patch)
treebcfff1cedfab36fa98e49429db6ba772aa7eb663 /src
parent7e2a3db4eb663aa99aec7ebcc83d75cb948a2cb3 (diff)
more cleanup
Diffstat (limited to 'src')
-rw-r--r--src/libcmd/command.cc4
-rw-r--r--src/libexpr/eval.cc23
-rw-r--r--src/libexpr/nixexpr.cc1
3 files changed, 13 insertions, 15 deletions
diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc
index 8a6dd71b2..2c62bfa7f 100644
--- a/src/libcmd/command.cc
+++ b/src/libcmd/command.cc
@@ -81,8 +81,8 @@ ref<EvalState> EvalCommand::getEvalState()
if (expr.staticenv)
{
- auto vm = mapStaticEnvBindings(*expr.staticenv.get(), env);
- runRepl(evalState, *vm);
+ auto vm = mapStaticEnvBindings(*expr.staticenv.get(), env);
+ runRepl(evalState, *vm);
}
};
}
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 8e263334a..11a61da26 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -620,7 +620,7 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
void printStaticEnvBindings(const StaticEnv &se, int lvl)
{
- for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
+ for (auto i = se.vars.begin(); i != se.vars.end(); ++i)
{
std::cout << lvl << i->first << std::endl;
}
@@ -628,22 +628,21 @@ void printStaticEnvBindings(const StaticEnv &se, int lvl)
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);
- }
-
+ // just print the names for now
+ if (expr.staticenv)
+ {
+ printStaticEnvBindings(*expr.staticenv.get(), 0);
+ }
}
void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
{
- // add bindings for the next level up first, so that the bindings for this level
+ // add bindings for the next level up first, so that the bindings for this level
// override the higher levels.
if (env.up && se.up) {
mapStaticEnvBindings( *se.up, *env.up,vm);
@@ -651,13 +650,13 @@ void mapStaticEnvBindings(const StaticEnv &se, const Env &env, valmap & vm)
// iterate through staticenv bindings and add them.
auto map = valmap();
- for (auto iter = se.vars.begin(); iter != se.vars.end(); ++iter)
+ for (auto iter = se.vars.begin(); iter != se.vars.end(); ++iter)
{
- map[iter->first] = env.values[iter->second];
+ map[iter->first] = env.values[iter->second];
}
vm.merge(map);
-
+
}
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 9ccecca55..3e42789a2 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -3,7 +3,6 @@
#include "util.hh"
#include <cstdlib>
-#include <iostream>
namespace nix {