mirror of
https://github.com/NixOS/nix
synced 2025-06-25 23:11:16 +02:00
Make function arguments retain position info
This allows querying the location of function arguments. E.g. builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null)) => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
This commit is contained in:
parent
a7540294cf
commit
c34e96f7e0
5 changed files with 14 additions and 5 deletions
|
@ -209,9 +209,10 @@ struct ExprList : Expr
|
|||
|
||||
struct Formal
|
||||
{
|
||||
Pos pos;
|
||||
Symbol name;
|
||||
Expr * def;
|
||||
Formal(const Symbol & name, Expr * def) : name(name), def(def) { };
|
||||
Formal(const Pos & pos, const Symbol & name, Expr * def) : pos(pos), name(name), def(def) { };
|
||||
};
|
||||
|
||||
struct Formals
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue