Warn when expander yields blocks that are known to be ignored
This is just a debugging tool, if this warning occurs it's an indication of a bug in BAT.
This commit is contained in:
parent
74ae76cd73
commit
932283be65
@ -49,9 +49,17 @@ def expand_block(
|
|||||||
return
|
return
|
||||||
|
|
||||||
log.debug("Expanding block %r", block)
|
log.debug("Expanding block %r", block)
|
||||||
|
for dependency in expander(block):
|
||||||
|
if not dependency:
|
||||||
# Filter out falsy blocks, i.e. None values.
|
# Filter out falsy blocks, i.e. None values.
|
||||||
# Allowing expanders to yield None makes them more consise.
|
# Allowing expanders to yield None makes them more consise.
|
||||||
yield from filter(None, expander(block))
|
continue
|
||||||
|
if dependency.code == b"DATA":
|
||||||
|
log.warn(
|
||||||
|
"expander yielded block %s which will be ignored in later iteration",
|
||||||
|
dependency,
|
||||||
|
)
|
||||||
|
yield dependency
|
||||||
|
|
||||||
|
|
||||||
def dna_code(block_code: str):
|
def dna_code(block_code: str):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user