1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 06:01:00 +01:00

Fix relative path handling in the parser

This commit is contained in:
Eelco Dolstra 2022-05-12 18:25:36 +02:00
parent cd893a22f5
commit 1ee5dd6d96
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
18 changed files with 72 additions and 46 deletions

View file

@ -52,6 +52,8 @@ struct InputAccessor
{
return number < x.number;
}
virtual std::string showPath(PathView path);
};
struct FSInputAccessor : InputAccessor
@ -87,6 +89,8 @@ struct SourcePath
std::string_view baseName() const;
SourcePath parent() const;
std::string readFile() const
{ return accessor.readFile(path); }
@ -104,7 +108,8 @@ struct SourcePath
PathFilter & filter = defaultPathFilter) const
{ return accessor.dumpPath(path, sink, filter); }
std::string to_string() const;
std::string to_string() const
{ return accessor.showPath(path); }
SourcePath append(std::string_view s) const;