[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: getinfo for activelines on load/loadstring result
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 19 Feb 2015 09:39:22 -0200
> > local b = (loadstring or load)("function a()\n print(1)\n
> print(2)\nend\n return a") -- added "return a"
> > local d = b()
>
> Right, this works, but this is not quite what I'm looking for; this is why
> I added "without executing the fragment". The general task is to figure out
> the code lines in a file (those that may have breakpoints) without
> executing it. I thought that's what activelines gives me, but it doesn't
> seem to be the case (or maybe I'm not using it the right way), hence the
> question.
Functions in a chunk are only created when you execute the chunk. So,
while you do not run the fragment, there is no "function a" to be talked
about.
-- Roberto