Resolved some remaining chicken and egg when parsing BNF nodes

This commit is contained in:
2020-07-05 11:03:03 +02:00
parent ad8a997942
commit 71f753c925
14 changed files with 310 additions and 56 deletions
+4 -4
View File
@@ -373,15 +373,15 @@ class ExecutionContext:
:param predicate: what execution context to keep
:param get_obj: lambda to compute what to return
:param start_with_self: include the current execution context in the search
:param stop: stop the search if matched
:param stop: condition to stop
:return:
"""
current = self if start_with_self else self._parent
while current:
if stop and stop(current):
break
if predicate is None or predicate(current):
yield current if get_obj is None else get_obj(current)
if stop and stop(current):
break
current = current._parent