diff --git a/public/scripts/slash-commands/SlashCommandParser.js b/public/scripts/slash-commands/SlashCommandParser.js index 915a41ebe..2e3adf0c2 100644 --- a/public/scripts/slash-commands/SlashCommandParser.js +++ b/public/scripts/slash-commands/SlashCommandParser.js @@ -178,35 +178,105 @@ export class SlashCommandParser { relevance: 0, }; + const COMMENT = { + scope: 'comment', + begin: /\/[/#]/, + end: /\||$|:}/, + contains: [], + }; + const LET = { + begin: [ + /\/(let|var)\s+/, + ], + beginScope: { + 1: 'variable', + }, + end: /\||$|:}/, + contains: [], + }; + const SETVAR = { + begin: /\/(setvar|setglobalvar)\s+/, + beginScope: 'variable', + end: /\||$|:}/, + excludeEnd: true, + contains: [], + }; + const GETVAR = { + begin: /\/(getvar|getglobalvar)\s+/, + beginScope: 'variable', + end: /\||$|:}/, + excludeEnd: true, + contains: [], + }; + const RUN = { + match: [ + /\/:/, + /(".+?(?({ case_insensitive: false, keywords: ['|'], contains: [ hljs.BACKSLASH_ESCAPE, + COMMENT, + RUN, + LET, + GETVAR, + SETVAR, COMMAND, CLOSURE, - CLOSURE_ARGS, ], })); }