From 0b0e521a8d806a585fa537fda296806b92783ed5 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 13 May 2019 22:25:42 +0200 Subject: [PATCH] Align overlap condition on java implementation --- .../runtime/CSharp/Antlr4.Runtime/TokenStreamRewriter.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/TokenStreamRewriter.cs b/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/TokenStreamRewriter.cs index 52e91c828..d09bbde3b 100644 --- a/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/TokenStreamRewriter.cs +++ b/runtime/CSharp/runtime/CSharp/Antlr4.Runtime/TokenStreamRewriter.cs @@ -612,7 +612,6 @@ namespace Antlr4.Runtime } // throw exception unless disjoint or identical 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): // D.i-j.u D.x-y.v | boundaries overlap combine to max(min)..max(right) if (prevRop.text == null && rop.text == null && !disjoint) @@ -628,7 +627,7 @@ namespace Antlr4.Runtime } else { - if (!disjoint && !same) + if ( !disjoint ) { throw new ArgumentException("replace op boundaries of " + rop + " overlap with previous " + prevRop); }