mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
libexpr: Use context
getter
This commit is contained in:
parent
c2aaa68c2c
commit
77f5f50ec2
1 changed files with 3 additions and 3 deletions
|
@ -126,7 +126,7 @@ std::string showType(const Value & v)
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
#pragma GCC diagnostic ignored "-Wswitch-enum"
|
||||||
switch (v.internalType) {
|
switch (v.internalType) {
|
||||||
case tString: return v.payload.string.context ? "a string with context" : "a string";
|
case tString: return v.context() ? "a string with context" : "a string";
|
||||||
case tPrimOp:
|
case tPrimOp:
|
||||||
return fmt("the built-in function '%s'", std::string(v.primOp()->name));
|
return fmt("the built-in function '%s'", std::string(v.primOp()->name));
|
||||||
case tPrimOpApp:
|
case tPrimOpApp:
|
||||||
|
@ -2297,8 +2297,8 @@ std::string_view EvalState::forceString(Value & v, const PosIdx pos, std::string
|
||||||
|
|
||||||
void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings)
|
void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings)
|
||||||
{
|
{
|
||||||
if (v.payload.string.context)
|
if (v.context())
|
||||||
for (const char * * p = v.payload.string.context; *p; ++p)
|
for (const char * * p = v.context(); *p; ++p)
|
||||||
context.insert(NixStringContextElem::parse(*p, xpSettings));
|
context.insert(NixStringContextElem::parse(*p, xpSettings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue