lua-users home
lua-l archive

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



Couldn't you put a line hook on the code and count calls to that?

Nick

> -----Original Message-----
> From: Ando Sonenblick [mailto:ando@spritec.com]
> Sent: Thursday, August 21, 2003 10:48 AM
> To: Lua list
> Subject: Detecting an "empty" script?
> 
> Gang,
> 
> I need to determine if a Lua script does something -- anything -- nor
not.
> 
> For example, this script does nothing:
> 
> "function main(arg)
> 
> end"
> 
> While this one does:
> 
> "x = 4"
> 
> I know I can technically parse the text of the script to determine if
it
> will do anything or not, but that seems like a lot of work trying to
> decipher things.
> 
> 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?
> 
> Any thoughts?
> 
> Thx,
> Ando
> 
> 
> -----------------
> SpriTec Software
> www.spritec.com
>