[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Detecting an "empty" script?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 21 Aug 2003 15:07:07 -0300
>I need to determine if a Lua script does something -- anything -- nor not.
I think this is similar to the halting problem, right?
>For example, this script does nothing:
>
>"function main(arg)
>
>end"
It sure does: it sets the global "main".
>Is there a way that Lua can be convinced to determine this for me? I'm
>thinking that once the script is compiled, one could quickly scan it for any
>"set" opcodes and such?
If you're worried only about variables being set, then you can easily parse
the output of luac -l, as etc/globals.lua does.
Does the script below do something?
for i=1,10 do end
--lhf