Implemented ConceptManager with concept creation, modification and deletion

This commit is contained in:
2020-12-08 15:36:21 +01:00
parent d364878ddb
commit 4b6e1dd55b
40 changed files with 1847 additions and 979 deletions
@@ -56,10 +56,6 @@ class AddConceptInSetEvaluator(OneReturnValueEvaluator):
parents=[return_value])
concept = res.value
if sheerka.has_id(concept.id) and id(concept) == id(sheerka.get_by_id(concept.id)):
# hack because it is not possible to use sheerka.modify_concept() on a cache instance
concept = sheerka.new((concept.name, concept.id))
res = _resolve(isa_node.set)
if not res.status:
return sheerka.ret(
+5 -1
View File
@@ -158,7 +158,11 @@ class PythonEvaluator(OneReturnValueEvaluator):
context.log(f"{evaluated=}", self.name)
debugger.debug_var("ret", evaluated)
return sheerka.ret(self.name, True, evaluated, parents=[return_value])
if sheerka.isinstance(evaluated, BuiltinConcepts.RETURN_VALUE):
return sheerka.ret(self.name, evaluated.status, evaluated.body, parents=[return_value, evaluated])
else:
return sheerka.ret(self.name, True, evaluated, parents=[return_value])
def get_globals(self, context, node, expression_only):
"""