François Perrad a écrit :
Bernhard Schmalhofer via RT a écrit :
In r29552 of https://svn.perl.org/parrot/branches/pdd25cx I ran make test
for: pipp, eclectus, hq9plus, lazy-k, m4, unlambda.
All tests were passing.
in branch_pdd25cx, 221/1109 Lua subtests failed.
Mostly for same reason : exception handling.
$ cat nil.lua
print(- nil)
[trunk] $ parrot luc.pbc nil.lua
lua.pbc: EVAL_1:33: attempt to perform arithmetic on a nil value
stack traceback:
EVAL_1:33 in function '&main_10'
languages/lua/src/lib/luaaux.pir:788 in function 'docall'
lua.pir:303 in function 'handle_script'
lua.pir:123 in function 'main'
[branch_pdd25cx] $ parrot lua.pbc nil.lua
lua.pbc: attempt to perform arithmetic on a nil value
in this example, the exception is raised by the following code in
languages/lua/src/pmc/luaany.pmc (line #216)
PMC* neg(PMC *dest) {
PMC *meth = find_meth(INTERP, SELF, "__unm");
if (!meth)
Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_ILL_INHERIT,
"attempt to perform arithmetic on a %Ss value",
SELF.name());
...
The global exception handler for Lua is in
languages/lua/src/lib/luaaux.pir (lines 775-823),
with the function 'docall' and the closure 'traceback'.
Missing data are retrieved with the methods 'where' & 'traceback'
implemented in languages/lua/src/pmc/lua.pmc.
In fact 'docall' uses a pushaction.
François.
How rewrites it in branch_pdd25cx ?
François.