[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: # comments (proposal)
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 11 Feb 2003 21:12:34 -0200
>I agree, but I also think it will need to be for
>the version after Lua 5.0. As I understand it,
>Lua 5.0 is in "feature freeze" now.
Yes, that's right. Moreover, # comments (and much more) can be implemented by
the host program because Lua 5.0 uses lua_load to load chunks, and lua_load
calls a user function to get bit of text (or bytes). In other words, if you
want to support # comments, then write your lua_load callback so that you read
and return whole lines, skipping those starting with #. I'm not claiming this
is the best/nicest way of doing it (surely, the simplest way is just to add a
couples of lines to llex.c :-), and it will have trouble with long strings
([[...]]) but it definitely works fine and as planned for lua_load. The only
thing is that the standard loadL_loadfile and lua_dofile do not do this, but
that's ok.
--lhf