Added RET keyword
This commit is contained in:
@@ -314,11 +314,12 @@ def get_lexer_nodes(return_values, start, tokens):
|
||||
return lexer_nodes
|
||||
|
||||
|
||||
def ensure_evaluated(context, concept):
|
||||
def ensure_evaluated(context, concept, eval_body=True):
|
||||
"""
|
||||
Evaluate a concept is not already evaluated
|
||||
:param context:
|
||||
:param concept:
|
||||
:param eval_body:
|
||||
:return:
|
||||
"""
|
||||
if concept.metadata.is_evaluated:
|
||||
@@ -326,11 +327,15 @@ def ensure_evaluated(context, concept):
|
||||
|
||||
# do not try to evaluate concept that are not fully initialized
|
||||
for var in concept.metadata.variables:
|
||||
if var[0] not in concept.values or concept.get_value(var[0]) == NotInit:
|
||||
# to code
|
||||
if var[1] is None and \
|
||||
var[0] not in concept.compiled and \
|
||||
(var[0] not in concept.values or concept.get_value(var[0]) == NotInit):
|
||||
return concept
|
||||
|
||||
with context.push(BuiltinConcepts.EVALUATE_CONCEPT, concept, desc=f"Evaluating concept {concept}") as sub_context:
|
||||
sub_context.local_hints.add(BuiltinConcepts.EVAL_BODY_REQUESTED)
|
||||
if eval_body:
|
||||
sub_context.local_hints.add(BuiltinConcepts.EVAL_BODY_REQUESTED)
|
||||
evaluated = context.sheerka.evaluate_concept(sub_context, concept)
|
||||
sub_context.add_values(return_values=evaluated)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user