be more strict in checkRep

pull/2364/head
webzwo0i 2014-12-04 16:12:13 +01:00
parent 5306f0c98a
commit 22803da42f
1 changed files with 6 additions and 6 deletions

View File

@ -255,20 +255,20 @@ exports.checkRep = function (cs) {
var o = iter.next(); var o = iter.next();
switch (o.opcode) { switch (o.opcode) {
case '=': case '=':
exports.assert(o.chars >= o.lines, o.chars, " chars and ", o.lines, " lines in op ",cs);
oldPos += o.chars; oldPos += o.chars;
calcNewLen += o.chars; calcNewLen += o.chars;
break; break;
case '-': case '-':
exports.assert(o.chars >= o.lines, o.chars, " chars and ", o.lines, " lines in op ",cs);
oldPos += o.chars; oldPos += o.chars;
exports.assert(oldPos < oldLen, oldPos, " >= ", oldLen, " in ", cs); exports.assert(oldPos < oldLen, oldPos, " >= ", oldLen, " in ", cs);
break; break;
case '+': case '+':
{ exports.assert(o.chars >= o.lines, o.chars, " chars and ", o.lines, " lines in op ",cs);
calcNewLen += o.chars; calcNewLen += o.chars;
numInserted += o.chars; exports.assert(calcNewLen < newLen, calcNewLen, " >= ", newLen, " in ", cs);
exports.assert(calcNewLen < newLen, calcNewLen, " >= ", newLen, " in ", cs); break;
break;
}
} }
assem.append(o); assem.append(o);
} }