[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: coverage analysis using debug interface?
- From: Norman Ramsey <nr@...>
- Date: Mon, 24 Apr 2006 10:53:19 -0400
> > Is there any way to enumerate all statements (or even all line numbers)
> > in all Lua functions?
>
> Use 'L' in debug.getinfo. The 'activelines' field in the debug info
> table is a table whose keys are the lines that contain statements.
> Here is an example:
>
> f=loadfile"test.lua"
> a=debug.getinfo(f,"L")
> for k in pairs(a.activelines) do print(k) end
Ah, nice. Not in the manual, I notice :-)
N