lua-users home
lua-l archive

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


On Wednesday 17 October 2007, Brent Fulgham wrote:
> The original syntax was very tiny, with only a few operations (some math
> and numerical comparison test), and was only really meant to allow a
> particular operation in the application to be repeated some set number of
> times.  However, there are some syntax differences that might make it
> difficult to emulate in Lua.  Here is an example:
>
> x=1.0;WHILE x<4.0 DO
> StartTest;
> SetDuration[20000.0];
> x=x+1.0
> OD;
> Stop

instead of tryind to write a 'compatibility layer', maybe it would be easier 
to use some text-handling to translate your old scripts to Lua once and for 
all.

something like (using sed):

s/OD/end/
s/StartTest/StartTest()/
s/SetDuration%s*[(.-)]/SetDuration (\1)/

and so on

-- 
Javier

Attachment: pgpup017BNB0W.pgp
Description: PGP signature