Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: function parsing



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