[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: method keyword / preprocessor
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 22 Oct 2001 16:12:46 -0200
>I think that probably the easiest way to do that would be adding a code
>preprocesor. With this idea in mind I thought that it would be cool to have
>a customizable or plugable code preprocessor in lua, so that the users could
>customize their sintax. What do you think about that?
See etc/pp.lua in the distribution. It contains a redefinition of dofile that
uses an implementation of the 3.x preprocessor. The same kind of redefinition
can be used to pass a file through a trivial gsub that changes "method ()" to
"function (self)" and "method (" to "function (self, " (in this order).