lua-users home
lua-l archive

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


Hello Ico,

thank you very much for your fast response.

> * On 2014-02-19 08:53:05 +0100, Joachim Bürmann wrote:
>  
> > I have to know if the body of a given function was changed. If so, the
> > function must new applied to the recorded data.  The difficulty:
> > Changed comments or the insertion of some syntax irrelevant white
> > spaces must ignored!  Otherwise every additional line feed or
> > corrected comment forces a new call and redisplay of the protocol data
> > (which sometimes is a time consuming process). 
> > 
> > Unfortunatelly it seems that different white spaces or different
> > comments lead to a different chunk (or byte code).  My hope was that
> > comparing only the chunk gets me rid of removing all comments and
> > spare white spaces by hand.
> 
> My guess is that the debug info in the lua chunk changes with the layout
> of your source, there is at least information stored about line numbers
> of functions etc.

Yes, indeed that would explain it. I never thought about that.

> 
>  
> > I would really appreciate it someone is able to put some light on this
> > matter.
> 
> I'm not sure of comparing binary chunks is the way to go, you are
> depending too much on the implementation to tell you if the source has
> changed.
> 
> You might have more luck with processing the sources by removing all
> (non-string) whitespace of both versions and comparing the resulting
> strings.
> 

I was afraid that I have to do this and I already started with it.
Luckily it's not as complicated as it appears at a first glance...

Ok, thanks for your response and best regards

Joachim