From 6b47de580ffe6101863a1054d9d47f9cbe691214 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Oct 2013 14:40:51 +0200 Subject: 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. --- src/libexpr/eval.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libexpr/eval.cc') 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) ; } } -- cgit 1.4.1