Added RET keyword

This commit is contained in:
2020-07-07 11:34:40 +02:00
parent 56e1cb4587
commit c4399d631c
21 changed files with 245 additions and 87 deletions
+4 -2
View File
@@ -81,6 +81,7 @@ class PythonEvaluator(OneReturnValueEvaluator):
concepts_entries = None
evaluated = BuiltinConcepts.NOT_INITIALIZED
errors = []
expect_success = BuiltinConcepts.EVAL_SUCCESS_REQUESTED in context.local_hints
for globals_ in all_possible_globals:
try:
# eval
@@ -92,7 +93,8 @@ class PythonEvaluator(OneReturnValueEvaluator):
context.log("Evaluating using 'exec'.", self.name)
evaluated = self.exec_with_return(node.ast_, globals_, sheerka.locals)
break # in this first version, we stop once a success is found
if not expect_success or evaluated:
break # in this first version, we stop once a success is found
except Exception as ex:
if concepts_entries is None:
concepts_entries = self.get_concepts_entries_from_globals(my_globals)
@@ -246,7 +248,7 @@ class PythonEvaluator(OneReturnValueEvaluator):
# make the product the rest as cartesian product
res = [fixed_values]
for k, v in concepts_with_body.items():
res = core.utils.dict_product(res, [{k: context.sheerka.objvalue(v)}, {k: v}])
res = core.utils.dict_product(res, [{k: v}, {k: context.sheerka.objvalue(v)}])
return res