split <2.34 code in cmake

This commit is contained in:
atagen 2026-04-23 22:28:21 +10:00
parent df23fb0436
commit 70b537244d
2 changed files with 23 additions and 9 deletions

View file

@ -40,13 +40,22 @@ static void prim_scope(EvalState & state, const PosIdx pos, Value ** args, Value
v = *inner;
}
static RegisterPrimOp rp(PrimOp{
.name = "scope",
.args = {"path", "value"},
.doc = R"(
Construct a nested attribute set from a dotted string path and a value.
static RegisterPrimOp rp(
#ifndef NIX_PRE_234
PrimOp
#endif
{
.name = "scope",
.args = {"path", "value"},
.doc = R"(
Construct a nested attribute set from a dotted string path and a value.
Example: `scope "a.b.c" 42` evaluates to `{ a = { b = { c = 42; }; }; }`.
)",
.impl = prim_scope,
});
Example: `scope "a.b.c" 42` evaluates to `{ a = { b = { c = 42; }; }; }`.
)",
#ifdef NIX_PRE_234
.fun = prim_scope,
#else
.impl = prim_scope,
#endif
}
);