summaryrefslogtreecommitdiff
path: root/footobar.c
diff options
context:
space:
mode:
Diffstat (limited to 'footobar.c')
-rw-r--r--footobar.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/footobar.c b/footobar.c
index a94ab39..58f6d16 100644
--- a/footobar.c
+++ b/footobar.c
@@ -70,12 +70,22 @@ static bool Tconv(Format *f, int ignore) {
case nSwitch: fmtprint(f, "switch(%T){%T}", n->u[0].p, n->u[1].p); break;
case nMatch: fmtprint(f, "~ %T %T", n->u[0].p, n->u[1].p); break;
case nWhile: fmtprint(f, "while(%T)%T", n->u[0].p, n->u[1].p); break;
- case nLappend: fmtprint(f, "(%T %T)", n->u[0].p, n->u[1].p); break;
case nForin: fmtprint(f, "for(%T in %T)%T", n->u[0].p, n->u[1].p, n->u[2].p); break;
case nVarsub: fmtprint(f, "$%T(%T)", n->u[0].p, n->u[1].p); break;
case nWord:
fmtprint(f, quotep(n->u[0].s, dollar) ? "%#S" : "%S", n->u[0].s);
break;
+ case nLappend: {
+ static bool inlist;
+ if (!inlist) {
+ inlist = TRUE;
+ fmtprint(f, "(%T %T)", n->u[0].p, n->u[1].p);
+ inlist = FALSE;
+ } else {
+ fmtprint(f, "%T %T", n->u[0].p, n->u[1].p);
+ }
+ break;
+ }
case nCount: case nFlat: case nVar: {
char *lp = "", *rp = "";
Node *n0 = n->u[0].p;