Changeset: Delete unused code

This commit is contained in:
Richard Hansen 2021-03-04 20:37:28 -05:00
parent eb495e9ea2
commit 34cfff4e4c

View file

@ -159,17 +159,6 @@ exports.newOp = (optOpcode) => ({
attribs: '', attribs: '',
}); });
/**
* Clones an Op
* @param op Op to be cloned
*/
exports.cloneOp = (op) => ({
opcode: op.opcode,
chars: op.chars,
lines: op.lines,
attribs: op.attribs,
});
/** /**
* Copies op1 to op2 * Copies op1 to op2
* @param op1 src Op * @param op1 src Op
@ -182,17 +171,6 @@ exports.copyOp = (op1, op2) => {
op2.attribs = op1.attribs; op2.attribs = op1.attribs;
}; };
/**
* Writes the Op in a string the way that changesets need it
*/
exports.opString = (op) => {
// just for debugging
if (!op.opcode) return 'null';
const assem = exports.opAssembler();
assem.append(op);
return assem.toString();
};
/** /**
* Used to check if a Changeset if valid * Used to check if a Changeset if valid
* @param cs {Changeset} Changeset to be checked * @param cs {Changeset} Changeset to be checked
@ -556,8 +534,6 @@ exports.textLinesMutator = (lines) => {
lines.splice.apply(lines, s); lines.splice.apply(lines, s);
}; };
const lines_toSource = () => lines.toSource();
/** /**
* Get a line from lines at given index * Get a line from lines at given index
* @param {Number} idx an index * @param {Number} idx an index
@ -630,10 +606,6 @@ exports.textLinesMutator = (lines) => {
*/ */
const isCurLineInSplice = () => (curLine - curSplice[0] < (curSplice.length - 2)); const isCurLineInSplice = () => (curLine - curSplice[0] < (curSplice.length - 2));
const debugPrint = (typ) => { /* eslint-disable-line no-unused-vars */
print(`${typ}: ${curSplice.toSource()} / ${curLine},${curCol} / ${lines_toSource()}`);
};
/** /**
* Incorporates current line into the splice * Incorporates current line into the splice
* and marks its old position to be deleted. * and marks its old position to be deleted.
@ -1424,7 +1396,6 @@ exports.makeSplice = (oldFullText, spliceStart, numRemoved, newText, optNewTextA
* @param cs Changeset * @param cs Changeset
*/ */
exports.toSplices = (cs) => { exports.toSplices = (cs) => {
//
const unpacked = exports.unpack(cs); const unpacked = exports.unpack(cs);
const splices = []; const splices = [];