[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Comparing the binary chunk of two functions for equality
- From: Joachim Bürmann <jbuermann@...>
- Date: Wed, 19 Feb 2014 15:53:05 +0100
Hello Luiz,
thank you very much for this hint.
I tested it and it works a lot better than the luaL_loadstring variant.
Unfortunately it doesn't work in all cases. I experienced that the
following two functions are equal when using luaL_loadbuffer:
function f() --comment\nprint(\"hello1\") --comment2\n end
function f() --other comment\nprint(\"hello1\")\nend\n
But not these two:
function f() --comment\nprint(\"hello1\") end
function f() --comment\n\nprint(\"hello1\") end
The only difference between the tow functions is an additional line feed
after the comment. But it's enough to make the chunk unequal.
I think we are very close to the solution (thanks to your hint). Maybe
there is only one little bit to do...
So I'm glad if you or someone else can show me the missing piece(s)
Thanks a lot to you Luiz and best regards
Joachim