zsh-users
 help / color / mirror / code / Atom feed
* grammar triviality with '&&'
@ 2015-03-01 16:07 Ray Andrews
  2015-03-01 16:43 ` ZyX
  0 siblings, 1 reply; 45+ messages in thread
From: Ray Andrews @ 2015-03-01 16:07 UTC (permalink / raw)
  To: zsh Users

I notice that zsh is quite tolerant as far as most
line wrap situations go, except for this:

     [ -e file1 ] &&
     [ -e file2 ] &&
     echo 'both files exist'

... good

     [ -e file1 ]
     && [ -e file2 ]
     && echo 'both files exist'

... syntax error, but we can fix it like this:

     [ -e file1 ]\
     && [ -e file2 ]\
     && echo 'both files exist'

I'm wondering why the line continuation is strictly necessary.
IOW, why doesn't the parser permit the '&&' on a new line?
I've been trying to come up with something that would
cause an ambiguity if it were permitted, but can't find anything,
but I doubt the rule would be there otherwise.


^ permalink raw reply	[flat|nested] 45+ messages in thread

end of thread, other threads:[~2015-03-09 11:36 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-01 16:07 grammar triviality with '&&' Ray Andrews
2015-03-01 16:43 ` ZyX
2015-03-01 17:01   ` Ray Andrews
2015-03-01 18:48     ` Bart Schaefer
2015-03-01 19:00       ` ZyX
2015-03-01 19:16       ` Ray Andrews
2015-03-01 20:48         ` ZyX
2015-03-01 18:49     ` Lawrence Velázquez
2015-03-02  2:27       ` Vincent Lefevre
2015-03-02  3:12         ` Ray Andrews
2015-03-02  5:22           ` Lawrence Velázquez
2015-03-02  3:53         ` Kurtis Rader
2015-03-02  4:18           ` Ray Andrews
2015-03-02  5:22             ` Kurtis Rader
2015-03-02 16:17               ` Ray Andrews
2015-03-02 18:52                 ` Kurtis Rader
2015-03-02 19:03                   ` ZyX
2015-03-02 20:16                     ` Kurtis Rader
2015-03-03  4:15                       ` ZyX
2015-03-03  4:43                         ` Kurtis Rader
2015-03-04 15:03                           ` Vincent Lefevre
2015-03-04 19:07                           ` ZyX
2015-03-02 19:25                   ` Ray Andrews
2015-03-02 10:46           ` Vincent Lefevre
2015-03-02 11:06             ` Peter Stephenson
2015-03-02 19:19               ` Bart Schaefer
2015-03-04 14:47                 ` Vincent Lefevre
2015-03-05  1:51                   ` Bart Schaefer
2015-03-05 10:06                     ` Peter Stephenson
2015-03-02  8:54         ` Bart Schaefer
2015-03-02 10:31           ` Vincent Lefevre
2015-03-02 16:31             ` Ray Andrews
2015-03-02 16:49             ` Bart Schaefer
2015-03-02 17:38               ` Ray Andrews
2015-03-02 18:51                 ` Bart Schaefer
2015-03-04  8:55               ` Vincent Lefevre
2015-03-04 17:12                 ` Ray Andrews
2015-03-06  4:59                   ` Bart Schaefer
2015-03-06 16:10                     ` Ray Andrews
2015-03-06 20:23                       ` Lawrence Velázquez
2015-03-06 21:25                         ` Ray Andrews
2015-03-06 16:32                     ` Vincent Lefevre
2015-03-06 17:43                       ` Bart Schaefer
2015-03-06 21:01                         ` Ray Andrews
2015-03-09 11:26                         ` Vincent Lefevre

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).