Remove 'move' from the parser tree.

This commit is contained in:
Dave Halter
2017-04-26 18:45:18 +02:00
parent dea09b096d
commit e8b32e358b
4 changed files with 18 additions and 12 deletions

View File

@@ -175,3 +175,17 @@ def get_doc_with_call_signature(scope_node):
if call_signature is None:
return doc
return '%s\n\n%s' % (call_signature, doc)
def move(node, line_offset):
"""
Move the `Node` start_pos.
"""
try:
children = node.children
except AttributeError:
node.line += line_offset
else:
for c in children:
move(c, line_offset)