EDITOR: Add "arguments" to the keyword list (#1230)

This commit is contained in:
catloversg 2024-04-25 03:10:20 +07:00 committed by GitHub
parent 0f23c95737
commit 3fac471d51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -45,7 +45,7 @@ export class ScriptEditor {
l.language.tokenizer.root.unshift([new RegExp("\\bns\\b"), { token: "ns" }]); l.language.tokenizer.root.unshift([new RegExp("\\bns\\b"), { token: "ns" }]);
for (const symbol of apiKeys) for (const symbol of apiKeys)
l.language.tokenizer.root.unshift([new RegExp(`\\b${symbol}\\b`), { token: "netscriptfunction" }]); l.language.tokenizer.root.unshift([new RegExp(`\\b${symbol}\\b`), { token: "netscriptfunction" }]);
const otherKeywords = ["let", "const", "var", "function"]; const otherKeywords = ["let", "const", "var", "function", "arguments"];
const otherKeyvars = ["true", "false", "null", "undefined"]; const otherKeyvars = ["true", "false", "null", "undefined"];
otherKeywords.forEach((k) => otherKeywords.forEach((k) =>
l.language.tokenizer.root.unshift([new RegExp(`\\b${k}\\b`), { token: "otherkeywords" }]), l.language.tokenizer.root.unshift([new RegExp(`\\b${k}\\b`), { token: "otherkeywords" }]),