lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
I'm guessing that all of the following

<X> <NL> <NL> <X>
<X> <NL> <CR> <NL> <CR> <X>
<X> <CR> <CR> <X>
<X> <NL> <CR> <NL> <CR> <X>

will be treated as

<X> <NL> <NL> <X>


Yes (assuming that NL is LF :).

I don't agree with that. Since AFAIK, <LF><CR> is a combination not used by any OS, it shouldn't be processed as a single EOL.

For me, <X><LF><CR><LF><CR><X> should be seen as <X><Unix EOL><Dos EOL><Mac EOL><X>
It is a bit convoluted, but it is logical...

Aaron Brown wrote:
> I like that, although as I said that possibility isn't as
> important since it "can't happen" in a proper text file.

Experience shows that it can happens, althought it is a quite extreme example.

You can do it with SciTE, for example, changing the EOL mode twice.

I have seen Dos files edited with vi on Unix systems, with mixed EOLs. Compiler was smart enought to cope with these files (after all, in C, <CR> and <LF> are still whitespace-like), but some editors choked on it.

Regards.
--
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/ (outdated)
http://philho.multimania.com (in French, for files to download)
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--