ns function token even more precise.

This commit is contained in:
Olivier Gagnon 2021-11-11 11:21:21 -05:00
parent 3f28b066b0
commit 3fe25d64e5

@ -355,7 +355,7 @@ export function Root(props: IProps): React.ReactElement {
.loader(); .loader();
l.language.tokenizer.root.unshift(["ns", { token: "ns" }]); l.language.tokenizer.root.unshift(["ns", { token: "ns" }]);
for (const symbol of symbols) for (const symbol of symbols)
l.language.tokenizer.root.unshift(["[^a-zA-Z]" + symbol + "[^a-zA-Z]", { token: "netscriptfunction" }]); l.language.tokenizer.root.unshift(["[^a-zA-Z0-9]" + symbol + "[^a-zA-Z0-9]", { token: "netscriptfunction" }]);
const otherKeywords = ["let", "const", "var", "function"]; const otherKeywords = ["let", "const", "var", "function"];
const otherKeyvars = ["true", "false", "null", "undefined"]; const otherKeyvars = ["true", "false", "null", "undefined"];
otherKeywords.forEach((k) => l.language.tokenizer.root.unshift([k, { token: "otherkeywords" }])); otherKeywords.forEach((k) => l.language.tokenizer.root.unshift([k, { token: "otherkeywords" }]));