column offset on node (offset_patch.diff)

patch modifies the rebuilder to add column offset to the node, iff it exists on the _ast node.

download
# HG changeset patch
# User fawce <fawcett@gmail.com>
# Date 1308241077 14400
# Node ID fb1f2c7ee87df62bb9b4b215ab68d619f42c9d22
# Parent  eca5337e3675329f7ee461fe0fea2576eb5ff070
added col_offset

diff -r eca5337e3675 -r fb1f2c7ee87d rebuilder.py
--- a/rebuilder.py	Tue Jan 18 09:50:25 2011 +0100
+++ b/rebuilder.py	Thu Jun 16 12:17:57 2011 -0400
@@ -117,11 +117,15 @@
     newnode.parent = parent
     if hasattr(oldnode, 'lineno'):
         newnode.lineno = oldnode.lineno
+    if hasattr(oldnode, 'col_offset'):
+        newnode.col_offset = oldnode.col_offset
 
 def _set_infos(oldnode, newnode, parent):
     newnode.parent = parent
     if hasattr(oldnode, 'lineno'):
         newnode.lineno = oldnode.lineno
+    if hasattr(oldnode, 'col_offset'):
+        newnode.col_offset = oldnode.col_offset
     newnode.set_line_info(newnode.last_child()) # set_line_info accepts None