Fixed RET functionnality misbehaviour

This commit is contained in:
2020-07-08 13:35:18 +02:00
parent c4399d631c
commit b768eaa95d
14 changed files with 113 additions and 29 deletions
+14 -1
View File
@@ -196,6 +196,19 @@ class ConceptNode(LexerNode):
clone = ConceptNode(self.concept, self.start, self.end, self.tokens, self.source, self.underlying)
return clone
def as_bag(self):
"""
Creates a dictionary with the useful properties of the ConceptNode
see Concept.as_bag() for extra informations
"""
bag = {}
for k, v in self.__dict__.items():
bag[k] = v
# if isinstance(self.concept, Concept):
# bag["compiled"] = self.concept.compiled
return bag
class SourceCodeNode(LexerNode):
"""
@@ -528,7 +541,7 @@ class CNC(CN):
to_compare = {k: v for k, v in other.concept.compiled.items() if k != ConceptParts.BODY}
else:
to_compare = other.concept.compiled
if self.compiled == to_compare: # expanded form to ease the debug
if self.compiled == to_compare: # expanded form to ease the debug
return True
else:
return False