From a4f1f3f014b492311adfeb64c071c36f8c6e9c36 Mon Sep 17 00:00:00 2001 From: Nanne <184182+whazor@users.noreply.github.com> Date: Fri, 3 Mar 2023 16:32:47 +0100 Subject: [PATCH] Support TM include: $self Used by mediawiki, robot, mel, pig, elixir, logiql, alda --- src/mode/_test/tokens_mel.json | 20 +++++++++++++++++++- src/mode/text_highlight_rules.js | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mode/_test/tokens_mel.json b/src/mode/_test/tokens_mel.json index d5bb79bd356..8a9d275b943 100644 --- a/src/mode/_test/tokens_mel.json +++ b/src/mode/_test/tokens_mel.json @@ -8,7 +8,25 @@ ["storage.type.mel"," "], ["entity.name.function.mel","animatedDuplication"], ["punctuation.section.function.mel"," ("], - ["meta.function.mel","int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance"], + ["storage.type.mel","int"], + ["meta.function.mel"," "], + ["variable.other.mel","$"], + ["punctuation.definition.variable.mel","rangeStart"], + ["meta.function.mel",", "], + ["storage.type.mel","int"], + ["meta.function.mel"," "], + ["variable.other.mel","$"], + ["punctuation.definition.variable.mel","rangeEnd"], + ["meta.function.mel",", "], + ["storage.type.mel","int"], + ["meta.function.mel"," "], + ["variable.other.mel","$"], + ["punctuation.definition.variable.mel","numOfDuplicates"], + ["meta.function.mel",", "], + ["storage.type.mel","int"], + ["meta.function.mel"," "], + ["variable.other.mel","$"], + ["punctuation.definition.variable.mel","duplicateOrInstance"], ["punctuation.section.function.mel",")"] ],[ "start", diff --git a/src/mode/text_highlight_rules.js b/src/mode/text_highlight_rules.js index d8d109bed49..e44f201f6fe 100644 --- a/src/mode/text_highlight_rules.js +++ b/src/mode/text_highlight_rules.js @@ -149,6 +149,8 @@ var TextHighlightRules = function() { } var includeName = typeof rule == "string" ? rule : rule.include; if (includeName) { + if (includeName === "$self") + includeName = "start"; if (Array.isArray(includeName)) toInsert = includeName.map(function(x) { return rules[x]; }); else