about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
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/eval.cc
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/eval.cc')
-rw-r--r--src/libexpr/eval.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 02f99feb31..3d77b94e77 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -315,7 +315,7 @@ inline Value * EvalState::lookupVar(Env * env, const ExprVar & var, bool noEval)
             return j->value;
         }
         if (!env->prevWith)
-            throwEvalError("undefined variable `%1%'", var.name);
+            throw EvalError(format("undefined variable `%1%' at %2%") % var.name % var.pos);
         for (unsigned int l = env->prevWith; l; --l, env = env->up) ;
     }
 }