[Python-checkins] CVS: python/dist/src/Python compile.c,2.131,2.132 graminit.c,2.26,2.27

Skip Montanaro python-dev@python.org
Mon, 21 Aug 2000 19:43:10 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4225/Python

Modified Files:
	compile.c graminit.c 
Log Message:
require list comprehensions to start with a for clause


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.131
retrieving revision 2.132
diff -C2 -r2.131 -r2.132
*** compile.c	2000/08/21 17:07:20	2.131
--- compile.c	2000/08/22 02:43:07	2.132
***************
*** 1044,1048 ****
  com_list_comprehension(struct compiling *c, node *n)
  {
! 	/* listmaker: test list_iter */
  	char tmpname[12];
  	sprintf(tmpname, "__%d__", ++c->c_tmpname);
--- 1044,1048 ----
  com_list_comprehension(struct compiling *c, node *n)
  {
! 	/* listmaker: test list_for */
  	char tmpname[12];
  	sprintf(tmpname, "__%d__", ++c->c_tmpname);
***************
*** 1053,1057 ****
  	com_addopnamestr(c, STORE_NAME, tmpname);
  	com_pop(c, 1);
! 	com_list_iter(c, n, CHILD(n, 0), tmpname);
  	com_addopnamestr(c, DELETE_NAME, tmpname);
  	--c->c_tmpname;
--- 1053,1057 ----
  	com_addopnamestr(c, STORE_NAME, tmpname);
  	com_pop(c, 1);
! 	com_list_for(c, CHILD(n, 1), CHILD(n, 0), tmpname);
  	com_addopnamestr(c, DELETE_NAME, tmpname);
  	--c->c_tmpname;
***************
*** 1061,1066 ****
  com_listmaker(struct compiling *c, node *n)
  {
! 	/* listmaker: test ( list_iter | (',' test)* [','] ) */
! 	if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_iter)
  		com_list_comprehension(c, n);
  	else {
--- 1061,1066 ----
  com_listmaker(struct compiling *c, node *n)
  {
! 	/* listmaker: test ( list_for | (',' test)* [','] ) */
! 	if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_for)
  		com_list_comprehension(c, n);
  	else {

Index: graminit.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/graminit.c,v
retrieving revision 2.26
retrieving revision 2.27
diff -C2 -r2.26 -r2.27
*** graminit.c	2000/08/21 15:44:01	2.26
--- graminit.c	2000/08/22 02:43:07	2.27
***************
*** 1318,1322 ****
  };
  static arc arcs_60_0[2] = {
! 	{128, 1},
  	{129, 1},
  };
--- 1318,1322 ----
  };
  static arc arcs_60_0[2] = {
! 	{120, 1},
  	{129, 1},
  };
***************
*** 1341,1345 ****
  };
  static arc arcs_61_4[2] = {
! 	{120, 5},
  	{0, 4},
  };
--- 1341,1345 ----
  };
  static arc arcs_61_4[2] = {
! 	{128, 5},
  	{0, 4},
  };
***************
*** 1362,1366 ****
  };
  static arc arcs_62_2[2] = {
! 	{120, 3},
  	{0, 2},
  };
--- 1362,1366 ----
  };
  static arc arcs_62_2[2] = {
! 	{128, 3},
  	{0, 2},
  };
***************
*** 1623,1627 ****
  	{2, 0},
  	{3, 0},
! 	{316, 0},
  	{1, "lambda"},
  	{314, 0},
--- 1623,1627 ----
  	{2, 0},
  	{3, 0},
! 	{317, 0},
  	{1, "lambda"},
  	{314, 0},
***************
*** 1631,1635 ****
  	{1, "class"},
  	{315, 0},
! 	{317, 0},
  	{318, 0},
  };
--- 1631,1635 ----
  	{1, "class"},
  	{315, 0},
! 	{316, 0},
  	{318, 0},
  };