* Some minor code cleanup

* Some experimental stuff - likely to just drop soon, so no need for a branch
* Minor changes to ansi escape parser
This commit is contained in:
Bryan Ashby 2016-05-23 20:45:18 -06:00
parent 77a9306afa
commit 4f719259fe
5 changed files with 296 additions and 39 deletions

View file

@ -110,7 +110,8 @@ function ANSIEscapeParser(options) {
}
}
self.emit('chunk', text);
//self.emit('chunk', text);
self.emit('literal', text);
}
function getProcessedMCI(mci) {
@ -166,7 +167,10 @@ function ANSIEscapeParser(options) {
});
if(self.mciReplaceChar.length > 0) {
self.emit('chunk', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
//self.emit('chunk', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
const sgrCtrl = ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase);
self.emit('control', sgrCtrl, 'm', sgrCtrl.slice(2).split(/[\;m]/).slice(0, 3));
//self.emit('control', ansi.getSGRFromGraphicRendition(self.graphicRenditionForErase));
literal(new Array(match[0].length + 1).join(self.mciReplaceChar));
} else {
literal(match[0]);
@ -226,7 +230,8 @@ function ANSIEscapeParser(options) {
escape(opCode, args);
self.emit('chunk', match[0]);
//self.emit('chunk', match[0]);
self.emit('control', match[0], opCode, args);
}
} while(0 !== re.lastIndex);
@ -479,4 +484,5 @@ ANSIEscapeParser.styles = {
8 : 'invisibleOn', // FG set to BG
28 : 'invisibleOff', // Not supported by most BBS-like terminals
};
Object.freeze(ANSIEscapeParser.styles);
Object.freeze(ANSIEscapeParser.styles);