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

Re: grammar triviality with '&&'



On Mar 1, 2015, at 12:01 PM, Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:

> I see, so it's not a 'hard' syntactic issue, the limitation is in the
> rules for look ahead, namely that if the parser feels it has
> a complete sentence then it never looks at the next line.

It's not just a parser implementation detail. Lists are *defined* to
terminate on newlines. From zshmisc(1):

    A list is a sequence of zero or more sublists, in which each sublist
    is terminated  by `;', `&', `&|', `&!', or a newline.

In your second example, `[ -e file1 ]` constitutes a list.

vq



Messages sorted by: Reverse Date, Date, Thread, Author