[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to find unused local variables?
- From: "Eero Pajarre" <epajarre@...>
- Date: Mon, 19 May 2008 22:52:05 +0300
On Mon, May 19, 2008 at 2:38 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> I seem to remember that once upon a time LHF posted a script
>> that could be run over the output of luac to find unused local variables,
>> but I am not having any luck finding something in the archives.
>
> Neither am I. But I did find a script that does that though I'm not sure it
> does actually work... It's attached. Please let me know how it does :-)
> --lhf
>
It doesn't quite work...
I currently suspect that (sometimes?) it does not understand that the
parameters of a function are ok.
Also I was surprised to find that sometimes lua seems to leave holes
into the local variable allocation. This causes spurious "unused"-errors.
I fixed this in locals.lua by making it check that W[i] is defined
before giving this error for i.
Eero