aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops/context.cc
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-04-28 12:54:14 +0200
committerGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-04-28 12:54:14 +0200
commitacf990c9ea9de913a500cf2b7a7492eef3bcd7b5 (patch)
tree3c5c5427195422554c2f9df6d2b580bd0a74132e /src/libexpr/primops/context.cc
parent963b8aa39b169bf5c054449ddce39d60faacf298 (diff)
fix errors case and wording
Diffstat (limited to 'src/libexpr/primops/context.cc')
-rw-r--r--src/libexpr/primops/context.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libexpr/primops/context.cc b/src/libexpr/primops/context.cc
index 78320dc09..517b93897 100644
--- a/src/libexpr/primops/context.cc
+++ b/src/libexpr/primops/context.cc
@@ -7,7 +7,7 @@ namespace nix {
static void prim_unsafeDiscardStringContext(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
PathSet context;
- auto s = state.coerceToString(pos, *args[0], context, "While evaluating the argument passed to builtins.unsafeDiscardStringContext");
+ auto s = state.coerceToString(pos, *args[0], context, "while evaluating the argument passed to builtins.unsafeDiscardStringContext");
v.mkString(*s);
}
@@ -17,7 +17,7 @@ static RegisterPrimOp primop_unsafeDiscardStringContext("__unsafeDiscardStringCo
static void prim_hasContext(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
PathSet context;
- state.forceString(*args[0], context, pos, "While evaluating the argument passed to builtins.hasContext");
+ state.forceString(*args[0], context, pos, "while evaluating the argument passed to builtins.hasContext");
v.mkBool(!context.empty());
}
@@ -33,7 +33,7 @@ static RegisterPrimOp primop_hasContext("__hasContext", 1, prim_hasContext);
static void prim_unsafeDiscardOutputDependency(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
PathSet context;
- auto s = state.coerceToString(pos, *args[0], context, "While evaluating the argument passed to builtins.unsafeDiscardOutputDependency");
+ auto s = state.coerceToString(pos, *args[0], context, "while evaluating the argument passed to builtins.unsafeDiscardOutputDependency");
PathSet context2;
for (auto & p : context)
@@ -72,7 +72,7 @@ static void prim_getContext(EvalState & state, const Pos & pos, Value * * args,
Strings outputs;
};
PathSet context;
- state.forceString(*args[0], context, pos, "While evaluating the argument passed to builtins.getContext");
+ state.forceString(*args[0], context, pos, "while evaluating the argument passed to builtins.getContext");
auto contextInfos = std::map<Path, ContextInfo>();
for (const auto & p : context) {
Path drv;
@@ -138,31 +138,31 @@ static void prim_appendContext(EvalState & state, const Pos & pos, Value * * arg
PathSet context;
auto orig = state.forceString(*args[0], context, pos, "while evaluating the first argument passed to builtins.appendContext");
- state.forceAttrs(*args[1], pos, "While evaluating the second argument passed to builtins.appendContext");
+ state.forceAttrs(*args[1], pos, "while evaluating the second argument passed to builtins.appendContext");
auto sPath = state.symbols.create("path");
auto sAllOutputs = state.symbols.create("allOutputs");
for (auto & i : *args[1]->attrs) {
if (!state.store->isStorePath(i.name))
throw EvalError({
- .msg = hintfmt("Context key '%s' is not a store path", i.name),
+ .msg = hintfmt("context key '%s' is not a store path", i.name),
.errPos = *i.pos
});
if (!settings.readOnlyMode)
state.store->ensurePath(state.store->parseStorePath(i.name));
- state.forceAttrs(*i.value, *i.pos, "While evaluating the value of a string context");
+ state.forceAttrs(*i.value, *i.pos, "while evaluating the value of a string context");
auto iter = i.value->attrs->find(sPath);
if (iter != i.value->attrs->end()) {
- if (state.forceBool(*iter->value, *iter->pos, "While evaluating the `path` attribute of a string context"))
+ if (state.forceBool(*iter->value, *iter->pos, "while evaluating the `path` attribute of a string context"))
context.insert(i.name);
}
iter = i.value->attrs->find(sAllOutputs);
if (iter != i.value->attrs->end()) {
- if (state.forceBool(*iter->value, *iter->pos, "While evaluating the `allOutputs` attribute of a string context")) {
+ if (state.forceBool(*iter->value, *iter->pos, "while evaluating the `allOutputs` attribute of a string context")) {
if (!isDerivation(i.name)) {
throw EvalError({
- .msg = hintfmt("Tried to add all-outputs context of %s, which is not a derivation, to a string", i.name),
+ .msg = hintfmt("tried to add all-outputs context of %s, which is not a derivation, to a string", i.name),
.errPos = *i.pos
});
}
@@ -172,15 +172,15 @@ static void prim_appendContext(EvalState & state, const Pos & pos, Value * * arg
iter = i.value->attrs->find(state.sOutputs);
if (iter != i.value->attrs->end()) {
- state.forceList(*iter->value, *iter->pos, "While evaluating the `outputs` attribute of a string context");
+ state.forceList(*iter->value, *iter->pos, "while evaluating the `outputs` attribute of a string context");
if (iter->value->listSize() && !isDerivation(i.name)) {
throw EvalError({
- .msg = hintfmt("Tried to add derivation output context of %s, which is not a derivation, to a string", i.name),
+ .msg = hintfmt("tried to add derivation output context of %s, which is not a derivation, to a string", i.name),
.errPos = *i.pos
});
}
for (auto elem : iter->value->listItems()) {
- auto name = state.forceStringNoCtx(*elem, *iter->pos, "While evaluating an output name within a string context");
+ auto name = state.forceStringNoCtx(*elem, *iter->pos, "while evaluating an output name within a string context");
context.insert(concatStrings("!", name, "!", i.name));
}
}