mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Another fix for DEDENT/INDENT handling.
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user