Fixed minor bugs
This commit is contained in:
+1
-1
@@ -495,7 +495,7 @@ class Sheerka(Concept):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# steps = [BuiltinConcepts.BEFORE_PARSING, BuiltinConcepts.PARSING, BuiltinConcepts.AFTER_PARSING]
|
# 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:
|
for part_key in ConceptParts:
|
||||||
source = getattr(concept.metadata, part_key.value)
|
source = getattr(concept.metadata, part_key.value)
|
||||||
if source is None or not isinstance(source, str) or source == "":
|
if source is None or not isinstance(source, str) or source == "":
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class PythonEvaluator(OneReturnValueEvaluator):
|
|||||||
evaluated = context.sheerka.evaluate_concept(sub_context, concept, self.verbose_log)
|
evaluated = context.sheerka.evaluate_concept(sub_context, concept, self.verbose_log)
|
||||||
|
|
||||||
if evaluated.key == concept.key:
|
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
|
return my_locals
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ def test_i_can_eval_expression_with_that_references_concepts():
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
context = get_context()
|
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")
|
parsed = PythonParser().parse(context, "foo + 2")
|
||||||
evaluated = PythonEvaluator().eval(context, parsed)
|
evaluated = PythonEvaluator().eval(context, parsed)
|
||||||
|
|||||||
Reference in New Issue
Block a user