[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Line-ending bug on Mac
- From: Nils Svangard <nils.svangard@...>
- Date: Sun, 22 Jul 2001 21:50:18 +0200
Hello,
I'm not sure if this has been covered already but I've found a bug in
Lua 4.0's lexer, dealing with line-endings under mac. If the file is
saved with mac-endings ('\r') comments does not work, but after
modifying llex.c::luaX_lex alittle, this works.
My changes:
case ' ': case '\t':
next(LS);
continue;
case '\r':
inclinenumber(LS);
if (LS->current == '\n')
next(LS); // Don't count lines twice on Windows.
continue;
case '-':
next(LS);
if (LS->current != '-') return '-';
do { next(LS); } while (LS->current != '\n'
&& LS->current != '\r' // End comment on mac's as well, but
increases linecount twice on windows?
&& LS->current != EOZ);
continue;
Cheers,
--
Nils Svangård - http://www.svangard.net - ICQ: 1332261