From f3184e9c8d262b22c1cf831291698edb233cd0c4 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 13 May 2019 22:19:19 +0200 Subject: [PATCH] Align overlap condition on java implementation --- runtime/Cpp/runtime/src/TokenStreamRewriter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp b/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp index e281b19cc..0ac47d33f 100755 --- a/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp +++ b/runtime/Cpp/runtime/src/TokenStreamRewriter.cpp @@ -348,7 +348,6 @@ std::unordered_map TokenStreamRe } // 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.empty() && rop->text.empty() && !disjoint) { @@ -358,7 +357,7 @@ std::unordered_map TokenStreamRe rop->lastIndex = std::max(prevRop->lastIndex, rop->lastIndex); std::cout << "new rop " << rop << std::endl; } - else if (!disjoint && !same) { + else if ( !disjoint ) { throw IllegalArgumentException("replace op boundaries of " + rop->toString() + " overlap with previous " + prevRop->toString()); }