mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
27 lines
631 B
JavaScript
27 lines
631 B
JavaScript
import { CstParser } from '../../lib/chevrotain.js';
|
|
import { MacroLexer } from './MacroLexer.js';
|
|
|
|
/**
|
|
* The singleton instance of the MacroParser.
|
|
*
|
|
* @type {MacroParser}
|
|
*/
|
|
let instance;
|
|
export { instance as MacroParser };
|
|
|
|
class MacroParser extends CstParser {
|
|
/** @type {MacroParser} */ static #instance;
|
|
/** @type {MacroParser} */ static get instance() { return MacroParser.#instance ?? (MacroParser.#instance = new MacroParser()); }
|
|
|
|
/** @private */
|
|
constructor() {
|
|
super(MacroLexer.def);
|
|
|
|
// const $ = this;
|
|
|
|
this.performSelfAnalysis();
|
|
}
|
|
}
|
|
|
|
instance = MacroParser.instance;
|