Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: function parsing
- X-seq: zsh-workers 17284
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- Subject: Re: PATCH: function parsing
- Date: Tue, 4 Jun 2002 09:33:15 -0700 (PDT)
- Cc: Zsh hackers list <zsh-workers@xxxxxxxxxxxxxx>
- In-reply-to: <20020604161825.A65341C0B5@xxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Sender: schaefer@xxxxxxxxxxxxxxxx
On Tue, 4 Jun 2002, Peter Stephenson wrote:
> % zsh -c 'function func { } this fails to cause a parse error'
> zsh: parse error near `this'
> % zsh -c 'func() { } this fails to cause a parse error'
> %
>
> I'm assuming the first is correct, since the second certainly isn't as
> the text is simply ignored.
While you're at it, any chance you can "fix" redirections following a
function definition? E.g. per ksh (and possibly per posix) this:
func() { less } < /etc/termcap
should be equivalent to this:
func() { { less } < /etc/termcap }
rather than the current zsh equivalent:
{ func() { less } } < /etc/termcap
Note that:
func() less < /etc/termcap
is already equivalent to:
func() { less < /etc/termcap }
so the first case above must be only a small matter of parsing.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author