diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-12-13 16:00:44 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-12-13 16:00:44 +0100 |
commit | c9b0a85b088b472eda9818dfaa0cc1a54124933c (patch) | |
tree | 2202fcecec99f2b44ba1754e62f8f1e59c373661 /src/libexpr/nixexpr.hh | |
parent | aea97f07a388915e5a7179f56ab4328fef155f05 (diff) |
Restore display of source lines for stdin/string inputs
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r-- | src/libexpr/nixexpr.hh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 0338a8c37..ac7ce021e 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -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; |