lua-users home
lua-l archive

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

Suppose I want to print the string following
three line string in lua:
Hello brackets!
How are you?

Then it's impossible to do this using the
following single long string: 
Hello brackets!
How are you?]]]]

As the two final brackets will be added in the string.

The lua lexer tries to balance opening [[ with ]], 
to allow for nesting comments. However, this balancing 
has some quirky effects when using [[ in such a long string. 
It's a a minor quirk that I wanted to point out. Maybe it 
would be better not to try and match the [[]] brackets? 
Or only match[[ bracets with ]] when in a comment?

"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer