Added chicken and egg recursion detection
This commit is contained in:
+27
-18
@@ -242,24 +242,24 @@ class Concept:
|
||||
def body(self):
|
||||
return self.values[ConceptParts.BODY] if ConceptParts.BODY in self.values else None
|
||||
|
||||
def add_codes(self, codes):
|
||||
"""
|
||||
Gets the ASTs for 'where', 'pre', 'post' and 'body'
|
||||
There ASTs are know when the concept is freshly parsed.
|
||||
So the values are kept in cache.
|
||||
|
||||
For concepts loaded from sdp, these ASTs must be created again
|
||||
TODO : Seems to be a service method. Can be put somewhere else
|
||||
:param codes:
|
||||
:return:
|
||||
"""
|
||||
if codes is None:
|
||||
return
|
||||
|
||||
for key in codes:
|
||||
self.compiled[key] = codes[key]
|
||||
|
||||
return self
|
||||
# def add_codes(self, codes):
|
||||
# """
|
||||
# Gets the ASTs for 'where', 'pre', 'post' and 'body'
|
||||
# There ASTs are know when the concept is freshly parsed.
|
||||
# So the values are kept in cache.
|
||||
#
|
||||
# For concepts loaded from sdp, these ASTs must be created again
|
||||
# TODO : Seems to be a service method. Can be put somewhere else
|
||||
# :param codes:
|
||||
# :return:
|
||||
# """
|
||||
# if codes is None:
|
||||
# return
|
||||
#
|
||||
# for key in codes:
|
||||
# self.compiled[key] = codes[key]
|
||||
#
|
||||
# return self
|
||||
|
||||
def get_digest(self):
|
||||
"""
|
||||
@@ -406,3 +406,12 @@ class DoNotResolve:
|
||||
set concept.compiled[BODY] to DoNotResolve(value)
|
||||
"""
|
||||
value: object
|
||||
|
||||
|
||||
@dataclass()
|
||||
class InfiniteRecursionResolved:
|
||||
"""This class is used to when we managed to break an infinite recursion concept definition"""
|
||||
value: object
|
||||
|
||||
def get_value(self):
|
||||
return self.value
|
||||
|
||||
Reference in New Issue
Block a user