Memoizing statements doesn't work anymore.

Statements now need to be evaluated at least if predefined_names_dict is set.
This commit is contained in:
Dave Halter
2015-06-29 13:32:39 +02:00
parent 6e44f334d8
commit d694ab83a3
2 changed files with 6 additions and 2 deletions

View File

@@ -120,7 +120,7 @@ class Evaluator(object):
return f.filter_name(scopes)
return f.find(scopes, search_global)
@memoize_default(default=[], evaluator_is_first_arg=True)
#@memoize_default(default=[], evaluator_is_first_arg=True)
@recursion.recursion_decorator
@debug.increase_indent
def eval_statement(self, stmt, seek_name=None):
@@ -211,6 +211,7 @@ class Evaluator(object):
if len(name_dicts) > 1:
result = []
for name_dict in name_dicts:
print('NAME_DICT', element, name_dict)
self.predefined_if_name_dict_dict[parent] = name_dict
try:
result += self._eval_element_not_cached(element)

View File

@@ -21,5 +21,8 @@ else:
#! 6 type-error-operation
z = x + y
# However, here we have correct types.
if type(x) == type(y):
if x == y:
z = x + y
else:
#! 6 type-error-operation
z = x + y