Concept validation must be requested

This commit is contained in:
2020-03-09 12:23:53 +01:00
parent ef31a4807d
commit 1bde97b5e3
27 changed files with 346 additions and 280 deletions
+11 -13
View File
@@ -15,19 +15,17 @@ class ConceptEvaluator(OneReturnValueEvaluator):
def __init__(self, return_body=False):
super().__init__(self.NAME, [BuiltinConcepts.EVALUATION], 50)
self.return_body = return_body
self.evaluate_body = False
self.is_initialized = False
def init_evaluator(self, context, return_values):
if BuiltinConcepts.CONCEPT_EVAL_REQUESTED in context.extra_info:
self.evaluate_body = True
for r in return_values:
if r.status and context.sheerka.isinstance(r.body, BuiltinConcepts.CONCEPT_VALUE_REQUESTED):
self.evaluate_body = True
break
self.is_initialized = True
# def init_evaluator(self, context, return_values):
# if BuiltinConcepts.EVAL_BODY_REQUESTED in context.local_hints:
# self.evaluate_body = True
#
# for r in return_values:
# if r.status and context.sheerka.isinstance(r.body, BuiltinConcepts.CONCEPT_VALUE_REQUESTED):
# self.evaluate_body = True
# break
#
# self.is_initialized = True
def matches(self, context, return_value):
return return_value.status and \
@@ -49,7 +47,7 @@ class ConceptEvaluator(OneReturnValueEvaluator):
return sheerka.ret(self.name, True, value, parents=[return_value])
evaluated = sheerka.evaluate_concept(context, concept, self.evaluate_body)
evaluated = sheerka.evaluate_concept(context, concept)
if evaluated.key != concept.key:
# evaluated.key != concept.key means that we have transformed the concept