Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: POSIX `for' syntax
- X-seq: zsh-workers 15023
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Zsh hackers list" <zsh-workers@xxxxxxxxxx>
- Subject: PATCH: POSIX `for' syntax
- Date: Thu, 21 Jun 2001 09:55:34 +0000
- In-reply-to: <001901c0fa22$91a2c6d0$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <001901c0fa22$91a2c6d0$21c9ca95@xxxxxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author