| Message |
There seemed to be a problem in Crimson Editor in detecting block comments, in that they were commented out in the lua.spc file. I suspect this is because the block comment delimiter was the same as the multi-line string delimiter. However this file contents *seemed* to work for me:
$CASESENSITIVE=YES
$DELIMITERS=(){}[]<>+-*/%="'~!@#&$^&|\?:;,.
$ESCAPECHAR=\
$QUOTATIONMARK1="
$QUOTATIONMARK2='
$LINECOMMENT=--
$SHADOWON=[[
$SHADOWOFF=]]
$BLOCKCOMMENTON=--[[
$BLOCKCOMMENTOFF=--]]
$PAIRS1=()
$PAIRS2=[]
$PAIRS3={}
$MULTILINESTRINGCONSTANT=YES
Strictly speaking, a multi-line comment is terminated by just "]]", not "--]]", however the Lua manual recommends using "--]]" because you can then simply include or exclude the entire multi-line block (assuming it is code) by simply adding an extra hyphen to the leading comment. Also, I think it looks more symmetrical.
To quote from their manual:
A common trick, when we want to comment out a piece of code, is to write the following:
--[[
print(10) -- no action (comment)
--]]
Now, if we add a single hyphen to the first line, the code is in again:
---[[
print(10) --> 10
--]]
In the first example, the -- in the last line is still inside the block comment. In the second example, the sequence ---[[ does not start a block comment; so, the print is outside comments. In this case, the last line becomes an independent comment, as it starts with --.
[EDIT]
Added a new line, found on another forum:
$MULTILINESTRINGCONSTANT=YES
This lets it recognise multi-line string costants, like this:
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|