mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
Show the exact position of undefined variables
In particular, undefined variable errors in a "with" previously didn't show *any* position information, so this should help a lot in those cases.
This commit is contained in:
parent
a5e0f64db3
commit
6b47de580f
4 changed files with 18 additions and 21 deletions
|
|
@ -109,6 +109,7 @@ struct ExprPath : Expr
|
|||
|
||||
struct ExprVar : Expr
|
||||
{
|
||||
Pos pos;
|
||||
Symbol name;
|
||||
|
||||
/* Whether the variable comes from an environment (e.g. a rec, let
|
||||
|
|
@ -124,7 +125,7 @@ struct ExprVar : Expr
|
|||
unsigned int level;
|
||||
unsigned int displ;
|
||||
|
||||
ExprVar(const Symbol & name) : name(name) { };
|
||||
ExprVar(const Pos & pos, const Symbol & name) : pos(pos), name(name) { };
|
||||
COMMON_METHODS
|
||||
Value * maybeThunk(EvalState & state, Env & env);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue