summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-12-07 06:07:16 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-12-07 06:07:16 -0800
commit5647c797522191b15343dcebf8352ab1dd330cf1 (patch)
tree9b44233eabe35d20ceb828f8298aa035962383be
parente5db67f93f6fe24c8c7633cbbcea1c7832e6232f (diff)
downloadtxr-5647c797522191b15343dcebf8352ab1dd330cf1.tar.gz
txr-5647c797522191b15343dcebf8352ab1dd330cf1.tar.bz2
txr-5647c797522191b15343dcebf8352ab1dd330cf1.zip
C++ regression in printer.
* lib.c (obj_print_impl): The recent change for unquote-related read/print consistency introduced initializing declarations which are crossed by a label. They are not actually used past the label, so we can put in a block to delimit their scope to get rid of the compiler error.
-rw-r--r--lib.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/lib.c b/lib.c
index dd599d22..1ca1790c 100644
--- a/lib.c
+++ b/lib.c
@@ -9663,29 +9663,31 @@ val obj_print_impl(val obj, val out, val pretty, struct strm_ctx *ctx)
for (iter = obj; consp(iter); iter = cdr(iter)) {
val d;
- val a = car(iter);
- val unq = nil;
-
- if (a == sys_unquote_s)
- unq = lit(". ,");
- else if (a == sys_splice_s)
- unq = lit(". ,*");
-
- if (unq) {
- val d = cdr(iter);
- val ad = car(d);
-
- if (consp(d) && !cdr(d)) {
- put_string(unq, out);
- if (a == sys_unquote_s && unquote_star_check(ad, pretty))
- put_char(chr(' '), out);
- obj_print_impl(ad, out, pretty, ctx);
- put_char(closepar, out);
- break;
+ {
+ val a = car(iter);
+ val unq = nil;
+
+ if (a == sys_unquote_s)
+ unq = lit(". ,");
+ else if (a == sys_splice_s)
+ unq = lit(". ,*");
+
+ if (unq) {
+ val d = cdr(iter);
+ val ad = car(d);
+
+ if (consp(d) && !cdr(d)) {
+ put_string(unq, out);
+ if (a == sys_unquote_s && unquote_star_check(ad, pretty))
+ put_char(chr(' '), out);
+ obj_print_impl(ad, out, pretty, ctx);
+ put_char(closepar, out);
+ break;
+ }
}
- }
- obj_print_impl(a, out, pretty, ctx);
+ obj_print_impl(a, out, pretty, ctx);
+ }
finish:
d = cdr(iter);
if (nilp(d)) {