[Python-checkins] CVS: python/dist/src/Parser parser.c,2.21,2.22

Neil Schemenauer nascheme@users.sourceforge.net
Fri, 22 Mar 2002 15:38:13 -0800


Update of /cvsroot/python/python/dist/src/Parser
In directory usw-pr-cvs1:/tmp/cvs-serv22176/Parser

Modified Files:
	parser.c 
Log Message:
Disable the parser hacks that allowed the "yield" keyword to be enabled
by a future statement.


Index: parser.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/parser.c,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -d -r2.21 -r2.22
*** parser.c	4 Dec 2001 03:18:48 -0000	2.21
--- parser.c	22 Mar 2002 23:38:11 -0000	2.22
***************
*** 80,84 ****
--- 80,86 ----
  		return NULL;
  	ps->p_grammar = g;
+ #if 0 /* future keyword */
  	ps->p_generators = 0;
+ #endif
  	ps->p_tree = PyNode_New(start);
  	if (ps->p_tree == NULL) {
***************
*** 146,153 ****
--- 148,157 ----
  					l->lb_str[0] == s[0] &&
  					strcmp(l->lb_str, s) == 0) {
+ #if 0 /* future keyword */
  				if (!ps->p_generators &&
  				    s[0] == 'y' &&
  				    strcmp(s, "yield") == 0)
  					break; /* not a keyword */
+ #endif
  				D(printf("It's a keyword\n"));
  				return n - i;
***************
*** 171,174 ****
--- 175,179 ----
  }
  
+ #if 0 /* future keyword */
  static void
  future_hack(parser_state *ps)
***************
*** 192,195 ****
--- 197,201 ----
  	}
  }
+ #endif /* future keyword */
  
  int
***************
*** 250,257 ****
--- 256,265 ----
  						 d->d_name,
  						 ps->p_stack.s_top->s_state));
+ #if 0 /* future keyword */
  					if (d->d_name[0] == 'i' &&
  					    strcmp(d->d_name,
  						   "import_stmt") == 0)
  						future_hack(ps);
+ #endif
  					s_pop(&ps->p_stack);
  					if (s_empty(&ps->p_stack)) {
***************
*** 266,272 ****
--- 274,282 ----
  		
  		if (s->s_accept) {
+ #if 0 /* future keyword */
  			if (d->d_name[0] == 'i' &&
  			    strcmp(d->d_name, "import_stmt") == 0)
  				future_hack(ps);
+ #endif
  			/* Pop this dfa and try again */
  			s_pop(&ps->p_stack);