[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Re: python like syntax for lua
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 13 Jun 2003 21:40:40 -0300
>E> This could very easily be done as a pre-processor written in Lua...
>You are right, though it has to handle string literals, comments and
>may have other problems.
>Here is a pre-alpha pre-processor that converts lua-scripts to
>python-like syntax (just removes extra 'end' keywords for now) and
>back. It is just a concept test and works only for very simple scripts
>(at least it works for its own source).
I have a simple utitily function that links with the lexer from the Lua core.
This would be the ideal tool for this task as all the hard parts are taken care
of automatically and in exactly the same way Lua does it.
I have posted versions of this code before in the list. If there's any interest
I can package it (after I finish the posix library!).
Alternatively, if the source code is well behaved, it can be done directly
in a lua_load callback, so that "end" would be inserted whenever the identation
backs down a level. Or something liek this.