Build a new Subst, carving it according to the given additional Substs.
Build a new Subst, carving it according to the given additional Substs.
remaining additional Substs when this is reached
(carved pieces, the tail part of by that is still relevant to the carving of the following Substs)
Build a new Subst, carving this if it crosses the boundaries
of by (additional edit), or simply shift or absorb it otherwise.
Build a new Subst, carving this if it crosses the boundaries
of by (additional edit), or simply shift or absorb it otherwise.
For example, a simple shift happens when:
this = [5,7) -> [5,8) by = [1,4) -> [1,2) this.to is after by.from thus, shift this.to, by by.to.end - by.from.end = -2 this.to will be [5 - 2, 8 - 2) = [3, 6) and there is no unprocessed part
But with a border crossing, it becomes:
this = [1,6) -> [1,8) by = [3,5) -> [3,7) this.to overlaps by.from thus, this.to will be cut (and its right piece, shifted by 2): - unprocessed yet: [1,6) -> [1,3) - (in the middle is by.from) - processed: [1,6) -> [5 + 2, 8 + 2)
(the unprocessed part of this, the processed part of this)
A Substitution from an Interval in the original String to an Interval in the new String.