Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: grammar triviality with '&&'
- X-seq: zsh-workers 34645
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: grammar triviality with '&&'
- Date: Wed, 4 Mar 2015 21:13:25 +0000
- Cc: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= mesmtp; bh=yKAeWsqG3tJra2I96X1FnuQywxw=; b=0G1pzgv4BhFcRIF5Ktqw4 rqDJFZm+Dn7SOG401WZ2K1LzJxw4+tE8cDniZItCr2BZ27FfM3FT1HdsEQ4ZsOl+ 0XBGMfaHs2XEWkShmQUL5z/xT1ahZ6xKNHnWgKi2ZDfs5MPtNxW6Vc4xj1whciqT +/zEhz3Y13toeCKeOAMBlo=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:date:from:to:cc:subject :message-id:references:mime-version:content-type:in-reply-to; s= smtpout; bh=yKAeWsqG3tJra2I96X1FnuQywxw=; b=EU6JBEsfR4+IfLGRA+eo 5qldcQQn1U+C8fxkuccjkCzdIyYJq9LwW6GyN6jQe1akmFv8J0VBIgxw5T2KsRKG rrZ5RkIj5jm1qbZkbliC0qPKM/SPODMDbpxVtFsyKTHwbKuL1v9GchZS0WjVpwUQ kEUdN98W49otG3D93GF17KA=
- In-reply-to: <20150304151830.5e20d732@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: <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <D0509295-7DA9-4F18-9E3D-D50C0A756998@larryv.me> <20150302022754.GA7449@xvii.vinc17.org> <CABx2=D8efL3X2tfB+_+VweY2yye6EhaMNbJa3b3jJeVMp=7gaQ@mail.gmail.com> <20150302104619.GC6869@xvii.vinc17.org> <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> <CAH+w=7YoHjN85hqOZVywOfYGZqvU74vZrbE84Ln+V2HQi-6nSA@mail.gmail.com> <20150304144756.GA27231@ypig.lip.ens-lyon.fr> <20150304151830.5e20d732@pwslap01u.europe.root.pri>
Peter Stephenson wrote on Wed, Mar 04, 2015 at 15:18:30 +0000:
> On Wed, 4 Mar 2015 15:47:56 +0100
> Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > I've found a bug:
> >
> > % alias '&&=(){ return $? } && '
> > % && echo OK
> > zsh: parse error near `&&'
>
> (Moved to zsh-workers)
>
> I was keeping very quiet about this, but it looks like it's not as hairy
> as I thought it might be and the new code is actually slightly cleaner...
>
> Now waiting for obscure failures elsewhere...
>
> pws
>
The commit doesn't include the test part (even though the changelog
entry does mention it).
Daniel
> diff --git a/Test/A02alias.ztst b/Test/A02alias.ztst
> index 7121c50..36dfa24 100644
> --- a/Test/A02alias.ztst
> +++ b/Test/A02alias.ztst
> @@ -42,3 +42,18 @@
> cat <(echo foo | cat)
> 0:Alias expansion works at the end of parsed strings
> >foo
> +
> + alias '&&=(){ return $?; } && '
> + alias not_the_print_command=print
> + eval 'print This is output
> + && print And so is this
> + && { print And this too; false; }
> + && print But not this
> + && print Nor this
> + true
> + && not_the_print_command And aliases are expanded'
> +0:We can now alias special tokens. Woo hoo.
> +>This is output
> +>And so is this
> +>And this too
> +>And aliases are expanded
Messages sorted by:
Reverse Date,
Date,
Thread,
Author