1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

don't use Symbol in Pos to represent a path

PosTable deduplicates origin information, so using symbols for paths is no
longer necessary. moving away from path Symbols also reduces the usage of
symbols for things that are not keys in attribute sets, which will become
important in the future when we turn symbols into indices as well.
This commit is contained in:
pennae 2022-03-05 17:31:50 +01:00
parent 6526d1676b
commit 00a3280232
6 changed files with 12 additions and 14 deletions

View file

@ -26,7 +26,7 @@ MakeError(RestrictedPathError, Error);
struct Pos
{
Symbol file;
std::string file;
FileOrigin origin;
uint32_t line;
uint32_t column;
@ -64,10 +64,10 @@ public:
explicit Origin(uint32_t idx): idx(idx), file{}, origin{} {}
public:
const Symbol file;
const std::string file;
const FileOrigin origin;
Origin(Symbol file, FileOrigin origin): file(file), origin(origin) {}
Origin(std::string file, FileOrigin origin): file(std::move(file)), origin(origin) {}
};
struct Offset {