lua-users home
lua-l archive

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


> >> I was checking my file for this EOF marker, but there was none. Next, I
> >> removed the CR (0x0D), and this worked fine. I never thought this
> >> could be a
> >> problem, so it took some time until I finally tried what first seemed
> >> improbable to me. Is this a bug, or a feature?!
> >
> >I would put that in the bug list... A really portable application should
> >handle EOL as CR, LF or CR+LF.
>
> This is not a bug. See below.
> To me, it's still not clear what happened, but here are some facts:
>
> - The lexer simply ignores CR. It uses LF for signalling change
> of line (and
>   thus for keeping track of line numbers) but otherwise, LF is
> just whitespace.
>   So, the problem is not the presence or absence of CR.

OK, but I wonder how Lua behaves on Macintoshes and others systems using CR
as end of line.
I suppose a Mac port may need some adjustment here, unless the C runtime is
taking care of the needed conversions when opening a file in text mode.
I am not a regular Mac user (at least on the programming side), so it is a
rather theoritical thought.
Just wondering: as MacOS X is Unix based (I think), does it choose to adhere
to the LF EOL?

-- PL