about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-08T12·40+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-08T12·40+0200
commit6b47de580ffe6101863a1054d9d47f9cbe691214 (patch)
tree297352fe704a739e5e25a40c0f6e77bf30592cd2 /src/libexpr/nixexpr.hh
parenta5e0f64db3f7355e320ecda478b84f238bf8869c (diff)
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.
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 7db0a15fa3..e555a5dff0 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -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);
 };