Align overlap condition on java implementation
This commit is contained in:
parent
6fbc156f6c
commit
e7660d6cfa
|
@ -612,7 +612,6 @@ namespace Antlr4.Runtime
|
||||||
}
|
}
|
||||||
// throw exception unless disjoint or identical
|
// throw exception unless disjoint or identical
|
||||||
bool disjoint = prevRop.lastIndex < rop.index || prevRop.index > rop.lastIndex;
|
bool disjoint = prevRop.lastIndex < rop.index || prevRop.index > rop.lastIndex;
|
||||||
bool same = prevRop.index == rop.index && prevRop.lastIndex == rop.lastIndex;
|
|
||||||
// Delete special case of replace (text==null):
|
// Delete special case of replace (text==null):
|
||||||
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
|
// D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right)
|
||||||
if (prevRop.text == null && rop.text == null && !disjoint)
|
if (prevRop.text == null && rop.text == null && !disjoint)
|
||||||
|
@ -628,7 +627,7 @@ namespace Antlr4.Runtime
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!disjoint && !same)
|
if ( !disjoint )
|
||||||
{
|
{
|
||||||
throw new ArgumentException("replace op boundaries of " + rop + " overlap with previous " + prevRop);
|
throw new ArgumentException("replace op boundaries of " + rop + " overlap with previous " + prevRop);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue