lua-users home
lua-l archive

End-of-line characters in long strings

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


Hi,
Apparently, on Linux and OSX at least, "\r" characters are cut off the
ends of lines when Lua loads .lua sources, including inside long
strings. This file contains an example:
http://www.inf.puc-rio.br/~hisham/testeol.lua
(I didn't send the file in the email to avoid the risk of mailers
processing end-of-line characters themselves and ruining the test
case. Open the file in an editor that shows non-printable characters,
such as vim -- \r will appear as ^M.)
The results I get when running that are:
12
12
12
12
I'd expect the second and fourth lines to return 13, but they don't.
Is this a bug or am I doing something wrong?
-- Hisham

AltStyle によって変換されたページ (->オリジナル) /