diff options
| author | tjg <tjg> | 2001-10-03 12:41:38 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:19 +0100 |
| commit | da5e3263a66be23102fd988e1bb51a152d1869dd (patch) | |
| tree | adfc2f596f97157292fc4609590429a4ee95d1f1 /footobar.c | |
| parent | a11a8d312e531231ed4d284f3cd129ccf2de2a43 (diff) | |
Feature: exported lists no longer use redundant parentheses.
Diffstat (limited to 'footobar.c')
| -rw-r--r-- | footobar.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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; |