[Python-checkins] python/dist/src/Python ast.c,1.1.2.10,1.1.2.11

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Wed, 02 Oct 2002 04:49:17 -0700


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

Modified Files:
      Tag: ast-branch
	ast.c 
Log Message:
Experimental change: Add Param to expr_context.

It's convenient to represent a function's parameter list as a sequence
of expressions, because they can contain names or tuples.  Rather than
re-using an existing expr_context for the names, make one explicitly
for this purpose.

There are some downsides: Must cover Param in all switch statements.
Param isn't used directly by the AST.


Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** ast.c	1 Oct 2002 19:34:38 -0000	1.1.2.10
--- ast.c	2 Oct 2002 11:49:15 -0000	1.1.2.11
***************
*** 390,394 ****
  	    }
  	    if (TYPE(CHILD(ch, 0)) == NAME)
! 		asdl_seq_APPEND(args, NEW_IDENTIFIER(CHILD(ch, 0)));
  	    if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
  		asdl_seq_APPEND(defaults, ast_for_expr(CHILD(n, i + 2)));
--- 390,395 ----
  	    }
  	    if (TYPE(CHILD(ch, 0)) == NAME)
! 		asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)),
! 					   Param));
  	    if (i + 1 < NCH(n) && TYPE(CHILD(n, i + 1)) == EQUAL) {
  		asdl_seq_APPEND(defaults, ast_for_expr(CHILD(n, i + 2)));