summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-27 00:13:22 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-27 00:13:22 -0800
commit09eb73cde9c64e6fa29cbb410b25c6dd84a8a6f2 (patch)
tree2011d48a22860ee0c44c5b8b3bd6b6cd5cc2ff3e /lib.c
parentc150e646fa90409c412f07f59edbb897bdbb4997 (diff)
downloadtxr-09eb73cde9c64e6fa29cbb410b25c6dd84a8a6f2.tar.gz
txr-09eb73cde9c64e6fa29cbb410b25c6dd84a8a6f2.tar.bz2
txr-09eb73cde9c64e6fa29cbb410b25c6dd84a8a6f2.zip
* lib.c (obj_print, obj_pprint): Bugfix: there may be
additional expressions forms in (sys:var <sym>) after the sym. These were not being printed. Such syntax occurs often in the TXR pattern language.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 63d38183..ecabd77f 100644
--- a/lib.c
+++ b/lib.c
@@ -5049,7 +5049,7 @@ val obj_print(val obj, val out)
} else if (sym == splice_s) {
put_string(lit(",*"), out);
obj_print(second(obj), out);
- } else if (sym == var_s && symbolp(second(obj))) {
+ } else if (sym == var_s && symbolp(second(obj)) && !cdr(cdr(obj))) {
put_char(chr('@'), out);
obj_print(second(obj), out);
} else if (sym == expr_s) {
@@ -5214,7 +5214,7 @@ val obj_pprint(val obj, val out)
} else if (sym == splice_s) {
put_string(lit(",*"), out);
obj_pprint(second(obj), out);
- } else if (sym == var_s && symbolp(second(obj))) {
+ } else if (sym == var_s && symbolp(second(obj)) && !cdr(cdr(obj))) {
put_char(chr('@'), out);
obj_print(second(obj), out);
} else if (sym == expr_s) {