lua-users home
lua-l archive

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

> It would be nice if the parser could either count the [[ and ]] balance

It does. The problem is that, in regular code, `]]' usually appears
without a corresponding `[[' (e.g., `a[b[i]]').

> or allowed a different block-comment format whose terminator sequence
> wasn't valid Lua grammar.

It will. Lua 5.1 will generalize `[[ ]]' to `[*...*[ ]*...*]', so
that a `[*[' only closes with a `]*]' (same number of stars). That
will allow the inclusion of *any* literal string inside Lua code without

The syntax is not very pretty, but to allow any literal string we need
variable delimiters. And the need to insert source code (and other
large chunks of text) inside Lua code is quite common.

-- Roberto