diff --git a/src/common/parser/ApcParser.test.ts b/src/common/parser/ApcParser.test.ts index 4486f71c3..39dc9fb45 100644 --- a/src/common/parser/ApcParser.test.ts +++ b/src/common/parser/ApcParser.test.ts @@ -71,16 +71,16 @@ describe('ApcParser', () => { ]); }); - //it('identifier with no payload', () => { - // parser.start('G'.charCodeAt(0)); - // const data = toUtf32(''); - // parser.put(data, 0, data.length); - // parser.end(true); - // assert.deepEqual(reports, [ - // [0x47, 'START', undefined], - // [0x47, 'END', true] - // ]); - //}); + // it('identifier with no payload', () => { + // parser.start('G'.charCodeAt(0)); + // const data = toUtf32(''); + // parser.put(data, 0, data.length); + // parser.end(true); + // assert.deepEqual(reports, [ + // [0x47, 'START', undefined], + // [0x47, 'END', true] + // ]); + // }); it('identifier with chunked payload', () => { parser.start('G'.charCodeAt(0)); @@ -100,11 +100,11 @@ describe('ApcParser', () => { ]); }); - //it('empty APC sequence', () => { - // parser.start('G'.charCodeAt(0)); - // parser.end(true); - // assert.deepEqual(reports, []); - //}); + // it('empty APC sequence', () => { + // parser.start('G'.charCodeAt(0)); + // parser.end(true); + // assert.deepEqual(reports, []); + // }); }); describe('handler registration', () => { diff --git a/src/common/parser/ApcParser.ts b/src/common/parser/ApcParser.ts index c6f709071..8f921f8cb 100644 --- a/src/common/parser/ApcParser.ts +++ b/src/common/parser/ApcParser.ts @@ -4,7 +4,7 @@ */ import { IApcHandler, IHandlerCollection, ApcFallbackHandlerType, IApcParser, ISubParserStackState } from 'common/parser/Types'; -import { ApcState, ParserConstants } from 'common/parser/Constants'; +import { ParserConstants } from 'common/parser/Constants'; import { utf32ToString } from 'common/input/TextDecoder'; import { IDisposable } from 'common/Types'; diff --git a/src/common/parser/Constants.ts b/src/common/parser/Constants.ts index 6bf3260c3..cf596c65e 100644 --- a/src/common/parser/Constants.ts +++ b/src/common/parser/Constants.ts @@ -62,16 +62,6 @@ export const enum OscState { ABORT = 3 } -/** - * Internal states of ApcParser. - */ -export const enum ApcState { - START = 0, - ID = 1, - PAYLOAD = 2, - ABORT = 3 -} - // payload limit for OSC and DCS export const enum ParserConstants { PAYLOAD_LIMIT = 10000000 diff --git a/src/common/parser/EscapeSequenceParser.test.ts b/src/common/parser/EscapeSequenceParser.test.ts index a7101a770..c7f5b8cfe 100644 --- a/src/common/parser/EscapeSequenceParser.test.ts +++ b/src/common/parser/EscapeSequenceParser.test.ts @@ -727,20 +727,6 @@ describe('EscapeSequenceParser', () => { } } }); - //it('trans ANYWHERE/ESCAPE --> APC_STRING', () => { - // parser.reset(); - // // C0 (ESC _) - // parse(parser, '\x1b_'); - // assert.equal(parser.currentState, ParserState.APC_STRING); - // parser.reset(); - // // C1 - // for (state in states) { - // parser.currentState = state; - // parse(parser, '\x9f'); - // assert.equal(parser.currentState, ParserState.APC_STRING); - // parser.reset(); - // } - //}); it('state SOS_PM_STRING ignore rules', () => { parser.reset(); let ignored = r(0x00, 0x18); diff --git a/src/common/parser/EscapeSequenceParser.ts b/src/common/parser/EscapeSequenceParser.ts index 11020e8bb..f2ea00318 100644 --- a/src/common/parser/EscapeSequenceParser.ts +++ b/src/common/parser/EscapeSequenceParser.ts @@ -77,7 +77,8 @@ const NON_ASCII_PRINTABLE = 0xA0; * Taken from https://vt100.net/emu/dec_ansi_parser. */ export const VT500_TRANSITION_TABLE = (function (): TransitionTable { - // table size: (ParserState.STATE_LENGTH - 1) << TableAccess.INDEX_STATE_SHIFT | NON_ASCII_PRINTABLE + 1 + // table size: + // (ParserState.STATE_LENGTH - 1) << TableAccess.INDEX_STATE_SHIFT | NON_ASCII_PRINTABLE + 1 const table: TransitionTable = new TransitionTable(4257); // range macro for byte @@ -891,13 +892,13 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP case ParserAction.APC_PUT: // FIXME: this is wrong, must be 00/08 .. 00/13, 02/00 .. 07/14 + NON_ASCII_PRINTABLE // inner loop - exit APC_PUT: 0x18, 0x1a, 0x1b, 0x9c - //for (let j = i + 1; ; ++j) { - // if (j >= length || (code = data[j]) === 0x18 || code === 0x1a || code === 0x1b || code === 0x9c || (code > 0x7f && code < NON_ASCII_PRINTABLE)) { - // this._apcParser.put(data, i, j); - // i = j - 1; - // break; - // } - //} + // for (let j = i + 1; ; ++j) { + // if (j >= length || (code = data[j]) === 0x18 || code === 0x1a || code === 0x1b || code === 0x9c || (code > 0x7f && code < NON_ASCII_PRINTABLE)) { + // this._apcParser.put(data, i, j); + // i = j - 1; + // break; + // } + // } this._apcParser.put(data, i, i+1); break; case ParserAction.APC_END: diff --git a/test/playwright/Parser.test.ts b/test/playwright/Parser.test.ts index eceb75282..6f61fb8c9 100644 --- a/test/playwright/Parser.test.ts +++ b/test/playwright/Parser.test.ts @@ -334,7 +334,7 @@ test.describe('Parser Integration Tests', () => { window.customApcHandlerCallStack!.push(['F', data]); return true; }), - term.parser.registerApcHandler({ final: 'X' }, data => { + term.parser.registerApcHandler({ final: 'X' }, data => { window.customApcHandlerCallStack!.push(['X', data]); return true; })