lua-users home
lua-l archive

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

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