[Python-checkins] python/dist/src/Python ast.c,1.1.2.17,1.1.2.18

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Tue, 25 Mar 2003 11:35:30 -0800


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

Modified Files:
      Tag: ast-branch
	ast.c 
Log Message:
parsestrplus():  Added a comment; reindented to match the rest of the file.


Index: ast.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -d -r1.1.2.17 -r1.1.2.18
*** ast.c	25 Mar 2003 19:27:11 -0000	1.1.2.17
--- ast.c	25 Mar 2003 19:35:25 -0000	1.1.2.18
***************
*** 1641,1644 ****
--- 1641,1648 ----
  }
  
+ /* Build a Python string object out of a STRING atom.  This takes care of
+  * compile-time literal catenation, calling parsestr() on each piece, and
+  * pasting the intermediate results together.
+  */
  static PyObject *
  parsestrplus(node *n)
***************
*** 1650,1672 ****
  		/* String literal concatenation */
  		for (i = 1; i < NCH(n); i++) {
! 		    PyObject *s;
! 		    s = parsestr(STR(CHILD(n, i)));
! 		    if (s == NULL)
! 			goto onError;
! 		    if (PyString_Check(v) && PyString_Check(s)) {
! 			PyString_ConcatAndDel(&v, s);
! 			if (v == NULL)
! 			    goto onError;
! 		    }
  #ifdef Py_USING_UNICODE
! 		    else {
! 			PyObject *temp;
! 			temp = PyUnicode_Concat(v, s);
! 			Py_DECREF(s);
! 			if (temp == NULL)
! 			    goto onError;
! 			Py_DECREF(v);
! 			v = temp;
! 		    }
  #endif
  		}
--- 1654,1676 ----
  		/* String literal concatenation */
  		for (i = 1; i < NCH(n); i++) {
! 			PyObject *s;
! 			s = parsestr(STR(CHILD(n, i)));
! 			if (s == NULL)
! 				goto onError;
! 			if (PyString_Check(v) && PyString_Check(s)) {
! 				PyString_ConcatAndDel(&v, s);
! 				if (v == NULL)
! 				    goto onError;
! 			}
  #ifdef Py_USING_UNICODE
! 			else {
! 				PyObject *temp;
! 				temp = PyUnicode_Concat(v, s);
! 				Py_DECREF(s);
! 				if (temp == NULL)
! 					goto onError;
! 				Py_DECREF(v);
! 				v = temp;
! 			}
  #endif
  		}