mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
libexpr: findDerivationFilename return Pos instead of tuple
This commit is contained in:
parent
59c7249769
commit
ec448f8bb6
4 changed files with 13 additions and 11 deletions
|
@ -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 };
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue