COMMENTS
See also the Lua reference manual
There are three kinds of comment: initial-line, single-line and
multi-line.
The first line of a program is treated as a comment if its
first character is #.
Single line comments are initiated by --, a pair of minus-signs;
they last to the end of the line.Multine comments start with --
followed immediately by a multiline string; that is
two opening square brackets ([) separated by any number
of equal-signs (=), including
none. So [[, [=[, [==[ ... . They are terminated
by a pair of closing square brackets (])
separated by the same number of equal-signs.Note the following trick for commenting out sections of
code:
--[[
stuff to be commented out
--]]
The second -- does not initiate a single-line comment
because it is already inside a multi-line comment. To reinstate
the commented-out code just add another - to the
first --. ---[[
stuff is no longer comment
--]]
The initial -- hides the -[[ within
a single-line comment, so the second -- does now
initiate a single-line comment.