From 856616ca9fbc158073e8f2a67edd92db151bfce1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 1 Oct 2020 06:09:24 -0700 Subject: txr: bugfix: repeat not finding Lisp vars in brace. The following does not work and is fixed here: @(output) @(repeat) @{lisp-expr ...} @(end) When a Lisp expression occurs in a braced expansion syntax, it is not not traversed to find variables. * parser.y (extract_vars): Treat the second element of a sys:var as a Lisp expression, and find variables. Don't do this in 128 or older compatibility mode, because then that is a TXR expression. * y.tab.c.shipped: Regenerated. --- y.tab.c.shipped | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'y.tab.c.shipped') diff --git a/y.tab.c.shipped b/y.tab.c.shipped index 2345cb9a..a148a9b3 100644 --- a/y.tab.c.shipped +++ b/y.tab.c.shipped @@ -6767,13 +6767,17 @@ static val extract_vars(val output_spec) if (consp(output_spec)) { val sym = first(output_spec); if (sym == var_s) { - val name = second(output_spec); + val expr = second(output_spec); val modifiers = third(output_spec); - if (bindable(name)) - tai = list_collect(tai, name); - else - tai = list_collect_nconc(tai, extract_vars(name)); + if (bindable(expr)) { + tai = list_collect(tai, expr); + } else if (opt_compat && opt_compat <= 128) { + tai = list_collect_nconc(tai, extract_vars(expr)); + } else { + val frefs = expand_with_free_refs(expr, nil, nil); + tai = list_collect_nconc(tai, second(frefs)); + } for (; modifiers; modifiers = cdr(modifiers)) { val mod = car(modifiers); -- cgit v1.2.3