summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-26 09:32:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-26 09:32:22 -0800
commit30b30d178a59ba42182d707061b86bb7580ebeb6 (patch)
treeaccf184b6870c814b60c13ba4e90620a1f30bb9b /lib.c
parentdf9f85b3b720a9ebf7381b2cad7a9680ad0e31bf (diff)
downloadtxr-30b30d178a59ba42182d707061b86bb7580ebeb6.tar.gz
txr-30b30d178a59ba42182d707061b86bb7580ebeb6.tar.bz2
txr-30b30d178a59ba42182d707061b86bb7580ebeb6.zip
bugfix: quasilit read/print consistency, part 2.
In this patch commit I'm addressing the issue introduced in part 1 that expressions in @(output) blocks are still using (sys:expr ...) wrapping, but are passed down to an evaluator which now expects unwrapped expressions now. As part of this change, I'm changing the representation of @expr from (sys:expr . expr) to (sys:expr expr). * eval.c (format_field): Adjust access to sys:expr expression based on new representation. (transform_op): Likewise. * lib.c (obj_print_impl): Likewise. * match.c (dest_bind): Likewise. (do_txeval): Likewise. (do_output_line): Likewise, in some compat code. Here is the fix for the issue: when calling tx_subst_vars, we pass a list of one element containing the expression, not wrapped in sys:expr. Previously, we passed a one-element list containing the sys:expr. * parser.y (o_elem): If a list occurs in the syntax, represent it as (sys:expr list) rather than (sys:expr . list). (list): Do the same for @ n_expr syntax. (expand_meta, make_expr): Harmonize with the representation change.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index c510ba73..f41d1015 100644
--- a/lib.c
+++ b/lib.c
@@ -9556,7 +9556,7 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx)
obj_print_impl(second(obj), out, pretty, ctx);
} else if (sym == expr_s) {
put_char(chr('@'), out);
- obj_print_impl(rest(obj), out, pretty, ctx);
+ obj_print_impl(second(obj), out, pretty, ctx);
} else if (sym == rcons_s && consp(cdr(obj))
&& consp(cddr(obj)) && !(cdddr(obj)))
{