Refactored Concept class for better separation of metadata, compiled and values
This commit is contained in:
@@ -73,16 +73,15 @@ class AddConceptEvaluator(OneReturnValueEvaluator):
|
||||
# add props order by appearance when possible
|
||||
for token in def_concept_node.name.tokens:
|
||||
if token.value in props_found:
|
||||
concept.set_prop(token.value, None)
|
||||
concept.def_prop(token.value, None)
|
||||
|
||||
# add the remaining properties
|
||||
for p in props_found:
|
||||
if p not in concept.props:
|
||||
concept.set_prop(p, None)
|
||||
concept.def_prop(p, None)
|
||||
|
||||
# finish initialisation
|
||||
concept.init_key(def_concept_node.name.tokens)
|
||||
#concept.add_codes(def_concept_node.get_asts())
|
||||
if not isinstance(def_concept_node.definition, NotInitializedNode) and \
|
||||
sheerka.is_success(def_concept_node.definition):
|
||||
concept.bnf = def_concept_node.definition.value.value
|
||||
|
||||
@@ -47,7 +47,7 @@ class ConceptEvaluator(OneReturnValueEvaluator):
|
||||
evaluated,
|
||||
parents=[return_value])
|
||||
|
||||
if not self.return_body or ConceptParts.BODY not in evaluated.cached_asts:
|
||||
if not self.return_body or ConceptParts.BODY not in evaluated.compiled:
|
||||
return sheerka.ret(self.name, True, evaluated, parents=[return_value])
|
||||
else:
|
||||
return sheerka.ret(self.name, True, evaluated.body, parents=[return_value])
|
||||
|
||||
Reference in New Issue
Block a user