summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-02-27 17:58:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2023-02-27 17:58:37 -0800
commitbe0b827138ad002eed0169be539787399221bb97 (patch)
tree5d25ab5d84b84f1b88de7a176c7928f31851a119
parentd9586bfd4bcad877c050970060eacd9e076cc3ba (diff)
downloadtxr-be0b827138ad002eed0169be539787399221bb97.tar.gz
txr-be0b827138ad002eed0169be539787399221bb97.tar.bz2
txr-be0b827138ad002eed0169be539787399221bb97.zip
txr: bugfix, allow lazy lists in multi match.
* match.c (do_match_line): Handle LCONS the same way as CONS. When a variable occurs whose value is a list of strings, that may be a lazy list. I ran into a problem using @(data x) to capture a list of strings, and then matching that with @x; the error being "unsupported object in spec", caused by the list's LCONS type not handled in this switch.
-rw-r--r--match.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/match.c b/match.c
index 14a0bb3f..29f634cf 100644
--- a/match.c
+++ b/match.c
@@ -1752,6 +1752,7 @@ static val do_match_line(match_line_ctx *c)
switch (type(elem)) {
case CONS: /* directive */
+ case LCONS:
{
val directive = first(elem);