diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 14:05:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-27 14:05:00 -0700 |
commit | cec96d814a65ffe7fa3f8a80c32068cb1532c4e9 (patch) | |
tree | 5c9b3bd6dedbc43892a18228f4c1b524f03707d6 | |
parent | 609b0dd2146330e61d8ed024fca660158836d8c0 (diff) | |
download | txr-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); } |