Enhanced ExecutionContext to keep track of the execution flow

This commit is contained in:
2020-01-07 15:47:43 +01:00
parent ffd98d7407
commit b4346b5af0
19 changed files with 966 additions and 190 deletions
+11 -12
View File
@@ -66,18 +66,21 @@ class ConceptComposerEvaluator(AllReturnValuesEvaluator):
if sheerka.isinstance(concept, BuiltinConcepts.UNKNOWN_CONCEPT):
has_error = True
else:
sub_context = context.push(self.name, desc=f"Evaluating '{concept}'")
sub_context.log_new(self.verbose_log)
concept = sheerka.evaluate_concept(sub_context, concept, self.verbose_log)
temp_res.append(concept)
with context.push(self.name, desc=f"Evaluating '{concept}'") as sub_context:
sub_context.log_new(self.verbose_log)
concept = sheerka.evaluate_concept(sub_context, concept, self.verbose_log)
sub_context.add_values(return_values=concept)
temp_res.append(concept)
else:
temp_res.append(core.utils.strip_quotes(token.value))
concepts_only &= token.type == TokenKind.WHITESPACE or token.type == TokenKind.NEWLINE
else:
sub_context = context.push(self.name, desc=f"Evaluating '{node.concept}'")
sub_context.log_new(self.verbose_log)
concept = sheerka.evaluate_concept(sub_context, node.concept, self.verbose_log)
temp_res.append(concept)
with context.push(self.name, desc=f"Evaluating '{node.concept}'") as sub_context:
sub_context.log_new(self.verbose_log)
concept = sheerka.evaluate_concept(sub_context, node.concept, self.verbose_log)
sub_context.add_values(return_values=concept)
temp_res.append(concept)
if has_error:
return sheerka.ret(
@@ -104,7 +107,3 @@ class ConceptComposerEvaluator(AllReturnValuesEvaluator):
True,
res,
parents=[self.eaten])