Help me!

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Help me!

Minardo Gollun Gonzalez Lopez
I need a code, using Lua5.1.2 that allows me to load a Lua file and print the name of all the functions that have the document. Please any people that have an example or tutorial send It to me because I have not been able to make an example that loads lua and execute it correctly using the latest libraries.
 
Saludos: Ing. Minardo G. González López.


Reply | Threaded
Open this post in threaded view
|

Help me!

Minardo Gollun Gonzalez Lopez
I need a code, using Lua5.1.2 that allows me to load a Lua file and print the name of all the functions that have the document. Please any people that have an example or tutorial send It to me because I have not been able to make an example that loads lua and execute it correctly using the latest libraries.
 
Saludos: Ing. Minardo G. González López.


Reply | Threaded
Open this post in threaded view
|

RES: Help me!

Rafael - SosCpdTerra
Can't you do it with string.gmatch, reading the file 2 times, one to run and
other just reading the contents and serching for keywords? Like seek the
file looking for string.gmatch("function(")?


-----Mensagem original-----
De: [hidden email]
[[hidden email]] Em nome de Minardo Gollun
Gonzalez Lopez
Enviada em: quarta-feira, 4 de julho de 2007 11:17
Para: [hidden email]
Assunto: Help me!

I need a code, using Lua5.1.2 that allows me to load a Lua file and print
the name of all the functions that have the document. Please any people that
have an example or tutorial send It to me because I have not been able to
make an example that loads lua and execute it correctly using the latest
libraries.
 
Saludos: Ing. Minardo G. González López.


__________ NOD32 2378 (20070704) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com




Reply | Threaded
Open this post in threaded view
|

Re: Help me!

Julien Hamaide-2
In reply to this post by Minardo Gollun Gonzalez Lopez
Minardo Gollun Gonzalez Lopez wrote:
> I need a code, using Lua5.1.2 that allows me to load a Lua file and print the name of all the functions that have the document. Please any people that have an example or tutorial send It to me because I have not been able to make an example that loads lua and execute it correctly using the latest libraries.
>  
> Saludos: Ing. Minardo G. González López.
> 
> 
using lua.exe

execute lua dump_function.lua your_script.lua

dump_function.lua:

file = ...

dofile( file )

for key, value in pair( _G )
    if( isfunction( value ) ) then
        print( key .."\n" )
    end
end

It should do the stuff( I've not tested, but you get the idea )

-- 
--
Julien Hamaide
Engineering Coach
10Tacle Studios Belgium / Elsewhere Entertainment