1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

* Store attribute positions in the AST and report duplicate attribute

errors with position info.
* For all positions, use the position of the first character of the
  first token, rather than the last character of the first token plus
  one.
This commit is contained in:
Eelco Dolstra 2010-05-06 16:46:48 +00:00
parent c82782f9a5
commit 84ce7ac76f
6 changed files with 56 additions and 56 deletions

View file

@ -132,7 +132,7 @@ static void getAllExprs(EvalState & state,
if (hasSuffix(attrName, ".nix"))
attrName = string(attrName, 0, attrName.size() - 4);
attrs.attrs[state.symbols.create(attrName)] =
parseExprFromFile(state, absPath(path2));
ExprAttrs::Attr(parseExprFromFile(state, absPath(path2)), noPos);
}
else
/* `path2' is a directory (with no default.nix in it);
@ -153,7 +153,8 @@ static Expr * loadSourceExpr(EvalState & state, const Path & path)
for a user to have a ~/.nix-defexpr directory that includes
some system-wide directory). */
ExprAttrs * attrs = new ExprAttrs;
attrs->attrs[state.symbols.create("_combineChannels")] = new ExprList();
attrs->attrs[state.symbols.create("_combineChannels")] =
ExprAttrs::Attr(new ExprList(), noPos);
getAllExprs(state, path, *attrs);
return attrs;
}