[Python-checkins] CVS: python/dist/src/Parser parser.c,2.19,2.20
Guido van Rossum
gvanrossum@users.sourceforge.net
Thu, 19 Jul 2001 08:27:47 -0700
Update of /cvsroot/python/python/dist/src/Parser
In directory usw-pr-cvs1:/tmp/cvs-serv25441
Modified Files:
parser.c
Log Message:
Fis SF bug #442647: not all forms of legal future statements were
parsed correctly. Now they are.
Index: parser.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/parser.c,v
retrieving revision 2.19
retrieving revision 2.20
diff -C2 -r2.19 -r2.20
*** parser.c 2001/07/15 21:08:29 2.19
--- parser.c 2001/07/19 15:27:45 2.20
***************
*** 176,179 ****
--- 176,180 ----
node *n = ps->p_stack.s_top->s_parent;
node *ch;
+ int i;
if (strcmp(STR(CHILD(n, 0)), "from") != 0)
***************
*** 182,188 ****
if (strcmp(STR(CHILD(ch, 0)), "__future__") != 0)
return;
! ch = CHILD(n, 3);
! if (NCH(ch) == 1 && strcmp(STR(CHILD(ch, 0)), "generators") == 0)
! ps->p_generators = 1;
}
--- 183,194 ----
if (strcmp(STR(CHILD(ch, 0)), "__future__") != 0)
return;
! for (i = 3; i < NCH(n); i += 2) {
! ch = CHILD(n, i);
! if (NCH(ch) >= 1 && TYPE(CHILD(ch, 0)) == NAME &&
! strcmp(STR(CHILD(ch, 0)), "generators") == 0) {
! ps->p_generators = 1;
! break;
! }
! }
}