From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27202 invoked from network); 25 Aug 2000 14:39:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Aug 2000 14:39:08 -0000 Received: (qmail 15975 invoked by alias); 25 Aug 2000 14:38:32 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12698 Received: (qmail 15966 invoked from network); 25 Aug 2000 14:38:32 -0000 Date: Fri, 25 Aug 2000 15:38:30 +0100 From: Adam Spiers To: Zsh hackers list Subject: Re: comments break \ at end of line Message-ID: <20000825153830.C22595@thelonious.new.ox.ac.uk> Reply-To: Adam Spiers Mail-Followup-To: Zsh hackers list References: <20000824222932.A15971@thelonious.new.ox.ac.uk> <0FZU00LN0FYLHV@la-la.cambridgesiliconradio.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <0FZU00LN0FYLHV@la-la.cambridgesiliconradio.com>; from pws@csr.com on Fri, Aug 25, 2000 at 11:32:46AM +0100 X-Home-Page: http://www.new.ox.ac.uk/~adam/ X-OS: RedHat Linux Peter Stephenson (pws@csr.com) wrote: > Adam wrote: > > % foo () { > > > echo hello, \ > > > # this is a comment > > > world > > > } > > % foo > > hello, > > foo:3: command not found: world > > > > which is the same issue as > > > > % echo hello, \ > > > # comment > > hello, > > > > This may be intentional, but if so, it strikes me as a rather > > undesirable feature, or at least one which you should be able to turn > > off. > > I don't really see how it could be any different. The `\' just skips the > newline, turning the line into `echo hello, # this is a comment'. `\' > never forces it into any different state of parsing, it only escapes the > next character. What are you suggesting? I'm suggesting that, in the case of the function, it turns it into `echo hello, world', and in second case, it expects another line of input, just as if you hadn't entered the comment line. After all, comment lines are supposed to be ignored, aren't they? This seems far more sensible behaviour to me: a) it's useful to be able to intersperse comments with continuation lines, and b) if you didn't want the continuation happening, you wouldn't have included the backslashes in the first place. > I don't see how you can turn it > off without writing a completely new (= bugridden) way of lexing. As is probably already obvious, I'm fairly ignorant of zsh's lexing and parsing. At what stage do comments get dropped? I would have thought that if they were dropped earlier on that this would achieve what I want, but I'm just guessing.