From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28860 invoked from network); 21 Jun 2001 09:56:59 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jun 2001 09:56:59 -0000 Received: (qmail 8565 invoked by alias); 21 Jun 2001 09:56:19 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15023 Received: (qmail 8545 invoked from network); 21 Jun 2001 09:56:16 -0000 From: "Bart Schaefer" Message-Id: <1010621095534.ZM4478@candle.brasslantern.com> Date: Thu, 21 Jun 2001 09:55:34 +0000 In-Reply-To: <001901c0fa22$91a2c6d0$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: PATCH: 4.1: multi-parameter for loop" (Jun 21, 11:19am) References: <001901c0fa22$91a2c6d0$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Zsh hackers list" Subject: PATCH: POSIX `for' syntax MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 21, 11:19am, Andrej Borsenkow wrote: } } for_clause : For name linebreak do_group } | For name linebreak in wordlist sequential_sep do_group } name : NAME /* Apply rule 5 */ } ; } in : In /* Apply rule 6 */ } } It means, that the following is valid: } } fot i } in a b c } do } ... } } it is currently does not work in zsh: } } bor@itsrm2% for i } for> in a b c } bor@itsrm2% } ^^^^^^^^^^^^^^^ Oops! The following patch (which almost certainly conflicts with Peter's) makes zsh accept any number of newlines preceding the "in" token. This also applies to `select', which I presumed it ought to. --- zsh-forge/current/Src/parse.c Mon Jun 18 01:05:17 2001 +++ zsh-4.0/Src/parse.c Thu Jun 21 02:45:23 2001 @@ -909,6 +909,8 @@ ecstr(tokstr); incmdpos = 1; yylex(); + while (isnewlin && !csh) + yylex(); if (tok == STRING && !strcmp(tokstr, "in")) { int np, n; -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net