Another fix for DEDENT/INDENT handling.

This commit is contained in:
Georg Brandl
2008-12-29 22:30:00 +01:00
parent 21caf917f2
commit 428ed4a277
3 changed files with 5 additions and 3 deletions

View File

@@ -37,8 +37,9 @@ except ImportError:
except ImportError:
json = None
#: the filename for the inventory of objects
INVENTORY_FILENAME = 'objects.inv'
#: the filename for the "last build" file (for serializing builders)
LAST_BUILD_FILENAME = 'last_build'

View File

@@ -77,6 +77,7 @@ class ClassAttrVisitor(pytree.NodeVisitor):
pnode = pnode.get_prev_leaf()
if not pnode or pnode.type not in (token.INDENT, token.DEDENT):
break
prefix = pnode.get_prefix()
docstring = prepare_commentdoc(prefix)
if not docstring:
return

View File

@@ -221,8 +221,8 @@ class Leaf(Base):
self.prefix = prefix
def __repr__(self):
return "%s(%r, %r)" % (self.__class__.__name__,
self.type, self.value)
return "%s(%r, %r, %r)" % (self.__class__.__name__,
self.type, self.value, self.prefix)
def __str__(self):
"""This reproduces the input source exactly."""