[Python-checkins] python/dist/src/Python symtable.c, 2.10.8.17, 2.10.8.18

nnorwitz at projects.sourceforge.net nnorwitz at projects.sourceforge.net
Sat Jan 24 13:34:55 EST 2004


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13830/Python

Modified Files:
      Tag: ast-branch
	symtable.c 
Log Message:
Make several internal functions static, start supporting nested function params

Index: symtable.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v
retrieving revision 2.10.8.17
retrieving revision 2.10.8.18
diff -C2 -d -r2.10.8.17 -r2.10.8.18
*** symtable.c	26 Dec 2003 21:08:43 -0000	2.10.8.17
--- symtable.c	24 Jan 2004 18:33:38 -0000	2.10.8.18
***************
*** 336,340 ****
  */
  
! int 
  analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound,
  	     PyObject *local, PyObject *free, int nested)
--- 336,340 ----
  */
  
! static int 
  analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound,
  	     PyObject *local, PyObject *free, int nested)
***************
*** 408,412 ****
  
  /* Enter the final scope information into the st_symbols dict. */
! int
  update_symbols(PyObject *symbols, PyObject *scope)
  {
--- 408,412 ----
  
  /* Enter the final scope information into the st_symbols dict. */
! static int
  update_symbols(PyObject *symbols, PyObject *scope)
  {
***************
*** 431,435 ****
  }   
  
! int
  analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free)
  {
--- 431,435 ----
  }   
  
! static int
  analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free)
  {
***************
*** 487,491 ****
  }
  
! int
  symtable_analyze(struct symtable *st)
  {
--- 487,491 ----
  }
  
! static int
  symtable_analyze(struct symtable *st)
  {
***************
*** 529,534 ****
  	PySTEntryObject *prev = NULL;
  
! 	fprintf(stderr, "enter block %s %d\n",
! 		PyString_AS_STRING(name), lineno);
  
  	if (st->st_cur) {
--- 529,533 ----
  	PySTEntryObject *prev = NULL;
  
! 	// fprintf(stderr, "enter block %s %d\n", PyString_AS_STRING(name), lineno);
  
  	if (st->st_cur) {
***************
*** 859,868 ****
  		expr_ty arg = asdl_seq_GET(args, i);
  		if (arg->kind == Name_kind) {
! 			assert(arg->v.Name.ctx == Param);
  			if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM))
  				return 0;
  		}
  		else if (arg->kind == Tuple_kind) {
! 			assert(arg->v.Tuple.ctx == Load);
  			if (toplevel) {
  				if (!symtable_implicit_arg(st, i))
--- 858,868 ----
  		expr_ty arg = asdl_seq_GET(args, i);
  		if (arg->kind == Name_kind) {
! 			assert(arg->v.Name.ctx == Param ||
!                                arg->v.Name.ctx == Store);
  			if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM))
  				return 0;
  		}
  		else if (arg->kind == Tuple_kind) {
! 			assert(arg->v.Tuple.ctx == Store);
  			if (toplevel) {
  				if (!symtable_implicit_arg(st, i))




More information about the Python-checkins mailing list