diff options
author | Ben Burdette <bburdette@protonmail.com> | 2022-02-04 15:09:40 -0700 |
---|---|---|
committer | Ben Burdette <bburdette@protonmail.com> | 2022-02-04 15:09:40 -0700 |
commit | dbe3fd3735fa9aeb91720aa34dc447e5d925f3c4 (patch) | |
tree | a8b55d7fb2dbd70c10bbd521bc8458c9dbdd77c7 /src/libcmd/repl.cc | |
parent | 3ddf864e1b2c5c27b2e6f7203e262c85bf760f7c (diff) | |
parent | bd383d1b6f91c4fe7ac21c52771e92027f649fa0 (diff) |
Merge branch 'master' into debug-step
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r-- | src/libcmd/repl.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 5c14c7d3e..51bbbbc57 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -347,7 +347,7 @@ StringSet NixRepl::completePrefix(string prefix) Expr * e = parseString(expr); Value v; e->eval(*state, *env, v); - state->forceAttrs(v); + state->forceAttrs(v, noPos); for (auto & i : *v.attrs) { string name = i.name; @@ -521,7 +521,7 @@ bool NixRepl::processLine(string line) if (v.type() == nPath || v.type() == nString) { PathSet context; auto filename = state->coerceToString(noPos, v, context); - pos.file = state->symbols.create(filename); + pos.file = state->symbols.create(*filename); } else if (v.isLambda()) { pos = v.lambda.fun->pos; } else { @@ -737,7 +737,7 @@ void NixRepl::loadFiles() void NixRepl::addAttrsToScope(Value & attrs) { - state->forceAttrs(attrs); + state->forceAttrs(attrs, [&]() { return attrs.determinePos(noPos); }); if (displ + attrs.attrs->size() >= envSize) throw Error("environment full; cannot add more variables"); @@ -766,7 +766,7 @@ void NixRepl::addVarToScope(const Symbol & name, Value & v) Expr * NixRepl::parseString(string s) { - Expr * e = state->parseExprFromString(s, curDir, staticEnv); + Expr * e = state->parseExprFromString(std::move(s), curDir, staticEnv); return e; } @@ -775,7 +775,7 @@ void NixRepl::evalString(string s, Value & v) { Expr * e = parseString(s); e->eval(*state, *env, v); - state->forceValue(v); + state->forceValue(v, [&]() { return v.determinePos(noPos); }); } @@ -805,7 +805,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m str.flush(); checkInterrupt(); - state->forceValue(v); + state->forceValue(v, [&]() { return v.determinePos(noPos); }); switch (v.type()) { |