diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-04-06 15:25:06 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-04-06 15:25:06 +0200 |
commit | a9759407e55fb02c6e306fdd9fcedd821e465024 (patch) | |
tree | 9359ee9478d9d4f4c9bf74bfb4bba745a6a36bbf /src/libexpr/nixexpr.cc | |
parent | 94812cca98fbb157e5f64a15a85a2b852d289feb (diff) |
Origin: Use SourcePath
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r-- | src/libexpr/nixexpr.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index eb6f062b4..2c9d5754e 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -31,9 +31,9 @@ struct PosAdapter : AbstractPos // Get rid of the null terminators added by the parser. return std::string(s.source->c_str()); }, - [](const Path & path) -> std::optional<std::string> { + [](const SourcePath & path) -> std::optional<std::string> { try { - return readFile(path); + return path.readFile(); } catch (Error &) { return std::nullopt; } @@ -47,7 +47,7 @@ struct PosAdapter : AbstractPos [&](const Pos::none_tag &) { out << "«none»"; }, [&](const Pos::Stdin &) { out << "«stdin»"; }, [&](const Pos::String & s) { out << "«string»"; }, - [&](const Path & path) { out << path; } + [&](const SourcePath & path) { out << path; } }, origin); } }; |