forked from VimPlug/jedi
Remove dedents from the parser tree. No need for them.
This commit is contained in:
@@ -181,9 +181,9 @@ def _get_faked(module, obj, name=None):
|
||||
doc = '"""%s"""' % obj.__doc__ # TODO need escapes.
|
||||
suite = result.children[-1]
|
||||
string = pt.String(pt.zero_position_modifier, doc, (0, 0), '')
|
||||
new_line = pt.Newline('\n', (0, 0), '')
|
||||
new_line = pt.Newline(pt.zero_position_modifier, '\n', (0, 0))
|
||||
docstr_node = pt.Node('simple_stmt', [string, new_line])
|
||||
suite.children.insert(2, docstr_node)
|
||||
suite.children.insert(1, docstr_node)
|
||||
return result
|
||||
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ def _evaluate_for_statement_string(evaluator, string, module):
|
||||
pseudo_cls = p.module.subscopes[0]
|
||||
# First pick suite, then simple_stmt (-2 for DEDENT) and then the node,
|
||||
# which is also not the last item, because there's a newline.
|
||||
stmt = pseudo_cls.children[-1].children[-2].children[-2]
|
||||
stmt = pseudo_cls.children[-1].children[-1].children[-2]
|
||||
except (AttributeError, IndexError):
|
||||
return []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user