lua-users home
lua-l archive

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


>It seems that the LUA_HOOKLINE event is not called for the first line of
>this simple program:
>
>line 1:print("Hello world");
>line 2:io.read(1);

It works if the line hook is set in a separate chunk:

 % cat h
 debug.sethook(print,"l")
 % cat i
 print("Hello world");
 io.read(1);
 % lua -lh i
 line    1
 Hello world
 line    2
 [wait for read...]

It does not work if the sethook is called in the same chunk:

 % cat j
 debug.sethook(print,"l")
 print("Hello world");
 io.read(1);
 % lua j
 Hello world
 line    3
 [wait for read...]

--lhf