diff options
author | zimbatm <zimbatm@zimbatm.com> | 2019-10-28 21:22:38 +0100 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2019-10-28 21:29:54 +0100 |
commit | ec448f8bb694b6f9546e49fe6a79b86ff2b2f90a (patch) | |
tree | fc4179397140249009ec6e6203d86f40884a9360 /src/libexpr/attr-path.cc | |
parent | 59c72497696eaafa294c34699795788d24d68c68 (diff) |
libexpr: findDerivationFilename return Pos instead of tuple
Diffstat (limited to 'src/libexpr/attr-path.cc')
-rw-r--r-- | src/libexpr/attr-path.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc index 7a6d8dfd0..c86dbeebb 100644 --- a/src/libexpr/attr-path.cc +++ b/src/libexpr/attr-path.cc @@ -93,7 +93,7 @@ Value * findAlongAttrPath(EvalState & state, const string & attrPath, } -std::tuple<std::string, int> findDerivationFilename(EvalState & state, Value & v, std::string what) +Pos findDerivationFilename(EvalState & state, Value & v, std::string what) { Value * v2; try { @@ -110,14 +110,16 @@ std::tuple<std::string, int> findDerivationFilename(EvalState & state, Value & v throw Error("cannot parse meta.position attribute '%s'", pos); std::string filename(pos, 0, colon); - int lineno; + unsigned int lineno; try { lineno = std::stoi(std::string(pos, colon + 1)); } catch (std::invalid_argument & e) { throw Error("cannot parse line number '%s'", pos); } - return std::make_tuple(filename, lineno); + Symbol file = state.symbols.create(filename); + + return { file, lineno, 0 }; } |