[Python-checkins] python/dist/src/Python ast.c,1.1.2.30,1.1.2.31

jhylton at users.sourceforge.net jhylton at users.sourceforge.net
Mon Aug 25 19:17:17 EDT 2003


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

Modified Files:
      Tag: ast-branch
	ast.c 
Log Message:
Add support for expressions like f(3)(2)


Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.30
retrieving revision 1.1.2.31
diff -C2 -d -r1.1.2.30 -r1.1.2.31
*** ast.c	22 Jul 2003 19:32:39 -0000	1.1.2.30
--- ast.c	26 Aug 2003 01:17:15 -0000	1.1.2.31
***************
*** 814,818 ****
  	    return e;
  	/* power: atom trailer* ('**' factor)*
!            trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME */
  	if (TYPE(CHILD(n, NCH(n) - 1)) == factor) {
  	    expr_ty f = ast_for_expr(CHILD(n, NCH(n) - 1));
--- 814,821 ----
  	    return e;
  	/* power: atom trailer* ('**' factor)*
!            trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME 
! 
! 	   XXX What about atom trailer trailer ** factor?
! 	*/
  	if (TYPE(CHILD(n, NCH(n) - 1)) == factor) {
  	    expr_ty f = ast_for_expr(CHILD(n, NCH(n) - 1));
***************
*** 820,830 ****
  	}
  	for (i = 1; i < NCH(n); i++) {
! 	    expr_ty new;
  	    node *ch = CHILD(n, i);
  	    if (TYPE(CHILD(ch, 0)) == LPAR) {
  		if (NCH(ch) == 2)
! 		    return Call(e, NULL, NULL, NULL, NULL);
  		else
! 		    return ast_for_call(CHILD(ch, 1), e);
  	    }
  	    else if (TYPE(CHILD(ch, 0)) == LSQB) {
--- 823,833 ----
  	}
  	for (i = 1; i < NCH(n); i++) {
! 	    expr_ty new = e;
  	    node *ch = CHILD(n, i);
  	    if (TYPE(CHILD(ch, 0)) == LPAR) {
  		if (NCH(ch) == 2)
! 		    new = Call(new, NULL, NULL, NULL, NULL);
  		else
! 		    new = ast_for_call(CHILD(ch, 1), new);
  	    }
  	    else if (TYPE(CHILD(ch, 0)) == LSQB) {





More information about the Python-checkins mailing list