Let me try to explain the issue further.
Let’s say you want to comment out a single line of code so it won’t run.
Both Notepad++ and Renoise highlight single-line comment syntax correctly, and Renoise’s Lua interpreter ignores the line correctly.
Now let’s say you want to comment out multiple lines of code.
Simple, you would use a multi-line comment
Ah, but in this case, the
bar[foo] has closed the comment, and as such, we end up with
) print(bar[foo]) being run, which is undesired.
To remedy cases such as this, Lua allows for nested comments.
The original syntax was
--[[--[[ ]] ]], where you can nest as many levels as you need, so long as you close them with a matching amount of closing square brackets.
This syntax is highlighted correctly in both Notepad++ and Renoise. However, the Renoise interpreter gives an error, stating that this syntax has been deprecated, which is correct. Lua 5 now uses a new syntax for nested multi-line comments.
The new syntax is
--[=[ ]=] where the amount of
= determines how many levels of nesting will be created.
Notepad++ highlights this new syntax correctly, and Renoise interprets it correctly as well, ignoring the 2nd and 3rd print commands.
However, Renoise does not properly highlight the new syntax. This can lead to a great deal of confusion and unnecessary bugs, as you can imagine, if one is using these types of comments in the Renoise scripting editor.
You can find messy ways to combine
--[[ ]] and
-- to get around this, but similarly, this can lead to some confusion and unnecessary bugs.
Luckily using these types of comments has been a luxury I’ve been able to live without, but it would have made my code a lot cleaner in some cases, if I had been able to properly nest comments.
Anyone who chooses not to use Renoise’s built-in scripting editor shouldn’t care too much, but I actually love to use it, and it is my primary editor for creating Lua tools for Renoise. This is such a small thing, I imagine it wouldn’t be very difficult to fix (correct me if I’m wrong @taktik).
TL;DR The highlighting of the deprecated
--[[--[[ ]] ]] syntax for nested multi-line comments needs to be removed from Renoise’s built-in scripting editor, and highlighting of the current
--[=[ ]=] syntax needs to be included instead.