Fixed minor bugs

This commit is contained in:
2019-12-24 17:14:28 +01:00
parent 44e4b75cf8
commit bcb2308ea5
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -495,7 +495,7 @@ class Sheerka(Concept):
:return:
"""
# steps = [BuiltinConcepts.BEFORE_PARSING, BuiltinConcepts.PARSING, BuiltinConcepts.AFTER_PARSING]
steps = [BuiltinConcepts.PARSING]
steps = [BuiltinConcepts.BEFORE_PARSING, BuiltinConcepts.PARSING, BuiltinConcepts.AFTER_PARSING]
for part_key in ConceptParts:
source = getattr(concept.metadata, part_key.value)
if source is None or not isinstance(source, str) or source == "":
+1 -1
View File
@@ -87,7 +87,7 @@ class PythonEvaluator(OneReturnValueEvaluator):
evaluated = context.sheerka.evaluate_concept(sub_context, concept, self.verbose_log)
if evaluated.key == concept.key:
my_locals[name] = evaluated.body or evaluated # if ConceptParts.BODY not in evaluated.cached_asts else evaluated
my_locals[name] = evaluated.body if ConceptParts.BODY in evaluated.cached_asts else evaluated
return my_locals
+1 -1
View File
@@ -89,7 +89,7 @@ def test_i_can_eval_expression_with_that_references_concepts():
:return:
"""
context = get_context()
context.sheerka.add_in_cache(Concept("foo", body=1))
context.sheerka.add_in_cache(Concept("foo", body="1"))
parsed = PythonParser().parse(context, "foo + 2")
evaluated = PythonEvaluator().eval(context, parsed)