Copying an if (and other flows) is now working.

This commit is contained in:
Dave Halter
2016-09-11 21:51:44 +02:00
parent c764976ef2
commit dfdda4a2f1
2 changed files with 60 additions and 33 deletions

View File

@@ -38,6 +38,19 @@ def test_add_to_end():
assert jedi.Script(a + b, path='example.py').completions()
def _check_error_leafs(node):
try:
children = node.children
except AttributeError:
if node.type == 'error_leaf':
return True
else:
for child in children:
if _check_error_leafs(child):
return True
return False
class Differ(object):
def __init__(self):
self._first_use = True
@@ -56,6 +69,7 @@ class Differ(object):
assert diff_parser._parser_count == parsers
self.parser.module = new_module
self.parser._parsed = new_module
assert not _check_error_leafs(new_module)
return new_module