From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9141 invoked by alias); 4 Mar 2015 21:13:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 34645 Received: (qmail 12336 invoked from network); 4 Mar 2015 21:13:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 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= X-Sasl-enc: pqvDnzg91nGTjxfBVHLxKTC6QwtJ0VXpPri4DkUsR6jY 1425503607 Date: Wed, 4 Mar 2015 21:13:25 +0000 From: Daniel Shahaf To: Peter Stephenson Cc: Zsh Hackers' List Subject: Re: grammar triviality with '&&' Message-ID: <20150304211325.GB2036@tarsus.local2> References: <13666281425228233@web7o.yandex.ru> <54F345D3.9010204@eastlink.ca> <20150302022754.GA7449@xvii.vinc17.org> <20150302104619.GC6869@xvii.vinc17.org> <20150302110610.2e2c7e86@pwslap01u.europe.root.pri> <20150304144756.GA27231@ypig.lip.ens-lyon.fr> <20150304151830.5e20d732@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150304151830.5e20d732@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) Peter Stephenson wrote on Wed, Mar 04, 2015 at 15:18:30 +0000: > On Wed, 4 Mar 2015 15:47:56 +0100 > Vincent Lefevre 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