lua-users home
lua-l archive

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


> It seems, however, that calling error() in the linehook is not
> aborting anything. Are there other solutions?
You can use the exit() function to terminate the program.

> The other thing that puzzles me, is that when I run a script file
> like the one below, the linehook function doesn't kick in until
> the second time I run it. What might be the reason for that?
A Lua bug.
It seems to work fine if you change in lvm.c the lines 364 and 365:

if (linehook)
  traceexec(L, base, top, linehook);

with the following:

if (L->linehook)
  traceexec(L, base, top, L->linehook);

(and you can delete the line 351)