lua-users home
lua-l archive

Re: Possible to retrieve CURRENT CHUNK for debugging?

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


> I'd like to retrieve the current chunk (whole chunk text) in a debug 
> hook call.
> I know how to retrieve the the current file name. But are the current 
> chunks saved somewhere so one can get them?
If you load chuncks with luaL_loadfile, the text is not stored.
If you load chuncks with luaL_loadbuffer, you can give the chunk text
as the chunk name and retrieve it as you would retrieve the file name.
If you load chuncks with luaL_loadstring, this is done automatically.

AltStyle によって変換されたページ (->オリジナル) /