mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
Restore display of source lines for stdin/string inputs
This commit is contained in:
parent
aea97f07a3
commit
c9b0a85b08
3 changed files with 44 additions and 48 deletions
|
@ -28,10 +28,11 @@ struct Pos
|
|||
uint32_t line;
|
||||
uint32_t column;
|
||||
|
||||
struct stdin_tag {};
|
||||
struct string_tag {};
|
||||
struct none_tag { };
|
||||
struct Stdin { ref<std::string> source; };
|
||||
struct String { ref<std::string> source; };
|
||||
|
||||
typedef std::variant<stdin_tag, string_tag, Path> Origin;
|
||||
typedef std::variant<none_tag, Stdin, String, Path> Origin;
|
||||
|
||||
Origin origin;
|
||||
|
||||
|
@ -72,7 +73,7 @@ public:
|
|||
mutable uint32_t idx = std::numeric_limits<uint32_t>::max();
|
||||
|
||||
// Used for searching in PosTable::[].
|
||||
explicit Origin(uint32_t idx): idx(idx), origin{Pos::stdin_tag()} {}
|
||||
explicit Origin(uint32_t idx): idx(idx), origin{Pos::none_tag()} {}
|
||||
|
||||
public:
|
||||
const Pos::Origin origin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue