Files
xterm.js/bin/embed_parser_wasm.mjs
T
Cursor AgentandDaniel Imms 3eca55a80d feat(parser): WASM VT500 scanner with ScanResult SOA dispatch
- Add C WASM scanner emitting structure-of-arrays ops (kinds, starts, lengths, aux, params)
- Integrate scan+dispatch in EscapeSequenceParser with async handler resume
- Fix CSI fast-path final byte index, ERROR state reporting, and precedingJoinState for REP
- Add build pipeline (build_parser_wasm.sh, transition table generator, wasm embed)

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-31 21:35:02 +00:00

24 lines
791 B
JavaScript

/**
* Copyright (c) 2026 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { readFileSync, writeFileSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const root = join(__dirname, '..');
const wasm = readFileSync(join(root, 'src/common/parser/wasm/parser.wasm'));
const b64 = wasm.toString('base64');
const out = `/**
* Copyright (c) 2026 The xterm.js authors. All rights reserved.
* @license MIT
*/
/** Base64-encoded parser.wasm (generated by bin/build_parser_wasm.sh) */
export const PARSER_WASM_BASE64 = '${b64}';\n`;
writeFileSync(join(root, 'src/common/parser/wasm/parser.wasm.embed.ts'), out);
console.info(`Embedded parser.wasm (${wasm.length} bytes)`);