libexpr/builtins: Document appendContext
Change-Id: Ic45e0d4f6f1646552a7162bd8916f63fc11e5e62
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
name: appendContext
|
||||
args: [s, ctx]
|
||||
---
|
||||
|
||||
Appends the attribute set `ctx` as a context to the string `s`, see [`getContext`](#builtins-getContext) for details on the format of the context.
|
||||
@@ -14,6 +14,7 @@ void prim_fetchGit(EvalState & state, Value * * args, Value & v);
|
||||
void prim_fetchTarball(EvalState & state, Value * * args, Value & v);
|
||||
void prim_fetchurl(EvalState & state, Value * * args, Value & v);
|
||||
void prim_fromTOML(EvalState & state, Value * * args, Value & v);
|
||||
void prim_appendContext(EvalState & state, Value ** args, Value & v);
|
||||
void prim_getContext(EvalState & state, Value * * args, Value & v);
|
||||
void prim_hasContext(EvalState & state, Value * * args, Value & v);
|
||||
void prim_unsafeDiscardOutputDependency(EvalState & state, Value * * args, Value & v);
|
||||
|
||||
@@ -56,6 +56,7 @@ builtin_definitions = files(
|
||||
'builtins/addErrorContext.md',
|
||||
'builtins/all.md',
|
||||
'builtins/any.md',
|
||||
'builtins/appendContext.md',
|
||||
'builtins/attrNames.md',
|
||||
'builtins/attrValues.md',
|
||||
'builtins/baseNameOf.md',
|
||||
|
||||
@@ -165,7 +165,7 @@ void prim_getContext(EvalState & state, Value * * args, Value & v)
|
||||
See the commentary above unsafeGetContext for details of the
|
||||
context representation.
|
||||
*/
|
||||
static void prim_appendContext(EvalState & state, Value * * args, Value & v)
|
||||
void prim_appendContext(EvalState & state, Value ** args, Value & v)
|
||||
{
|
||||
NixStringContext context;
|
||||
auto orig = state.forceString(*args[0], context, noPos, "while evaluating the first argument passed to builtins.appendContext");
|
||||
@@ -241,11 +241,4 @@ static void prim_appendContext(EvalState & state, Value * * args, Value & v)
|
||||
|
||||
v.mkString(orig, context);
|
||||
}
|
||||
|
||||
static RegisterPrimOp primop_appendContext({
|
||||
.name = "__appendContext",
|
||||
.arity = 2,
|
||||
.fun = prim_appendContext
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user