summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--footobar.c12
-rw-r--r--rc.114
2 files changed, 23 insertions, 3 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;
diff --git a/rc.1 b/rc.1
index ca777d7..2567266 100644
--- a/rc.1
+++ b/rc.1
@@ -1933,8 +1933,6 @@ The
notation for flattening should allow for using an arbitrary
separating character, not just space.
.PP
-List definitions in exported functions are "noisier" than they need to be.
-.PP
If both
.Cr $PATH
and
@@ -1958,8 +1956,20 @@ code is illegal.
.Ds
.Cr "while ((~ $1 -*) && (! ~ $1 --)) { ..."
.De
+.TP
The redundant inner parentheses must be omitted.
.PP
+Semantic errors (e.g. "bad concatenation") in
+.B fn prompt
+are not handled elegantly. For example,
+.Ds
+.Cr "fn prompt { echo (a b)^(c d e) }"
+.De
+.TP
+throws
+.I rc
+into a tailspin.
+.PP
Bug reports should be mailed to
.Cr "<tjg@star.le.ac.uk>" .
.SH INCOMPATIBILITIES