[Python-checkins] python/dist/src/Modules pyexpat.c,2.87,2.88

davecole at users.sourceforge.net davecole at users.sourceforge.net
Thu Aug 26 02:37:34 CEST 2004


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

Modified Files:
	pyexpat.c 
Log Message:
Patch #1014930.  Expose current parse location to XMLParser.


Index: pyexpat.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v
retrieving revision 2.87
retrieving revision 2.88
diff -u -d -r2.87 -r2.88
--- pyexpat.c	13 Aug 2004 03:12:57 -0000	2.87
+++ pyexpat.c	26 Aug 2004 00:37:31 -0000	2.88
@@ -1455,6 +1455,17 @@
             return PyInt_FromLong((long)
                                   XML_GetErrorByteIndex(self->itself));
     }
+    if (name[0] == 'C') {
+        if (strcmp(name, "CurrentLineNumber") == 0)
+            return PyInt_FromLong((long)
+                                  XML_GetCurrentLineNumber(self->itself));
+        if (strcmp(name, "CurrentColumnNumber") == 0)
+            return PyInt_FromLong((long)
+                                  XML_GetCurrentColumnNumber(self->itself));
+        if (strcmp(name, "CurrentByteIndex") == 0)
+            return PyInt_FromLong((long)
+                                  XML_GetCurrentByteIndex(self->itself));
+    }
     if (name[0] == 'b') {
         if (strcmp(name, "buffer_size") == 0)
             return PyInt_FromLong((long) self->buffer_size);
@@ -1503,6 +1514,9 @@
         APPEND(rc, "ErrorLineNumber");
         APPEND(rc, "ErrorColumnNumber");
         APPEND(rc, "ErrorByteIndex");
+        APPEND(rc, "CurrentLineNumber");
+        APPEND(rc, "CurrentColumnNumber");
+        APPEND(rc, "CurrentByteIndex");
         APPEND(rc, "buffer_size");
         APPEND(rc, "buffer_text");
         APPEND(rc, "buffer_used");



More information about the Python-checkins mailing list