minor tweaks, API docs update

This commit is contained in:
Jörg Breitbart
2021-02-15 16:24:29 +01:00
parent 5db479c25d
commit 26502114d4
2 changed files with 27 additions and 16 deletions
+2 -4
View File
@@ -526,18 +526,17 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
this._parseStack.state = ParserStackType.FAIL;
throw new Error('improper continuation due to previous async handler, giving up parsing');
}
let handlerPos = this._parseStack.handlerPos - 1;
// we have to resume the old handler loop if:
// - return value of the promise was `false`
// - handlers are not exhausted yet
// FIXME: removing handlers from within a handler of the same sequence
// is not supported atm (also true for sync handlers)!!
let handlers: ResumableHandlersType;
let handlers = this._parseStack.handlers;
let handlerPos = this._parseStack.handlerPos - 1;
switch (this._parseStack.state) {
case ParserStackType.CSI:
if (promiseResult === false && handlerPos > -1) {
handlers = this._parseStack.handlers;
for (; handlerPos >= 0; handlerPos--) {
if ((handlerResult = (handlers as CsiHandlerType[])[handlerPos](this._params)) !== false) {
if (handlerResult instanceof Promise) {
@@ -552,7 +551,6 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
break;
case ParserStackType.ESC:
if (promiseResult === false && handlerPos > -1) {
handlers = this._parseStack.handlers;
for (; handlerPos >= 0; handlerPos--) {
if ((handlerResult = (handlers as EscHandlerType[])[handlerPos]()) !== false) {
if (handlerResult instanceof Promise) {