Hi,
Those prefix are added internally by the Lua
interpreter. iuplua_dostring/iuplua_dobuffer simply call luaL_loadbuffer.
If I add that prefix it will not find the file or incorrectly interpret the
string.
The problem in debugger I already reported to the Lua team (in the Lua
list), but I got no result.
============================================================
In *lua_Debug *documentation, "source" description states that if the
function was defined in a string then "source" is that string.
I may misunderstood it but it seems that in this case source is
the chunkname, not the string. If chunkname is not used in load, then
chunkname is the string, which results in what is described. But if
chunkname is used then "source" is not the string where the function was
defined.
I tested in Lua 5.1, 5.2 and 5.3 and they all behave the same.
So, is there a problem in the documentation or in the debugger?
Assuming it is just a problem in the documentation, during debug how can
we retrieve the original string given the chunkname?
============================================================
If anyone has a light on this please let me know.
Best,
Scuri
Em sex, 20 de jul de 2018 às 03:54, actboy168 <actboy...@gmail.com>
escreveu:
> The debugger uses debug.info(1, 'S').source to determine the mapping
> between function and source code.Please see lua's docs
>
>
>
> https://www.lua.org/manual/5.3/manual.html#lua_Debug
>
>
>
> > source: the name of the chunk that created the function. If source
> starts with a '@', it means that the function was defined in a file where
> the file name follows the '@'. If source starts with a '=', the remainder
> of its contents describe the source in a user-dependent manner. Otherwise,
> the function was defined in a string where source is that string.
>
>
>
> When the `source` starts with neither '@' nor '=', the content in the
> `source` is the source code. And the fourth parameter of luaL_loadbuffer
> determines the `source` of the loaded function.
>
>
>
> But now iuplua_dostring/iuplua_dobuffer does not comply with this rule.
> The function loaded by iuplua_dostring, the `source` starts with neither
> '@' nor '=', so the debugger thinks it is the source code itself, but this
> is wrong.
>
>
>
> Can iup make iuplua_dostring use the correct `source`? Add '=' before name
> or use 's' instead of 'name'.
>
>
>
> -- actboy168
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users