[Python-checkins] python/dist/src/Python ast.c,1.1.2.33,1.1.2.34

bcannon at users.sourceforge.net bcannon at users.sourceforge.net
Wed Oct 15 02:19:33 EDT 2003


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

Modified Files:
      Tag: ast-branch
	ast.c 
Log Message:
Fix bug where 'else' clause was not being detected when there was an 'elif'
in the 'if' statement.


Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.33
retrieving revision 1.1.2.34
diff -C2 -d -r1.1.2.33 -r1.1.2.34
*** ast.c	21 Sep 2003 00:17:48 -0000	1.1.2.33
--- ast.c	15 Oct 2003 06:19:31 -0000	1.1.2.34
***************
*** 1780,1785 ****
  	asdl_seq *orelse = NULL;
  	n_elif = NCH(n) - 4;
! 	if (TYPE(CHILD(n, n_elif)) == NAME
! 	    && STR(CHILD(n, n_elif))[2] == 's') {
  	    has_else = 1;
  	    n_elif -= 3;
--- 1780,1787 ----
  	asdl_seq *orelse = NULL;
  	n_elif = NCH(n) - 4;
!         /* must reference the child n_elif+1 since 'else' token is third,
!            not fourth, child from the end. */
! 	if (TYPE(CHILD(n, (n_elif + 1))) == NAME
! 	    && STR(CHILD(n, (n_elif + 1)))[2] == 's') {
  	    has_else = 1;
  	    n_elif -= 3;





More information about the Python-checkins mailing list