mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
don't use Symbol in Pos to represent a path
PosTable deduplicates origin information, so using symbols for paths is no longer necessary. moving away from path Symbols also reduces the usage of symbols for things that are not keys in attribute sets, which will become important in the future when we turn symbols into indices as well.
This commit is contained in:
parent
6526d1676b
commit
00a3280232
6 changed files with 12 additions and 14 deletions
|
@ -934,7 +934,7 @@ void EvalState::mkThunk_(Value & v, Expr * expr)
|
|||
void EvalState::mkPos(Value & v, PosIdx p)
|
||||
{
|
||||
auto pos = positions[p];
|
||||
if (pos.file.set()) {
|
||||
if (!pos.file.empty()) {
|
||||
auto attrs = buildBindings(3);
|
||||
attrs.alloc(sFile).mkString(pos.file);
|
||||
attrs.alloc(sLine).mkInt(pos.line);
|
||||
|
@ -1296,7 +1296,7 @@ void ExprSelect::eval(EvalState & state, Env & env, Value & v)
|
|||
|
||||
} catch (Error & e) {
|
||||
auto pos2r = state.positions[pos2];
|
||||
if (pos2 && pos2r.file != state.sDerivationNix)
|
||||
if (pos2 && pos2r.file != state.derivationNixPath)
|
||||
state.addErrorTrace(e, pos2, "while evaluating the attribute '%1%'",
|
||||
showAttrPath(state, env, attrPath));
|
||||
throw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue