zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: pws-19: minor syntactic innovation
@ 1999-05-23 15:15 Peter Stephenson
  1999-05-29  8:31 ` Bart Schaefer
  1999-05-31 22:41 ` Bart Schaefer
  0 siblings, 2 replies; 11+ messages in thread
From: Peter Stephenson @ 1999-05-23 15:15 UTC (permalink / raw)
  To: Zsh hackers list

Just thought of a trivial way to take a lot of grief out of parameter
substitution.  This patch makes the following valid:

  ${${${${(f)"$(typeset)"}:#*local *\=*}%%\=*}##* }

replacing the equivalent but grotesquer

  "${(@)${(@)${(@)${(@f)$(typeset)}:#*local *\=*}%%\=*}##* }"

Since you got nothing when you did that before, I don't see how it can
break anything.  The key point is that quotation of a substitution is
already tested for by looking at whether it begins with a quoted $, not by
whether the parent substitution is quoted.

--- Src/subst.c.qt	Fri May 21 09:14:43 1999
+++ Src/subst.c	Sun May 23 17:07:33 1999
@@ -976,7 +976,9 @@
 		zerr("bad substitution", NULL, 0);
 		return NULL;
 	    }
-	} else
+	} else if (INULL(*s))
+	    s++;
+	else
 	    break;
     }
     globsubst = globsubst && !qt;
@@ -999,6 +1001,8 @@
 	    idbeg = val;
 	copied = 1;
 	*s = sav;
+	while (INULL(*s))
+	    s++;
 	v = (Value) NULL;
     } else if (aspar) {
 	if ((v = getvalue(&s, 1))) {

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1999-06-02  8:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-05-23 15:15 PATCH: pws-19: minor syntactic innovation Peter Stephenson
1999-05-29  8:31 ` Bart Schaefer
1999-05-31 22:41 ` Bart Schaefer
1999-06-01  6:23   ` Andrej Borsenkow
1999-06-01  8:21     ` Peter Stephenson
1999-06-01 12:52       ` Andrej Borsenkow
1999-06-01  9:56   ` PATCH: pws-19: document " Peter Stephenson
1999-06-01 17:44     ` Bart Schaefer
1999-06-02  8:03       ` Peter Stephenson
1999-06-02  8:44         ` sh compatibility " Andrej Borsenkow
1999-06-02  8:30           ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).