step into closures from elsewhere (draft)

This commit is contained in:
LenAnderson
2024-06-27 11:49:12 -04:00
parent aefa31a912
commit 173c5ef53e
5 changed files with 39 additions and 0 deletions

View File

@ -117,6 +117,8 @@ export class SlashCommandParser {
/**@type {SlashCommandExecutor[]}*/ commandIndex;
/**@type {SlashCommandScope[]}*/ scopeIndex;
/**@type {string}*/ parserContext;
get userIndex() { return this.index; }
get ahead() {
@ -610,6 +612,7 @@ export class SlashCommandParser {
this.commandIndex = [];
this.scopeIndex = [];
this.macroIndex = [];
this.parserContext = uuidv4();
const closure = this.parseClosure(true);
return closure;
}
@ -637,6 +640,8 @@ export class SlashCommandParser {
if (!isRoot) this.take(2); // discard opening {:
const textStart = this.index;
let closure = new SlashCommandClosure(this.scope);
closure.parserContext = this.parserContext;
closure.fullText = this.text;
closure.abortController = this.abortController;
closure.debugController = this.debugController;
this.scope = closure.scope;