mirror of
https://github.com/NixOS/nix
synced 2025-06-24 18:01:16 +02:00
libexpr: Add and use pathAccessor
getter
This commit is contained in:
parent
e4df189123
commit
bc6b52aff0
2 changed files with 6 additions and 3 deletions
|
@ -2636,7 +2636,7 @@ void EvalState::assertEqValues(Value & v1, Value & v2, const PosIdx pos, std::st
|
|||
return;
|
||||
|
||||
case nPath:
|
||||
if (v1.payload.path.accessor != v2.payload.path.accessor) {
|
||||
if (v1.pathAccessor() != v2.pathAccessor()) {
|
||||
error<AssertionError>(
|
||||
"path '%s' is not equal to path '%s' because their accessors are different",
|
||||
ValuePrinter(*this, v1, errorPrintOptions),
|
||||
|
@ -2810,7 +2810,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v
|
|||
case nPath:
|
||||
return
|
||||
// FIXME: compare accessors by their fingerprint.
|
||||
v1.payload.path.accessor == v2.payload.path.accessor
|
||||
v1.pathAccessor() == v2.pathAccessor()
|
||||
&& strcmp(v1.pathStr(), v2.pathStr()) == 0;
|
||||
|
||||
case nNull:
|
||||
|
|
|
@ -444,7 +444,7 @@ public:
|
|||
{
|
||||
assert(internalType == tPath);
|
||||
return SourcePath(
|
||||
ref(payload.path.accessor->shared_from_this()),
|
||||
ref(pathAccessor()->shared_from_this()),
|
||||
CanonPath(CanonPath::unchecked_t(), pathStr()));
|
||||
}
|
||||
|
||||
|
@ -497,6 +497,9 @@ public:
|
|||
|
||||
const char * pathStr() const
|
||||
{ return payload.path.path; }
|
||||
|
||||
SourceAccessor * pathAccessor() const
|
||||
{ return payload.path.accessor; }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue