[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Lua 5.0 alpha long string quirk
 
- From: Björn De Meyer <bjorn.demeyer@...>
 
- Date: Fri, 23 Aug 2002 23:07:36 +0200
 
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 
bjorn.demeyer@pandora.be