Fix overlaping condition

This commit is contained in:
Thomas 2019-05-08 14:26:11 +02:00
parent 7c334b114c
commit 8d48f1a851
2 changed files with 3 additions and 3 deletions

View File

@ -163,7 +163,7 @@ class TokenStreamRewriter(object):
rop.index = min(prevRop.index, rop.index)
rop.last_index = min(prevRop.last_index, rop.last_index)
print('New rop {}'.format(rop))
elif not all((isDisjoint, isSame)):
elif (not(isDisjoint) and not(isSame)):
raise ValueError("replace op boundaries of {} overlap with previous {}".format(rop, prevRop))
# Walk inserts before

View File

@ -162,7 +162,7 @@ class TokenStreamRewriter(object):
rop.index = min(prevRop.index, rop.index)
rop.last_index = min(prevRop.last_index, rop.last_index)
print('New rop {}'.format(rop))
elif not all((isDisjoint, isSame)):
elif (not(isDisjoint) and not(isSame)):
raise ValueError("replace op boundaries of {} overlap with previous {}".format(rop, prevRop))
# Walk inserts