[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Recursively getting a list of all files executed using dofile
- From: marbux <marbux@...>
- Date: Sat, 14 May 2011 10:30:08 -0700
On Sat, May 14, 2011 at 8:10 AM, Benoit Germain <email@example.com> wrote:
> local old_dofile = dofile
> dofile = function( ...)
> track_node( ...)
> return old_dofile( ...)
> Since 'dofile' is a global identifier, any code that references it
> should call yours instead.
The problem with that approach for my use case is that I can't control
what code the users write. I need a method that analyzes what they
write rather than executing it. The dofile analogy would be that
nothing is known about the script being analyzed other than the
possibility that it contains one or more dofile lines and that the
files pointed to by those lines may also contain one or more dofile
lines, and so on ad infinitum.
In my case it's do-node lines rather than dofile lines, but the
problem is analogous. I can't force users to include particular code
in their scripts.
I think I've come up with a solution that I'll sketch in response to
Thanks for taking the time to think about my problem. I appreciate it.
The Massively Multi-Platform Outliner