kommentary
kommentary copied to clipboard
Support advanced multiline strings in lua e.g. --[=[ something ]=]
Lua supports semi-arbitrary multiline comment strings in the form of matching numbers of equals signs. Meaning --[==[
, --[===[
, and --[=[
will only end the comment when it encounters ]==]
, ]===]
, and ]=]
respectively.
It would be a great idea to match an opening regex like --\[\(=*\)\[
(or --\[(=*)\[
in PCRE style just to make sure it's clear) to the closing ]\1]
(using the capture group from the opening regex to guarantee the same number of =
)
This may not be as important when creating the comments, but is important to effectively uncomment them.