summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--match.c5
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 15148d4d..c8ebca7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2012-02-18 Kaz Kylheku <kaz@kylheku.com>
+ * 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).
+
+2012-02-18 Kaz Kylheku <kaz@kylheku.com>
+
Allow braced output variables to actually be arbitrary substitutions.
* eval.c (subst_vars): Treat the variable as an arbitrary
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)));