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:
Eelco Dolstra 2013-10-08 14:40:51 +02:00
parent a5e0f64db3
commit 6b47de580f
4 changed files with 18 additions and 21 deletions

View file

@ -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);
};