lua-users home
lua-l archive

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


* 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.
 
> 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.

-- 
:wq
^X^Cy^K^X^C^C^C^C