mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
Checkpoint
This commit is contained in:
parent
00b0fb27c1
commit
06c1edf889
18 changed files with 134 additions and 120 deletions
|
@ -3,6 +3,7 @@
|
|||
#include <cassert>
|
||||
|
||||
#include "symbol-table.hh"
|
||||
#include "input-accessor.hh"
|
||||
|
||||
#if HAVE_BOEHMGC
|
||||
#include <gc/gc_allocator.h>
|
||||
|
@ -170,7 +171,11 @@ public:
|
|||
const char * * context; // must be in sorted order
|
||||
} string;
|
||||
|
||||
const char * path;
|
||||
struct {
|
||||
InputAccessor * accessor;
|
||||
const char * path;
|
||||
} _path;
|
||||
|
||||
Bindings * attrs;
|
||||
struct {
|
||||
size_t size;
|
||||
|
@ -255,14 +260,7 @@ public:
|
|||
mkString(((const std::string &) s).c_str());
|
||||
}
|
||||
|
||||
inline void mkPath(const char * s)
|
||||
{
|
||||
clearValue();
|
||||
internalType = tPath;
|
||||
path = s;
|
||||
}
|
||||
|
||||
void mkPath(std::string_view s);
|
||||
void mkPath(const SourcePath & path);
|
||||
|
||||
inline void mkNull()
|
||||
{
|
||||
|
@ -404,6 +402,12 @@ public:
|
|||
auto begin = listElems();
|
||||
return ConstListIterable { begin, begin + listSize() };
|
||||
}
|
||||
|
||||
SourcePath path() const
|
||||
{
|
||||
assert(internalType == tPath);
|
||||
return SourcePath { .accessor = *_path.accessor, .path = _path.path };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue