summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-01-26 21:29:54 -0800
committerKaz Kylheku <kaz@kylheku.com>2017-01-26 21:29:54 -0800
commit50f33cf71ef9d4b6dbade885667ff0c075dd77f4 (patch)
treef6306dbc7706535f9ee696e2202628d365566827 /eval.c
parent466f2a5842b131b0d94b9a97e78da709920a2c06 (diff)
downloadtxr-50f33cf71ef9d4b6dbade885667ff0c075dd77f4.tar.gz
txr-50f33cf71ef9d4b6dbade885667ff0c075dd77f4.tar.bz2
txr-50f33cf71ef9d4b6dbade885667ff0c075dd77f4.zip
bugfix: :filter not handled right in output var.
This issue was fixed in quasiliterals only. Because of the implementation duplicity between output vars and quasiliteral vars, we have to fix it in two places. When the parser handles quasiliterals, it builds vars without expanding the contents. The quasiliteral expander takes care of recognzing (sys:var ...) forms and properly handles them and their attributes, avoiding expanding the argument of a :filter keyword. When the parser handles an o_var that is a braced variable, it calls expand on its contents right there, then builds the (sys:var ...) form from the expanded contents. Why don't we just call expand_quasi in the o_var rule to have a single (sys:var ...) form expanded exactly how it is done in quasiliterals. * eval.c (expand_quasi): Change static function to external. * eval.c (expand_quasi): Declared. * parser.y (o_var): Construct an unexpanded (sys:var ...) form, and then wrap it in a one-element list. This is a de-facto quasi-items list, which can be expanded by expand_quasi. Then we pull the car of the expansion to get our expanded var.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 74521190..4ccc6f62 100644
--- a/eval.c
+++ b/eval.c
@@ -3182,7 +3182,7 @@ static val expand_var_mods(val mods, val menv)
}
}
-static val expand_quasi(val quasi_forms, val menv)
+val expand_quasi(val quasi_forms, val menv)
{
if (nilp(quasi_forms)) {
return nil;