From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15886 invoked from network); 5 Jul 2001 18:29:52 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 5 Jul 2001 18:29:52 -0000 Received: (qmail 7872 invoked by alias); 5 Jul 2001 18:28:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15265 Received: (qmail 7827 invoked from network); 5 Jul 2001 18:28:41 -0000 Message-ID: To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Minor annoyance with new `for' syntax In-reply-to: ""Bart Schaefer""'s message of "Sun, 01 Jul 2001 05:34:02 -0000." <1010701053403.ZM634@candle.brasslantern.com> Date: Thu, 05 Jul 2001 18:26:42 +0100 From: Peter Stephenson "Bart Schaefer" wrote: > zsh$ for key val in ${(kv)options} > zsh: correct 'val' to 'cal' [nyae]? > for> I hope this fixes that. Index: Src/parse.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/parse.c,v retrieving revision 1.26 diff -u -r1.26 parse.c --- Src/parse.c 2001/06/25 16:07:53 1.26 +++ Src/parse.c 2001/07/05 17:26:12 @@ -878,7 +878,7 @@ par_for(int *complex) { int oecused = ecused, csh = (tok == FOREACH), p, sel = (tok == SELECT); - int type, ona = noaliases; + int type; p = ecadd(0); @@ -903,27 +903,29 @@ yylex(); type = WC_FOR_COND; } else { - int np, n, posix_in; + int np, n, posix_in, ona = noaliases, onc = nocorrect; infor = 0; if (tok != STRING || !isident(tokstr)) YYERRORV(oecused); np = ecadd(0); n = 0; incmdpos = 1; - noaliases = 1; + noaliases = nocorrect = 1; for (;;) { n++; ecstr(tokstr); yylex(); if (tok != STRING || !strcmp(tokstr, "in") || sel) break; - if (!isident(tokstr)) + if (!isident(tokstr) || errflag) { noaliases = ona; + nocorrect = onc; YYERRORV(oecused); } } noaliases = ona; + nocorrect = onc; ecbuf[np] = n; posix_in = isnewlin; while (isnewlin) -- Peter Stephenson Software Engineer CSR Ltd., Unit 300, Science Park, Milton Road, Cambridge, CB4 0XL, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************