Add a primop unsafeGetAttrPos to return the position of an attribute

This commit is contained in:
Eelco Dolstra 2013-11-18 22:22:35 +01:00
parent fc33fd86b7
commit 285df765b9
6 changed files with 44 additions and 6 deletions

View file

@ -0,0 +1,6 @@
let
as = {
foo = "bar";
};
pos = builtins.unsafeGetAttrPos "foo" as;
in { inherit (pos) column line; file = baseNameOf pos.file; }