[Python-checkins] CVS: python/dist/src/Parser parsetok.c,2.25.8.1,2.25.8.2
Tim Peters
tim_one@users.sourceforge.net
Tue, 17 Jul 2001 21:13:58 -0700
Update of /cvsroot/python/python/dist/src/Parser
In directory usw-pr-cvs1:/tmp/cvs-serv20213/descr/dist/src/Parser
Modified Files:
Tag: descr-branch
parsetok.c
Log Message:
2.2a1 release: merge of trunk date2001-07-17a -> trunk date2001-07-17b.
Index: parsetok.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/parsetok.c,v
retrieving revision 2.25.8.1
retrieving revision 2.25.8.2
diff -C2 -r2.25.8.1 -r2.25.8.2
*** parsetok.c 2001/07/16 21:41:07 2.25.8.1
--- parsetok.c 2001/07/18 04:13:56 2.25.8.2
***************
*** 93,96 ****
--- 93,99 ----
Return error code. */
+ static char yield_msg[] =
+ "%s:%d: Warning: 'yield' will become a reserved keyword in the future\n";
+
static node *
parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
***************
*** 136,139 ****
--- 139,151 ----
strncpy(str, a, len);
str[len] = '\0';
+
+ /* Warn about yield as NAME */
+ if (type == NAME && !ps->p_generators &&
+ len == 5 && str[0] == 'y' && strcmp(str, "yield") == 0)
+ PySys_WriteStderr(yield_msg,
+ err_ret->filename==NULL ?
+ "<string>" : err_ret->filename,
+ tok->lineno);
+
if ((err_ret->error =
PyParser_AddToken(ps, (int)type, str, tok->lineno,