summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-02-18 21:22:31 -0800
committerKaz Kylheku <kaz@kylheku.com>2012-02-18 21:22:31 -0800
commit056107ff44d2ae75b7b7db98979d1a920a37d439 (patch)
tree28601fc6f1c40138c8648d9e80c4247929c54128 /match.c
parentd14ddd48c53f3d9ec960782c75f657a627456d22 (diff)
downloadtxr-056107ff44d2ae75b7b7db98979d1a920a37d439.tar.gz
txr-056107ff44d2ae75b7b7db98979d1a920a37d439.tar.bz2
txr-056107ff44d2ae75b7b7db98979d1a920a37d439.zip
* match.c (extract_vars): If a brace var is actually an
expression, then recurse into the expression to find variables. This allows us to do things like @{`@x`} inside a @(repeat) or @(rep).
Diffstat (limited to 'match.c')
-rw-r--r--match.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/match.c b/match.c
index d253913a..db21e044 100644
--- a/match.c
+++ b/match.c
@@ -1535,7 +1535,10 @@ static val extract_vars(val output_spec)
if (consp(output_spec)) {
val sym = first(output_spec);
if (sym == var_s) {
- list_collect (tai, second(output_spec));
+ if (bindable(second(output_spec)))
+ list_collect (tai, second(output_spec));
+ else
+ list_collect_nconc (tai, extract_vars(second(output_spec)));
} else if (sym != expr_s) {
for (; output_spec; output_spec = cdr(output_spec))
list_collect_nconc(tai, extract_vars(car(output_spec)));