diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08T12·40+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-08T12·40+0200 |
commit | 6b47de580ffe6101863a1054d9d47f9cbe691214 (patch) | |
tree | 297352fe704a739e5e25a40c0f6e77bf30592cd2 /src/libexpr/eval.cc | |
parent | a5e0f64db3f7355e320ecda478b84f238bf8869c (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.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 02f99feb313c..3d77b94e7752 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) ; } } |