logoots-structs
Version:
Provides several data structures to represent a text using a ropes-like structure and manipulating it
27 lines (23 loc) • 563 B
JavaScript
var LogootSDel = function (lid) {
this.lid = [];
for(var i=0; i<lid.length; i++) {
var id = new IdentifierInterval(lid[i].base, lid[i].begin, lid[i].end);
this.lid.push(id);
}
};
LogootSDel.prototype.copy = function () {
var o = new LogootSDel();
o.lid = [];
for(var i=0; i<this.lid.length; i++) {
o.lid.push(lid[i].copy());
}
return o;
};
LogootSDel.prototype.execute = function (doc) {
var l = [];
for(var i=0; i<this.lid.length; i++) {
Utils.pushAll(l, doc.delBlock(this.lid[i]));
}
return l;
};
module.exports = LogootSDel;