From 056107ff44d2ae75b7b7db98979d1a920a37d439 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 18 Feb 2012 21:22:31 -0800 Subject: * 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). --- ChangeLog | 7 +++++++ match.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15148d4d..c8ebca7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-18 Kaz Kylheku + + * 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 Allow braced output variables to actually be arbitrary substitutions. 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))); -- cgit v1.2.3