lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


If there's issue about what characters might appear in code, why not just use a
character that's guaranteed never to appear in valid lua code?   @ is
unused, as is # (for the most part).  I'm sure there's others, but these
are the easiest to type. ;)

If you require a preceding character, # becomes viable in all cases,
and it would allow visible similarity to current comments.

-- Comment
-# Block Comment #-, or --# Block Comment #--, or whatever

Or you could even offer facility for the open and close block comment
tokens to be customizable... Though this is probably asking for trouble.

 -# Jadek #-

At 11:39 AM 6/19/2004, you wrote:


How about:

The TERMINATOR may never contains ']]'.

This will make single line things work (as above) and:

--[[
multiline comment
my favorite style :)
]]--

(the terminating -- is of course optional, but I like them for visual symmetry :)

--[[my.html
<HTTP>...whatever
my.html]]

If one wants, '*'s can be used as terminators:

--[[***
***]]


Philippe Lhoste wrote:

Mmmm, not so bright, it is incompatible with simple use of this string, like:
path = [[C:\Good Languages\Lua\Bright Script.lua]]

unless we make additional rules like:

Single line literal strings/comments use old syntax, multiline ones always starts with new line or HereDoc terminator.

Or we use foo = [[[TERMINATOR
but I like it less (more exceptions).