summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-27 14:05:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-27 14:05:00 -0700
commitcec96d814a65ffe7fa3f8a80c32068cb1532c4e9 (patch)
tree5c9b3bd6dedbc43892a18228f4c1b524f03707d6
parent609b0dd2146330e61d8ed024fca660158836d8c0 (diff)
downloadtxr-cec96d814a65ffe7fa3f8a80c32068cb1532c4e9.tar.gz
txr-cec96d814a65ffe7fa3f8a80c32068cb1532c4e9.tar.bz2
txr-cec96d814a65ffe7fa3f8a80c32068cb1532c4e9.zip
Fix cascading message for unbound vars in pattern language.
Commit 5ab2b46a on 2011-10-06 introduced a hack for suppressing redundant location informaton being tacked on to an unbound variable error (in the TXR pattern language, not TXR Lisp). This ugly hack broke along the way when uw_throw was changed so that exception arguments are always lists, because it still expects the exception object to be a string. (The breaking change took place in 55cc8493, on 2015-02-06). * match.c (do_txeval): In exception catch, exc is a list, and not a string.
-rw-r--r--match.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/match.c b/match.c
index b90d342b..7a521416 100644
--- a/match.c
+++ b/match.c
@@ -1550,8 +1550,10 @@ static val do_txeval(val spec, val form, val bindings, val allow_unbound)
}
uw_catch (exc_sym, exc) {
- if (stringp(exc) && !equal(exc, lit("")) &&
- chr_str(exc, zero) == chr('('))
+ val msg = if3(consp(exc), car(exc), exc);
+
+ if (stringp(msg) && !equal(msg, lit("")) &&
+ chr_str(msg, zero) == chr('('))
{
uw_throw (exc_sym, exc);
}