Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: expanding parameters like echo/print builtins
- X-seq: zsh-workers 29229
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Peter Stephenson <Peter.Stephenson@xxxxxxx>
- Subject: Re: PATCH: expanding parameters like echo/print builtins
- Date: Wed, 11 May 2011 18:38:46 +0200
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=Irhp5xvKHMmofQs4TOuZVwe6fNNlXaExUTfP1StU0tI=; b=hvr62tlYpbJ90d8N189TmPRmTQbfHHNLX2NvoTZSME2DVUJWeIzfEMKmapmJggmnbe ZwIctDLHV+00HwZkdxER+PrQeVueBPmktKFMe1ngv6fuDhA91xyvxWGyAdAb23sCaTq4 WXnwUNlOXWWZR2dvq4RGHy7j+IGqmqeGifuBQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=xzYeYFD3CrZAQVWZXbbX4FEkjjwgrpMjvGSFgmGqA8mV2HRnbE/W77I8cWqCw4SN/X hmSNtRXVPYB23gqNQ+jckfjAljVNK6bgS8U1oYF6GAOhssF5acGAkfV2uZlv3n/p0++s E6Gm44tRi5LEoGk79m2kOZV2AZ2gZFNtN+VvI=
- In-reply-to: <20110511172114.56080d04@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1305118971-25617-1-git-send-email-mikachu@gmail.com> <20110511172114.56080d04@pwslap01u.europe.root.pri>
On 11 May 2011 18:21, Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> On Wed, 11 May 2011 15:02:51 +0200
> Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> * The (@) flag; interacts obscurely with qt and isarr.
>> * This is one of the things that decides whether multsub
>> * will produce an array, but in an extremely indirect fashion.
>> @@ -1932,6 +1936,36 @@ paramsubst(LinkList l, LinkNode n, char **str,
>> int qt, int ssub) presc++;
>> break;
>>
>> + case 'z':
>
> This might want to be 'g'.
Indeed, I noticed this line had spaces instead of tabs, so while
editing the patch file I copied the z line from the context and added
a +, taking care to change the z to a g as I did so, but somehow
didn't actually. So if this made you worry that I hadn't tested the
patch, fear not :). Speaking of testing, should I add tests for this
too? The c and e flags will have tendencies to output unprintable
characters, can I write them in the expected test output somehow? Ie,
it is probably not a good idea to write
>${(g:c:):-^X}
when testing that feature, since it'll break in the same way in both
places. It is probably not likely that c specifically would break and
everything else work, so I would personally be happy with just testing
g:: and maybe g:o: too, since that's easy enough. In fact...
--- a/Test/D04parameter.ztst
+++ b/Test/D04parameter.ztst
@@ -298,6 +298,14 @@
>Howzat
>usay
+ foo='\u65\123'
+ print -r ${(g:o:)foo}
+ foo='\u65\0123'
+ print -r ${(g::)foo}
+0:${(g)...}
+>eS
+>eS
+
foo='I'\''m nearly out of my mind with tedium'
bar=foo
print ${(P)bar}
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author