lua-users home
lua-l archive

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


erik@hougaard.com (Erik Hougaard) writes:

> ----- Original Message -----
> > I think you should *run* (not walk) over to your pristine Lua 4.0 source
> > tree and apply this patch to llex.c:
> > That's the current ANSI C implementation of the support for this
> > Unix-centric scripting function.  And it affects the lexing of every Lua
> > chunk, not just files.  You're already using it if you still have the
> > parser.  Oh, and by removing this, you'll regain ~100 bytes of sparc code.
> 
> And this should not be part of llex.c in the first place, it should be part
> of lua.c .. It has nothing to do with the lexer, and this is my whole point.

This is incorrect.  The '#!' test for ascii input must be part of of
the standard libraries, and not just implemented in lua.c.  Otherwise,
a file that starts with '#!' cannot be loaded using dofile.  Surely
you are not asking that the interpreter use a different version of
dofile, are you?

Of course, another solution is to allow the use of '#' as another
comment start indicator, but that is not a serious proposal.

John