forked from VimPlug/jedi
Remove print statements and reenable the if statement scanning that allows names to get resolved in 'if 0:' clauses. Makes all tests work again.
This commit is contained in:
@@ -206,12 +206,9 @@ class Evaluator(object):
|
|||||||
else:
|
else:
|
||||||
for name_dict in name_dicts:
|
for name_dict in name_dicts:
|
||||||
name_dict[str(if_name)] = definitions
|
name_dict[str(if_name)] = definitions
|
||||||
if len(name_dicts) > 1:
|
|
||||||
print('XXXX', len(name_dicts), if_name, definitions)
|
|
||||||
if len(name_dicts) > 1:
|
if len(name_dicts) > 1:
|
||||||
result = []
|
result = []
|
||||||
for name_dict in name_dicts:
|
for name_dict in name_dicts:
|
||||||
print('NAME_DICT', element, name_dict)
|
|
||||||
self.predefined_if_name_dict_dict[parent] = name_dict
|
self.predefined_if_name_dict_dict[parent] = name_dict
|
||||||
try:
|
try:
|
||||||
result += self._eval_element_not_cached(element)
|
result += self._eval_element_not_cached(element)
|
||||||
@@ -248,7 +245,6 @@ class Evaluator(object):
|
|||||||
return self.eval_statement(element)
|
return self.eval_statement(element)
|
||||||
elif element.type == 'power':
|
elif element.type == 'power':
|
||||||
types = self._eval_atom(element.children[0])
|
types = self._eval_atom(element.children[0])
|
||||||
print(element, element.start_pos)
|
|
||||||
for trailer in element.children[1:]:
|
for trailer in element.children[1:]:
|
||||||
if trailer == '**': # has a power operation.
|
if trailer == '**': # has a power operation.
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ class NameFinder(object):
|
|||||||
|
|
||||||
names = self.filter_name(scopes)
|
names = self.filter_name(scopes)
|
||||||
if self._found_predefined_if_name is not None:
|
if self._found_predefined_if_name is not None:
|
||||||
print('HAVE FOUND', self._found_predefined_if_name)
|
|
||||||
return self._found_predefined_if_name
|
return self._found_predefined_if_name
|
||||||
|
|
||||||
types = self._names_to_types(names, search_global)
|
types = self._names_to_types(names, search_global)
|
||||||
|
|||||||
@@ -41,12 +41,10 @@ def break_check(evaluator, base_scope, stmt, origin_scope=None):
|
|||||||
# e.g. `if 0:` would cause all name lookup within the flow make
|
# e.g. `if 0:` would cause all name lookup within the flow make
|
||||||
# unaccessible. This is not a "problem" in Python, because the code is
|
# unaccessible. This is not a "problem" in Python, because the code is
|
||||||
# never called. In Jedi though, we still want to infer types.
|
# never called. In Jedi though, we still want to infer types.
|
||||||
"""
|
|
||||||
while origin_scope is not None:
|
while origin_scope is not None:
|
||||||
if element_scope == origin_scope:
|
if element_scope == origin_scope:
|
||||||
return REACHABLE
|
return REACHABLE
|
||||||
origin_scope = origin_scope.parent
|
origin_scope = origin_scope.parent
|
||||||
"""
|
|
||||||
x = _break_check(evaluator, stmt, base_scope, element_scope)
|
x = _break_check(evaluator, stmt, base_scope, element_scope)
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user